DEV Community

Language Flaws - Let's talk about them

Jacob Evans on November 09, 2019

I hear a lot about the flaws of JavaScript and why people don't like it or think the language (JavaScript) is "garbage" for reason A or B... etc. ...
Collapse
 
buphmin profile image
buphmin

As I have been learning Python recently there are some definite flaws I see in it. I mostly program in modern PHP, Typescript, and Javascript. Coming from PHP I was immediately annoyed that there is very little strict typing in Python and would consider this a flaw. Additionally the inheritance chain of Python, from my limited experience, is less robust then PHP. Lastly the lack of constants in Python seems dangerous to me.

You don't hear many people talking bad about Python so I thought I would give it a go :P

Collapse
 
jacobmgevans profile image
Jacob Evans

hahaha, yeah people generally don't speak badly of a lot of languages except JavaScript from most of my experience.

I personally don't see having no type system as a flaw but I certainly see the benefits of having one, I recently started getting deeper in TypeScript and love it.

Thanks for sharing and putting out there a hot take on Python :)

Collapse
 
valxntine profile image
valentine

My degree uses Java as it's main teaching language as I'm sure many others do too. Writing small we services and programs for university is fine, and then I look at production Java code. Can we talk about annotations? My god

Collapse
 
bkis profile image
bkis

I agree, it's a big leap from learning Java to learning production Java - all those common frameworks (Spring et al.) add heaps of irritating concepts. But I also always felt like it's worth learning them, as it all makes sense and works in the end. They are powerful tools.

One thing I recently stumbled upon is the fact that static methods can't be abstract in Java, which (IMHO) makes a lot of sense at first sight, but really doesn't once you come across a situation where you actually need this. I understand that's a controversial one, though.

Collapse
 
jacobmgevans profile image
Jacob Evans

Controversial is fine! Most complaints of ANY programming language is controversial. It just seems to do it with JavaScript, PHP, etc... Has been normalized. However, I wanted to hear more about other peoples experiences with other languages, any quirks or flaws that people run into while working with them 😁 no malice, no trashing, no bias for or against any of them just curiosity and fun discussion on weird/annoying/frustrating/funny stuff we all have to deal with as coders/programmers.

Collapse
 
jacobmgevans profile image
Jacob Evans

Lol, I work in Financial Technology. Java is everywhere with banks, some legacy systems are just scary to look at, especially undocumented ones. Just towers of chaos and unknowns πŸ˜…πŸ˜†

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 πŸ˜†

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard • Edited

Some of my favorites:

Reminder: don't take it too seriously, Wikipedia is written with PHP/mySQL and matters 1.000 times more than any hipster blockchain project.

Collapse
 
jacobmgevans profile image
Jacob Evans

Oh, cool reads! PHP gets a lot of animosity these days too yet it helped build so many things...Still a lot of cool stuff we use runs on it like Wikipedia, but I think Facebook is also using it still.

Regardless of how much people find wrong with the languages I always like to point out they are good at what they were made for. lol

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

VBA is a great example: Object assignment requires a "Set" prefix, as in Set object = value. Non-objects won't even work if you provide Set. What makes this quirky is that it's not always obvious what's an object and what isn't.

Collapse
 
jacobmgevans profile image
Jacob Evans

Oh, that is quirky. I also would be completely lost at first lol