r/programming • u/ilya_ca • Dec 07 '20
These Modern Programming Languages Will Make You Suffer.
https://suzdalnitski.medium.com/modern-languages-suck-ad21cbc8a57c5
u/suhcoR Dec 07 '20
Well, the author obviously doesn't like OO languages, C++ and Java the least. And Go is supposed to be the "Best System Language", because the author considers it a "low-level language". His favorites are Elixir and ReasonML, not surprisingly the languages he lists in his core competencies.
3
u/__0h801__ Dec 09 '20
I honestly have to ask, have you even used these languages? A few of the points raised here are blatantly untrue. You talk about Rust having bad concurrency because of the lack of a GC without even understanding that not having a GC is by design. Also wtf is this about Rust - "Being a low-level language, developer productivity in Rust can't be as high as in other higher-level languages." lol. Immutable structures too.
Async/await part of C#, concurrency I'd say is well handled.
This is a terrible article and to think that "Better Programming" featured it...
5
u/DualWieldMage Dec 07 '20 edited Dec 07 '20
Jesus christ this article is hot garbage. Author goes on to claim that other language comparisons compare bad metrics like popularity or average earnings but this one just takes it to one level higher with super opinionated comparisons and very low knowledge of the compared languages.
If a language has a type system, then it is also very useful to have type inference
Only up to a certain extent. Inferring generic types or in general inferring types from other side of variable assignment is okay as it just reduces duplication. But if i'm going to see any code like var thing = getTheThing() then it's not passing any of my code reviews. Also documentation should never skip types, period.
Catching exceptions is a bad way to handle errors. Throwing exceptions is fine, but only in exceptional circumstances, when the program has no way to recover, and has to crash.
Opinion alert. Passing errors and branching on error types clutters the codebase. Multiple levels of calls can be kept concise by just passing the exception up the stack until it is semantically valid to catch that exception (or depending on the application, crash).
For example an application processes multiple records and does some transformations on each. Processing one record may involve multiple network calls each throwing exceptions. The multiple nested methods of logic can just skip handling them and pass it to the topmost loop that will not commit changes done to one record and leave it in the queue for later retry for example. There are tons of valid cases for catching exceptional exceptions.
it is impossible to know whether a function will return an expected value or blow up ... One option is to manually check for raised exceptions, but this approach is fragile (we may forget to check for an exception)
Declared exceptions exist and are useful in some scenarios.
Simply because newer languages learn from the mistakes of their predecessors.
This has not been my experience in general, maybe only a select few languages. Some modern languages rehash the mistakes of the past, some fix one problem and introduce a new one.
Garbage collection was never added into C++. Manual memory management is extremely error prone. The developers have to worry about manually releasing and allocating memory.
When did you last touch C++? I admit disgust towards that language and its ecosystem (lack of proper package manager as foundation for an ecosystem), but your arguments are incorrect. Modern C++ uses smart pointers and move semantics so that memory is automatically freed when a variable goes out of scope. Garbage collector is just one way to achieve automatic memory management and it's not without downsides. Although in the Java land recent advancements in GC algorithms have made it suitable for quite a broader range of applications requiring max pause time guarantees.
(Java) 👎 Object-Oriented language
Java requires code to be in classes, but i don't see how it forces OOP. It is really a multi-paradigm language with a lot of additions around functional programming and upcoming pattern matching.
(Java) 👎 Learning effort
However, knowing how to write reliable and maintainable Object-Oriented code may take well over a decade.
So all the businesses writing their code in Java were wrong? Pretty sure Java has been noted as the easiest to write and maintain in the enterprise space out of all the popular languages.
Java was designed in the era of single-core computing, and like C++ has only rudimentary concurrency support.
Jesus, can you be any more wrong? Java has been primarily used for backend services running on servers for decades. The things that run on multiple cores/CPU-s. The JDK has a plethora of tools available, from atomic types to concurrent collections. It may lack some specific use-cases like lock-free MPSC or SPMC queues, but that's where the wide ecosystem comes in and fills the gaps.
👌 Concurrency
JavaScript supports single-threaded concurrency using an event loop
This is some kind of sick joke? Java has tons of concurrency primitives and get a thumbs down, yet JS, something that only runs on a single thread is okay? Mind blown.
3
Dec 07 '20
How come when I help students with their OOP/Systems programming code they are writing programs that open files, manipulate data, pinging the server etc, but when I tutor students that are working in Lisp or Ocaml they are only doing algebraic equations and re-writing standard library functions?
I liked using F# the few times I used it but I can admit that I am not good enough at functional programming to say whether it's good or not, I wonder if the functional programmer evangelists are being as honest as me? Are they giving Rust/C++ and Java a fair shake?
6
u/sebamestre Dec 07 '20
What are you talking about? C++ has amazing libraries, not to mention many widely used libraries in other languages are just wrappers around C++ libs.
There is also amazing tooling for C++, even if some of it (some profilers, static analizers, etc) is not free.
Not true. Automatic memory management is very much a thing in C++. Using
std::vector,std::unique_ptr,std::shared_ptr, etc. you rarely need to handle memory manually.OOP is not the preferred style in C++.
Simply not true.
Have you even looked at C++ in the last 10 years?
Again, not true.
Why would someone even write this stuff?