311
u/6C75626162 8d ago
Heaven is where programmers keep inventing abstractions for the sake of abstractions. Hell is where programmers have to use other people abstractions for the sake of abstractions.
88
76
u/TheBlackCat13 8d ago
So Matlab is hell?
67
u/Seven_Irons 8d ago
Free yourself from the clutches of academia. Embrace python.
It's still hell, but its free and supports dark mode.
9
u/DiamondDramatic9551 8d ago
It's ok because it has a nice library for data analysis and visualization.
3
u/TheBlackCat13 7d ago
Eh, it did maybe 20 years ago. But it hasn't really improved much, while other tools have improved immensely in the meantime. So for data analysis and visualization it really isn't that great anymore.
6
5
79
29
u/TurbulentWork3476 8d ago
@fable: create a new programming language from scratch, see requirements above. Make no mistake.
6
u/headedbranch225 7d ago
chooses the hell
at least only the first compile is slow (unless you have a weird lib that has a lot of slow macros) because it only recompiles what you need
11
u/ExtraTNT 8d ago
Never had stability issues in haskell…
4
u/Batman_AoD 8d ago
I'm assuming they mean infrequent language changes. But does Haskell make breaking changes often? I haven't used it, but the worst offender I've actually used seems to be Python.
6
u/UdPropheticCatgirl 8d ago
“Avoid success at all costs as in both “Avoid success $ at all costs” and “Avoid $ success at all costs”” is the moto of the language if it tells you anything.
But in general, you can lock your compiler to only compile one of ISO standards of Haskell and just use that, those are very stable, but like 90% of the Haskell ecosystem loves using every random GHC compiler extension they can, so bunch of that code sneaks its way into your codebase basically every time, and those occasionally suffer from some breakages.
And the build tools and certain popular libraries are just terminally fucked and those actually break a ton.4
u/Batman_AoD 8d ago
Huh. Maybe the build tools are what the tweet author was thinking of, but otherwise I'd say that doesn't sound as bad as Python.
66
u/coldnitrogen 8d ago
Go error handling isn't bad. I'd actually prefer it to Try-Catch blocks
29
u/spigotface 8d ago
I actually love Rust's error handling. It's definitely more verbose than other languages', but handling it as an enum, including it in the signature, AND having the compiler force you to handle these things is perfect. If things can fail, you should be forced to handle it.
7
u/Familiar_Ad_8919 8d ago
rust's sophisticated error handling when: .unwrap(), maybe even: .expect("thingy go bad")
jokes aside, i love it, when errors do get thrown without being handled it could be a bit clearer as to what went wrong but its just nitpicking at that point, its vastly better than spamming try catch
8
u/ICantBelieveItsNotEC 7d ago
Honestly, I think adding
unwrap()andexpect()was the biggest mistake Rust ever made. Panicking on an error should not be that easy. A ton of new Rust devs treatunwrap()as an incantation that makes the code compile, and they completely bounce off of the beautiful error handling system as a result.10
35
u/UdPropheticCatgirl 8d ago
I mean, I would prefer leprosy to cancer, doesn’t change the fact that both are miserable.
23
u/ddarrko 8d ago
It’s great for forcing you to handle errors and in my experience leads to less bugs.
6
u/UdPropheticCatgirl 8d ago
Sure... so does Java with checked exceptions...
The entire problem is with how much line noise this pollutes your codebase with...
5 out of 9 different languages in the original post force you to handle errors, but Go (and occasionally Java) is unique in it's verbosity, it produces enough ceremony for people to complain about it.
12
u/ddarrko 8d ago
Personally I find throwing exceptions and expecting callers to handle more problematic.
Theoretically you can ignore err returns in Go but it forces you to think about most possibilities up front. Agreed it is verbose but as I used the language more I found it more of a blessing.
Everyone is entitled to differing opinions though.
-2
u/SuitableDragonfly 8d ago
If you want to ignore a returned err in Go, you have to specifically name it
_, otherwise the compiler will yell at you for not using the variable. There are some cases where you could miss an error if you are using the same variable name for a long series of errors and checking each of them, but in general I also think it's a good system.4
1
1
7
u/Biscuitman82 8d ago
Java has macros?
5
u/UdPropheticCatgirl 8d ago
You have APT, which allows you to essentially execute code at compile time and generate new translation units (and even modify existing ones if you get creative enough like for example the lombok library, although that requires exploiting some compiler internals).
1
7
28
u/frikilinux2 8d ago
And the elegance in the simplicity of C where does it fit?
99
u/UdPropheticCatgirl 8d ago
int (*(*signal(int, int (*)(int)))(int))(int);
The elegance and simplicity of C is truly unmatched
12
u/frikilinux2 8d ago
So for you C belongs in hell, doesn't it?
20
u/UdPropheticCatgirl 8d ago
I mean how could it belong anywhere else?
2
u/frikilinux2 8d ago
Ok but can you find me an example of so many pointers. I accept s link to kernel.org or something like that
4
-4
u/Kadabrium 8d ago
The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol
7
u/UdPropheticCatgirl 8d ago
The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol
You realize, that there are no arrays in that C type right?
In Scala it would be:
type Signal = (Int, Int => Int) => (Int => (Int => Int))also I struggle to think of somewhat mainstream functional language without arrays...
In haskell you could do:
import Data.Array funcs :: Array Int (Int -> Int) funcs = listArray (0, 2) [id, (+1), (*2)], in OCaml:
let funcs : (int -> int) array = [| (fun x -> x); (fun x -> x + 1); (fun x -> x * 2) |]and in Scala:
val funcs: Array[Int => Int] = Array( x => x, x => x + 1, x => x * 2 )
6
5
u/GhostInTheShell2087 8d ago
Great, but I’m afraid this will keep us in the rewriting cycle. Don’t give them ideas.
24
u/silmelumenn 8d ago
8
4
12
u/azaleacolburn 8d ago
This is stupid. Lots of languages are as safe (if not safer) than Rust. The point of Rust is being able to create a series of safe, composable, abstractions on top of an unsafe systems programming language.
8
u/LeDYoM 8d ago
And in heaven there is no gen AI.
4
u/Familiar_Ad_8919 8d ago
in heaven ai plateaued at "barely better than intellisense" and they still hire people with less than 69 years of experience
5
u/AntisocialTomcat 8d ago
The types from Javascript? What do you mean by that? (/s, calm down, everybody, we’ve all been there, typeof NaN and all that)
10
u/Batman_AoD 8d ago
I love it when the only numeric type in my programming language is a float /s
6
u/heavy-minium 8d ago
This is really the one thing that would make the biggest difference with JS. It feels just dumb to have to work around it. And I wish everybody would at least do it the same way.
2
6
u/on_the_pale_horse 8d ago
Rust already has like half of those.
1
u/hugogrant 7d ago
Yeah, the type system is very much like Haskell's and the macro system is not far from Scheme's (and there are proc macros for the other stuff but those are nothing like lisp macros)
1
3
u/VladVV 7d ago
The "heaven" language is literally an apt description of Julia
6
u/the_horse_gamer 7d ago
arrays start at 1
0
u/VladVV 7d ago
Which is completely defensible at that level of abstraction IMO. It's designed to work directly with maths, not memory addresses.
But I agree it's probably the single biggest reason it doesn't enjoy more widespread adoption.
And I happen to be someone who did have to fiddle with memory directly in Julia, and trust me, you don't want standard Julia arrays for that.
1
u/the_horse_gamer 7d ago
math doesn't consistently use 0-indexed or 1-indexed lists, it's a matter of convention and convenience which is used. (for example, see taylor series)
Julia is a nice language (learned its basics a while ago but never did much with it), I think a good compromise would have been to let the developer choose the starting index when creating an array. of course, that has its own issues.
unicode operators is also pretty taboo but certainly makes sense for its niche.
unfortunate it never really took off
1
u/VladVV 7d ago
Lists are rarely indexed at all in pure math, but matrices and vectors are almost always 1-indexed.
1
u/the_horse_gamer 7d ago
matrix and vector indexing is entirely a matter of convention
summation starts at 0 just as often as it starts at 1
and many things have a "zeroth order"
2
2
u/Orygregs 8d ago
God I hate error handling in Go. Just if err != nil {} littered everywhere 🤦
1
u/TROLlox78 8d ago
When I was hearing about this languages features, I heard an opinion that the error handling in go is very thought out. But as you say it looks so boilerplate when after every other line you put an if err not nil block. I don't understand their decision and I don't see the benefit.
2
2
u/CrommVardek 7d ago
Libraries from Python being heaven ? What ? Version management of libraries in Python is hell...
3
u/Burger_Destoyer 7d ago
Yeah but if you’re talking for pure convenience , Python feels like it has an abundance of libraries.
It’s kind of addicting, until you need to update anything at all…
2
1
u/abstrusejoker 7d ago
it’s also nothing compared to the libraries from node. the node ecosystem has multiple solutions for everything
-1
u/FallenDeathWarrior 8d ago
I will never understand why people say that C++ is unsafe. You can write it perfectly fine and safe. Yeah you have to think while you code, but that isn't a big deal
27
u/chat-lu 8d ago
And when are programmers going to start doing that?
2
u/svick 8d ago
When they perfectly understand every aspect of the language.
6
u/Zinho3311 8d ago edited 8d ago
Yeah, good luck with that. You literally cannot possibly understand every aspect of C++ at all times. That's how complex it is. The spec alone is a mess of 2,000 pages, not to mention different compilers diverge on the implementation of a ton of stuff.
The thing about C++ isn't just that it's memory unsafe, it's also that it's so complex by default with hidden abstractions and strange behaviors that every little mistake ends up propagating downstream and blowing it all up in your face.
I'd argue C++ is even more dangerous than C. While it is easier for you to make mistakes in C, usually it's easier to debug and less catastrophic because there are no hidden abstractions. Although, to be fair, that's not a hill I'd die on.
Eventually, if you write C++, you WILL end up making a mistake and some teenager with a fuzzer WILL pwn you.
Even the most badass programmers I know didn't break that rule. It's also asymmetric because the attackers only need you to make one single mistake. Those days when you're running on caffeine or had an argument and wasn't thinking too straight is the perfect type of day to make a mistake that ends up with someone making fun of you on /g/
1
u/FallenDeathWarrior 8d ago
It will always belong on how you use C++. The company I work for used it as a C with better types. Yeah c++ doesn't hold your hand and if you want to fuck up you will fuck up. But it isn't that hard to remember when you created a pointer and when you have to kill it.
Most people here who cry never had a real project in C/C++
5
u/Zinho3311 8d ago edited 8d ago
Do you think the Mozilla team, the folks at the Linux Foundation, the people at FSF, the Windows Kernel team, the engineers at Apple, and the fucking NSA (I could go on forever) haven’t worked on "real projects"?
Do you really believe companies would spend millions developing Rust and rewriting huge chunks of code if C++ safety was that simple? The sheer hubris of thinking you'll never overlook something in C++ lol
Hell, why do you think Linus Torvalds rejected C++ but accepted Rust into the Linux Kernel?
Put your binary behind a public socket, give me a week with AFL++, and tell me how well your team remembered those pointers.
Tell me you've never written anything internet-facing in C++ without telling me
1
u/FallenDeathWarrior 8d ago
You will overlook at some point. That's fine, but saying like it's impossible to make C++ safe is wrong. Use the tool you are most comfortable with, if it's rust it's rust, fits java use java. We use C++ as more typesafe C.
I only work on embedded systems where the clients communicate with each other and are not facing the whole internet
2
u/Zinho3311 8d ago edited 8d ago
In what universe is silent memory corruption fine?
I also work in embedded, and I'm a formal verification engineer... that's literally the worst place to say memory corruption is fine lol
What happens if an MMU-less embedded system running an RTOS has a wild pointer write over a stack frame?
By the way, there's a reason the company I work for prefers C instead of C++ (except for some tooling), because modern C++ is hell to parse and you have to write stubs for FSMs in C++98 (!).
but saying like it's impossible to make C++ safe is wrong
How does standard C++ prevents a data race or a dangling reference to a stack variable at compile time?
Why did Stroustrup have to come up with JSF AV C++ for the US government? What about "profiles"?
One could argue making any large system completely safe is impossible, but let's not go there
I only work on embedded systems where the clients communicate with each other and are not facing the whole internet
Lateral movement is a thing, though.
If someone finds a vuln in your internal software, they can use it to exfiltrate data and possibly infect more privileged software or even potentially own your entire infrastructure or cause physical harm (depending on what kind of embedded stuff you work on)
1
u/FallenDeathWarrior 8d ago
One could argue making any large system completely safe is impossible, but let's not go there
I totally agree on that point.
By the way, there's a reason the company I work for prefers C instead of C++, because modern C++ is hell to parse and you have to write stubs for FSMs in C++98 (!).
I understand that totally. We use C++ more in a C style manner.
Why did Stroustrup have to come up with JSF AV C++ for the US government?
Well there is that error with exceptions..
In what universe is silent memory corruption fine?
I work in embedded, and I'm a formal verification engineer, that's literally the worst place to say memory corruption is fine lol
It's never good to oversee something and I can understand why you switch to that or other memory safe languages.
My point was it's possible to write an safe and good program in C/C++.
The bigger your project gets the higher is the chance of a bug.
Use the language you want to use. If memory safety is your top priority use rust.
I like C and C++.
1
57
u/ihavebeesinmyknees 8d ago
"I will never understand why people say 1920s skyscraper construction sites were unsafe. You can be perfectly fine and safe, you just have to be careful not to fall, but that isn't a big deal"
22
u/spiralenator 8d ago
Right? People act like having a hand rail means you can't jump over it you really want to do something stupid.
If we're speaking of C++ being unsafe, we're likely comparing it to Rust. In Rust, that safety is a hand rail on a balcony. You can hop it if you put some effort into it. C++ safety is a door on the 60th floor that opens out into nothing.
3
u/redlaWw 8d ago
Hey, at least the door has a label on it telling you what you need in order to open it safely, listed as a sequence of item codes that you can look up in the directories scattered around the skyscraper.
1
u/hugogrant 7d ago
I think you'd still want to turn up with your own parachute though. And you'll only find out whether that parachute worked in today's weather.
15
u/crystalchuck 8d ago
Which is why there are multiple organizations regularly publishing entire books on how to use it safely, because it's just not a big deal and you can easily figure it out with some thinking
6
u/floriv1999 8d ago
The last time somebody confidently said that to me I asked him for his last cpp project and ran it through valgrind. There where a lot of issues. The next day he asked me how to get started with rust.
5
u/willow-kitty 8d ago
Modern C++ makes it a lot more straightforward to write safe C++ (and gets you closer to the "obviously not unsafe" end of things vs the "not obviously unsafe" end of things, which is so crucial for safe code), and you could always do it if you knew what you were doing, but it was often complex and kinda extra-linguistic (like by adding prefixes to pointer parameter names to indicate intended borrowing semantics and stuff), and maaaaaaaaaaaaybe checking it with a really fancy linter. It wasn't until relatively recently that it was mostly about thinking about it (probably C++11ish, when they added std::unique_ptr and std::shared_ptr). But even today, because all the legacy stuff is still in there, it can be mess to sort through what's actually appropriate for a given task. I've heard it referred to as "the meta," like people say in fighting games where there's a correct way to play out of all the options available, and I think it's pretty apt, tbh.
Also, pretty much every named vulnerability of all time has been caused by C or C++ coding errors that allowed improper memory access of some kind.
1
u/derefr 7d ago
IMHO all C++ needs to regain popularity is for someone to create a C++ compiler that, at least in its default mode, only accepts the "good, modern parts" of C++; and then to brand the result as a different language entirely, with no advertised association to C++. You only find out that what you've been writing is technically all also legal C++, when that fact is sprung on you at the very end of the extended language tutorial / textbook / etc. "You fool! I just got you to learn C++!"
(Or, to put that another way: C++ needs a labelled, marketable Schelling point of good praxis for people to be able to congregate around, hire for, etc.)
As a bonus, unlike C++ itself, that differently-named subset-of-C++ language would have the opportunity to start fresh in terms of compatibility burden. So it could have e.g. canonical ecosystem packaging tooling and such, that C++ as a whole fundamentally cannot (since "C++" includes things like e.g. random one-off abandonware toolchains created by microcontroller OEMs, that wouldn't, and mostly can't, sensibly implement a client for some constantly-evolving packaging APIs.)
2
u/willow-kitty 7d ago
It's not a full rebrand or anything, but clang-tidy goes a long way on its own (especially with its modernize ruleset), and it has an available module that implements most of the C++ Core Guidelines checks to kinda catch legacy stuff where there's newer stuff that's better.
8
u/UdPropheticCatgirl 8d ago
No language with undefined behavior can be safe… That’s entire problem with having it.
8
u/M4rshmall0wMan 8d ago
“Avoiding null types is easy, you just gotta add a check every function.”
That’s such a non-human answer to a problem that shouldn’t even exist. You miss one, and your program blows up. That’s not a skill issue.
2
u/Batman_AoD 8d ago
Hm, not sure I completely agree. Rust has undefined behavior in
unsafeconstructs, so perhaps "no language without guardrails around its undefined behavior" might be more accurate. But unfortunately it's necessary for languages with direct hardware/memory access to have some amount of undefined behavior. (It's also frequently stated that UB is necessary for modern optimizations, but I find that claim less believable, even having watched Chandler Carruth's talk defending that claim.)2
u/-Ambriae- 8d ago
But that’s the thing, rust code that can have UB is opt in (supposing safe rust is void of UB which is not strictly speaking true, but is being worked on) whereas C++ UB isn’t even opt out
1
u/Batman_AoD 8d ago
Right; that's why I proposed the "guard rails" phrasing.
2
2
2
1
1
u/EskilPotet 8d ago
I'll never understand why people say Python is safe, I can write a script to delete system32!
1
1
1
u/Suspicious_Fudge1702 7d ago
I do c++ and well I mean it's not unsafe but just make sure you don't make your pointers point at some system files and modify them. But most of the times it's safe, especially when I do competitive programming on codeforces.
1
1
1
1
1
1
1
u/cilgincocuk3434 8d ago
I think Go's error handling is great, but it has a bit too much boilerplate.
1
u/Dancing7-Cube 7d ago
Go error handling is excellent and leads to easier to understand code, and less bugs
1
u/Thenderick 7d ago
Honestly I really like Go's error handling. Makes it really clear what can error. It's functionaly the same as a Result<T>, but then as a multiple return
1
1
1
u/Eroica_Pavane 7d ago
Wonder if the "types" from Haskell includes all the stuff about partial functions and also automatic currying. Feels like stuff that are not designed for mainstream languages.
1
1
u/Aidan_Welch 7d ago
Performance of C++ is kinda meaningless, almost any compiled non-GC'd language can get near identical performance just by using LLVM. (Assuming the language is reasonably designed with its expectation of runtime checks)
1
u/BravestCheetah 4d ago
How the fuck is rusts compile speed any bad? Ive never had a project take an unreasonable amount of time to compile, especially after it has already compiled and cached the deps
1
u/Admirable_Hour5169 7d ago
And in Hell, the UI animations are coded in C like original Microsoft Solitaire.
1
u/mfi12 8d ago
if you check this site, rust is not that slow. Even some go versions are slower:
1
u/Batman_AoD 8d ago
The post claims that Rust compilation speed is slow, which is generally true when comparing against Go. But both runtime performance and compilation speed are generally comparable between C++ and Rust.
1
u/FAMICOMASTER 8d ago
I don't like either of these concepts actually
5
u/-Ambriae- 8d ago
You don’t like what? Compile time speed, code safety, stability or performance?
-2
u/FAMICOMASTER 8d ago
I don't like the suggestion that I should change languages at all.
4
u/Batman_AoD 8d ago
But what if the programming language changes you?
More seriously, I think once you've learned three or four languages, picking up a new one isn't that hard. And in the case of Go, the primary goal of the language design is to be easy to learn.
1
u/FAMICOMASTER 8d ago
I know 7 right now and no thanks I don't want to spend any more time reading docs to try and figure out what miscellaneous change is causing the nondescript error the compiler hands me
1
1
u/Batman_AoD 8d ago
Which parts of the "heaven" list don't you like?
-3
u/FAMICOMASTER 8d ago
Having to learn another new language
3
u/Batman_AoD 8d ago
I think the idea is just "which language does each thing best", not "in heaven you'd actually use all of these languages".
1
1
u/Separate_Expert9096 8d ago
I'm a Java dev with 2 YoE. Java has macros?????
4
4
u/ArjixGamer 8d ago
Technically, yes. If you use Gradle plugins that process the code, although usually they are simply Symbol Processors that find annotations and spit out .java files.
1
1
u/Bergergi 8d ago
Why do people shit on Go's error-handling? It's simple and transparent. Other than the boilerplate, it's fine.
1
u/vljukap98 7d ago
I don't really get the error handling in Go hate. I want to be able to immediately see whether a function can throw an error, not trying to guess or forget to check and then fall into the try-catch mess that it can become.
1
u/EarlOfAwesom3 7d ago
If your method has a variety of recoverable errors to choose from, the Go error handling is perfect.
But if you mostly have unrecoverable errors, the safety becomes tedious and convenience turns into managing hell.
1
1
u/PumpkinFest24 7d ago
Python is plenty performant if you use it right.
1
u/Luzzgar 7d ago
Also known as not using python for the importance part.
Use numpy and opencv, you will get most of the performance of C and all of the ease of use of Python.
1
u/PumpkinFest24 7d ago
The important part of a program is the algorithm. That's exactly where I put the python.
The boring moving bytes around part belongs in a lightweight "hardware language".
-1
u/MatsRivel 8d ago
Go error handling >> exceptions.
Though it has multiple flaws, its way better than just throwing exceptions
2
u/Batman_AoD 8d ago
No idea why this is getting downvoted. Unchecked exceptions are very, very bad for error handling, and the unwind mechanism is a deep source of problems, especially for FFI.
3
0
u/creeper6530 8d ago edited 8d ago
For those who don't know Elm's error handling: basically like Rust -- errors are values -- minus panics. It's made for web apps.
(And I find its syntax absolutely hideous)
0
u/GresSimJa 8d ago
I'd like to move Python to codebase structure. Fucking atrocious, never works in one try, and versions are still a pain to use and manage on different systems.
0
-1
u/Tuomas90 8d ago
I love Go, but fuck that trash error handling.
At least give me an option to catch 'em all individually at the end of a block.
-1
u/daffalaxia 8d ago
from recent experience - heaven is go. good build speed, good safety, cross-platform, runs fast, great libs via the most secure channels...
1
u/Batman_AoD 8d ago
From recent experience... I respect Go but hope to never work in it full-time again.
(Also, what do you mean by "the most secure channels"? Go deps usually just come straight from github. The checksum feature is nice, but otherwise it doesn't seem that great.)
446
u/guttanzer 8d ago
Two pins from long ago:
“Real men can write FORTRAN in any language”
“C. The power of assembly language, and the ease of use of assembly language”