by user3939382 · 3y ago · 0 comments
I taught myself BASIC when I was 7 when I didn't know what a programming language was.
I've been programming JS for 25 years and I still commonly can't predict what the behavior of some aspects of my code is going to be, or what the state of the application is at a given point, until I try/run it.
What makes reasoning about JS your code difficult, relative to other languages? Maybe the event loop is unintuitive? In my experience, opaque application states were caused by my odd engineering choices rather than any particular language. But I'd love to hear your experience.
I’m sure someone out there has compiled the list of things that don’t make sense.
It’s like 100 people designed different features without talking to each other and glued it all together into one language.
You need to enforce coding conventions in JS as soon as you have greater than one person working on a project. Sometimes even if you are the lone person - esp if you are coming back to it after a delay.
I never took another CS class
I have been working in the industry for nearly 30 years, have worked on cutting edge technology, contributed to software that billions of people use (and written plenty that fewer than 10 people use)
I will, of course, never have the same impact/influence that Dijkstra has had.
Did he ever acknowledge how fundamentally wrong he was about this?
>FORTRAN --"the infantile disorder"--, by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use.
"44" - 4 = 40
On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" [...] I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
...and anyone who cares, therefore, uses a typechecker.
What makes it such a weird criticism is that, in order for it to make sense, you have to satisfy all three of 1) being someone who is annoyed that the operators have these well-defined semantics for mixed types, 2) actually mixing types and doing so by accident rather than intentionally, but 3) nonetheless someone who refuses to use a typechecker. That's a special case of someone insistent on putting the wrong figures into the machine altogether...
> Regardless if static or dynamic, it should be strongly typed. Just throw the error.
Java and C# are two of the most popular and widely used strongly typed languages. They don't throw errors for this.
"4" + 4 : `+': no implicit conversion of Integer into String (TypeError)
"44" - 4 : undefined method `-' for "40":String (NoMethodError)
The funny thing being the implicit type conversion that javascript does. This is likely why typescript has become so popular.
Are there other languages that have implicit type conversion for basic types like javascript?
Some do. Many don't.
I have a feeling that most people who say this sort of thing mean "Python" and assume that that's the norm. (The "heck even ruby does" remark def. reinforces that.)
Can you name any that do that aren't dynamic languages?
Commonly? Could you give an example?
> or what the state of the application is at a given point
That's not a criticism of a language though, is it? It is either a criticism of how an application is being written, or a statement about the complexity of the application.
I’m in the same boat. My grey beard is frequently showing.