[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1779644242785.png (128 KB, 598x648)
128 KB PNG
This is the real reason why everyone is moving to Go and Rust.
>>
>>108897026
by that logic Rust is indian-coded because it treats you like a retard who will mishandle memory.
>>
>>108897026
Dumbest fucking post I have ever read. Twitter crossposters should be shot on sight.
>>
I don't like exceptions and don't use them in C++ but this post is A) stupid and B) racist
>>
>>108897108
>by that logic Rust is indian-coded
I'm OK with this.jpg
>>
>>108897245
it's not wrong though.
People need to stop writing code with the intention or assumption of failing.
OOM shouldn't be a transitive "what-if virus" that forces your entire code base in a giant try catch
>>
>>108897026
nocoder luddite opinion, you cant know how every single thing can potentially fail, and for most of them you dont want the rest of the program to crash if they do
>>
>>108897425
>you cant know how every single thing can potentially fail
barring hardware failure, you certainly can.This defeatist mentality is why software is so FUBAR
>>
it's pretty based how the biggest trick for making AI code good is giving it an autistic compiler janny
>>
>>108897026
>shitter + repost + retard
peak /g/eet content
>>
>>108897441
I love how the more comments there is ITT, the more HSV is proven right
>>
>>108897277
Youre stupid and racist. Ignore the issues at your own peril but dont expect to drag the rest of us into your delusion.
>>
>>108897441
>barring hardware failure
so you literally cant.
>>
>>108897490
Dont be daft. You can and if you dont see dont expect us to wait on you to catch up.
>>
>>108897338
You tinker trannies don't understand the idea that you might need to do anything that relies on external, untrusted information. Exceptions are not for internal logic errors, retards. No one uses them this way.
>>
>>108897504
you already admitted that you cant predict it fully, which means you have to account for those types of failures with try anyway
>>
>>108897490
You don't write software for the 0.001% case, you write it for the majority of people with working machines that will open and close your program.
>>
>>108897510
What's so difficult about falling back on safe defaults in case of network or other external issues?
Why do you need exceptions for that?
>>
>>108897026
Obviously true. The other factor though is just scale. If you want good programmers they are expensive, will not tolerate being treated like shit and will argue with you if you try to do something retarded.
So you could higher them and deal with them and get good code, or just hire 100 retarded indians who try to hack together the code and have exceptions everywhere, but at least they will lie to you and say they are doing what you say and they think it's a good idea!
>>
>>108897514
a lot of software is meant to run for a long time and a lot of people will run it 24/7, 0.001% failure rate means the program will crash if left to run for hours or if it needs to do a lot of work

not caring about exceptions because something is "good enough" for normies is the thing that is pajeet coded
>>
>>108897527
Because it's an exceptional scenario. What, are you going to if/else tree your whole program for every possible transient error? Lmao.
>>
>>108897545
>program run length equates to failure rate
THAT is pajeet coded
>>
>>108897108
fpbp and /thread
>>
>>108897558
yes rakesh, a program having a % of failing while doing a specific thing makes the failure rate go up over time when it does that thing over and over again
>>
>>108897554
No?
Programmers invented this useful concept called Maybe
>>
>>108897571
>doing a specific thing makes the failure rate go up over time when it does that thing over and over again
Computers were literally invented to solve this problem.
>>
>>108897580
>doesnt get it
literally lower iq than a 1b llm
>>
>>108897586
I get the principle of what you're saying, my point is, the software side shouldn't increase the %
>>
>>108897026
I never 'got' error checking, can someone info pill me? Like the error is 'caught' then displayed and this means the program does not explode (if it is not program breaking)
>taken C++, JAVA, python classes
>>
>>108897026
>>108897338
Exceptions are syntactic sugar for an if/else block you fucking retards. It's nothing special
>>
>>108897606
>pattern matching 2 cases is a herculean task
>>108897617
They're not just sugar, they're abstractions that slow down your program, and in bad langs, bloat memory use too
>>
swift and zig have my favorite error handling. the try / catch / defer system. You get explicitness but with the brevity of exceptions. Can't wait until C++30 or whatever supports them natively.
>>
>>108897622
they don't slow down nim
>>
>>108897026
Sounds like a LLM trying to emulate 85 IQ Americoon /pol/tard takes.
>>
maybe try not thinking about indians all the time and you'll be able to have replacement birthrates again
>>
>>108897338
Error handling is error handling, exceptions only change where the error is handled, and I really don't like using exceptions
>>108897245
sippy bippy
>>
>>108897026
troll post. if u wrote even 1 program you would know.
>>
i have been using try and catch since the 1st month i was a programmer. it is essentially a much wider if else
>>
>>108897026
Exceptions only make sense with interactive languages (Python, Lisp, etc.) during development specifically. They all stem from the condition system present in Multics, which, while overengineered, provided real advantages especially when debugging.

Outside of that specific situation, they solve no real issue and only cause problems. I never bought into the most common justification

>they separate error handling from core logic bro!

because error handling IS part of the core logic. Your program opens a file. The file may not exist at runtime, this is beyond the programmer's control. What then? A robust program must handle that situation.

As for error propagation, it's far better done explicitly through return values. Not surprisingly, even the latest Sepples standards are moving in that direction.

Just like many things in programming, exceptions were an interesting experiment which, however, proved unworthy in actual practice.
>>
>>108897490
If you have a geniuine hardware failure, all code running on the CPU becomes unreliable, hence you can't be sure it will even throw an exception at the software level. It may trigger a CPU hardware exception, but that is a completely different, almost unrelated thing.
>>
>>108897781
>and you'll be able to have replacement birthrates again
No thanks, I want affordable housing first.
>>
>>108897026
mayo monkeys are so buckbroken they let indians shit in their heads 24/7 rent free literally
>>
>>108897026
a very dijkstrian take, unfortunately not really tractable in the 'real' world.
>>
>>108897026
Try/catch is only valid when your code relies on some other service/user not being broken or retarded. If it's otherwise relying on your own code/files, then it's not acceptable.
>>
File: HIDXHz2XcAAaLjC.jpg (347 KB, 1481x1289)
347 KB JPG
>>108897108
You figured it out.... why it's all happening.
>>
>>108897617
Exceptions are syntactic sugar for
COME FROM you fucking retards.
>>
>>108897245
Hello jamboooy
>>
>>108897026
>The white man
Stopped reading there, white supremacist garbage.
>>
>>108897026
I just read a bunch of white victim complex and nothing of substance.
>>
>>108897026
I moved to Go in 2018 because https://github.com/ffuf/ffuf was released and I have never looked at another language except python since.
>>
>>108897108
indians are filtered by the borrow checker though, that's why they tend to hate the language.
>>
>>108899400
I asked this guy who worships OOP and C++/C# to explain the borrow checker because he was criticising Rust, and he had no idea how to define the borrow checker or what its purpose was. The sad part? He was white. Embarrassing.
>>
>>108899372
the nigga running that got a job or something he aint make no public commits in a long ass time
>>
>>108899414
we are talking about normal distributions.
the smartest jeet is smarter than the dumbest white.
but the mean jeet is an absolute retard compared to the mean white.

besides intelligence there's a whole way of thinking thing which imo is the worst offender.

anyway
>who worships OOP
pretty obvious he'd be a retard.
>>
Why are we trying to create bumber rails for our brown friends? We need to do the opposite of that.

Everything should be written in assembly. And if that is too costly then your project doesn't matter and no code should be written at all.
>>
>>108899849
/thread
>>
>>108897026
you had me going until shilling for go and rust
>>
>>108897510
t. never worked with jeets
>>
>>108897617
i am sorry that your mother dropped you on your head when you were an infant
>>
>>108899540
i reject the premise
>>
>>108897622
but herb and bjarne told me it was a zero-cost abstraction
>>
File: ef7.jpg (84 KB, 500x370)
84 KB JPG
>HSVSphere
>>
File: 1779698771286.png (799 KB, 720x885)
799 KB PNG
>>108901291
Outdated. Turks look like this now
>>
>>108897510
>Exceptions are not for internal logic errors, retards. No one uses them this way.
I do things like 'default: throw std::logic_error("missing case")' in my switch statements. The compiler isn't smart enough to tell if the cases are exhaustive without a default case. I could add a value to an enum and forget to add it to the switch and the compiler won't warn me.
I would say that assuming you will ever make mistakes aka false bravado is more brown-coded than defensive programming. Top-tier projects like Sqlite are respected in part because they do exhaustive testing, not because the authors just don't make mistakes.
>>
>ctrl+f interrupts
>0 results

dogshit noob board
>>
>>108897622
>They're not just sugar, they're abstractions that slow down your program
You only pay a substantial cost when an exception is actually thrown. There is a platform-dependent cost (0 on some platforms) of entering a try/catch. There is no extra cost on the good path, whereas the good path for return values pays a cost in each stack frame (if/else has to be compared and a branch has to be taken that may be mispredicted, so every stack frame has overhead in the happy path with return values). If exceptions are used only in exceptional circumstances then the cost is negligible.
To be honest I rarely catch exceptions at all if I use them. I usually treat them as an exit path and nobody sane would try to optimise the exit path of a program.
>>
>>108901577
How are interrupts relevant to the discussion?
>>
>>108897026
hardware have exceptions too, are all cpu indian?
>>
>>108901600
>>108901577
Interrupts don't unwind the stack, they only push some registers to it
They are closer to "context switch" than exception
>>
>>108897554
>are you going to if/else tree your whole program for every possible transient error
yes. one of these go after every function call that can return an error, depending on whether you want to handle the error immediately or let it bubble up the function stack

result, err := transition(nigga)

if err != nil {
return fmt.Errorf("failed to be a woman: %w", err)
}

if err != nil {
go doMassShooting()
}

for hardware errors and actually unexpected shit like that there is a thing called panic which is more like a try catch, but reserved just for that class of error
>>
>>108901604
exceptions are just glorified if else goto, aren't just white man stuff then?
>>
>>108901522
use an enum for the case labels fartknocker
>>
>>108897490
You can't catch a hardware failure in software either.
>>
>>108897026
exceptions are goto on steroids.

https://www.lighterra.com/papers/exceptionsharmful/
>>
>>108901577
paradoxical ass comment
>>
This is why everyone hated perl.
>>
>>108897108
I've never met a programmer who hasn't mishandled memory. Even non-human ones.
>>
If you wanted sane people to use rust then you should simply hang the tranny crab mascot, axe the coc, and let devs who believe men cannot become women submit contributions
>>
>>108901703
https://www.ideone.com/dqSKKG
No error, no warning
>>
>>108901703
>>108903683
you need -Wswitch
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.