DEV Community

Discussion on: Language Flaws - Let's talk about them

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Oh, where to start? Four big ones come to mind:

  • PowerShell: Has no escape character. The only way to have metacharacters (or spaces, which show up a lot in paths on Windows) in a command without them being interpreted as such is to quote them. I've honestly got a lot more complaints about PowerShell, but most of them are more about the Windows console host itself (which PowerShell uses) and how PowerShell interacts with it.
  • C++: The standard string library provides immutable strings, but doesn't allow strings to reference segments of other strings. IOW, if you concatenate two C++ strings, you end up with a new string that is completely independent of the old one. This is in contrast to many other languages with immutable sequence types where you end up with a new sequence that consists of references to the two old sequences. The net result here is that C++ strings are insanely slow, and you can often significantly improve the performance of a C++ program that does lots of string operations by switching to using C-style strings. Also, the C++ standard templating library is Turing complete...
  • Elixir: By default, macros eat your stack trace. If you use a macro in Elixir, and an error gets thrown from code inside that macro, the last item in the stack trace points only at where the macro was called from. This sounds sensible at first, except that it also prevents any function calls inside the macro from showing up in the stack trace, which makes debugging complex macros damn near impossible. You can technically disable this behavior when defining the macro, but you have to remember to do so, and it doesn't work 100% reliably in all circumstances.
  • Java: Requires a class that has to be instantiated for your program to run. This is, honestly, just plain stupid. It would make sense if it were designed in such a way that it forced it to be possible to use an application as a library, except that doing that requires the programmer to go to extra efforts writing the application so that it can be used like a library without causing problems for consumers of the API. Ultimately, it just adds more boilerplate code that makes Java a more confusing language.
Collapse
 
jacobmgevans profile image
Jacob Evans

This is exactly the type of thing I was looking for, I didn't expect it for so many languages. I didn't expect to get a language like PowerShell on here, interesting to also hear about flaws in C language so many people I talk to act like they are all flawless lol 😆