5 ms·
I have real problems reading a large volume of code in certain programming languages. With a lot of code, even if I'm not familiar with the language, I can scan
by mattmanser 15y ago
I have real problems reading a large volume of code in certain programming languages. With a lot of code, even if I'm not familiar with the language, I can scan it and understand the broad strokes and what it's doing very quickly.
There are two languages I can't do that with. Javascript and Lisp. For me, Lisp and Javascript's syntax is too sparse. I've even used Javascript for a few days every week for the last 10 years and I still can't 'scan' a large code file. I know how it works, I know how to use it, I know the good parts and all the tricks. But I still dread cracking open a misbehaving Jquery plugin or any home grown, even self-written, non-trivial code base in it.
With both of them it's a laborious process of actually having to load the whole code into my head, to remember what other functions are doing, how things are initialized. Perhaps you can call it laziness, but personally I only 'load' a whole code base into my memory when I'm doing significant work with it. It takes time and effort I don't want to have to put in just to make a tweak.
So not being able to just skim read code is intensely annoying.
And that's down to syntax. So to me syntax does matter and it's why I'll keep railing against javascript being the only available language in the browser. It's not just a matter of preference, it's also a matter of productivity. I at least, and I suspect many others, are not very productive with sparse syntactical languages because they're so hard to skim read.
EDIT: Some people have the gift/skill of memorizing things very quickly. I don't, I have the gift/skill of understanding things very quickly, which generally means I can get away with a weak memory. I think a lot of programmers have one of those two skills, but rarely both. Sparse syntax is a bane for the latter.
- kibwen 15y agoCould you define "sparse"? Perhaps illustrate it with a counterexample in a language that does not exhibit that property. (Also, have you tried Dart, Coffeescript, or any of the dozens of other languages that compile to Javascript?)
- mattmanser 15y agoSparse in that function can actually mean function, closure, class or class method. Javascript also suffers from a cowboy layout problem where, for example, the initializer of a class may be anywhere. Most programming languages have established a convention to where it is (the top of the class declaration (e.g. Ruby, Python) or underneath class variables/properties (e.g. Java, C#)). In Lisp it's even worse as it's not even obvious immediately what is a function or an argument as it's just on the position of the words. I do keep meaning to give coffeescript a whirl, but feels it solves the symptoms not the underlying cause, so it's not that high on my 'try it' list.