4 ms·
I like languages with a small instruction set, which is what JavaScript definitely was some years ago, I would say not so much any more. Even worse it has bits
by bryanrasmussen 5y ago
I like languages with a small instruction set, which is what JavaScript definitely was some years ago, I would say not so much any more.
Even worse it has bits of functionality that are now layered on top of each other - so hoisting still happens unless you use const and let, there is strict mode which exists if you put the use strict declaration or have things in a module, but otherwise you might make a mistake somewhere and have things polluting the global scope that either you thought was impossible or even worse you were not aware that was even a possibility with the language because you were raised in a garden where it was not allowed, only now a bug brought a bit of the wilderness in to you and you don't understand what the heck is going on.
So to escape these problems with the language use linters, but some times people turn off linters etc. etc.
The suggestion to deal with problems of the language seem always to be:
1. Add more syntax, meaning more special cases to remember how things behave with that syntax!
2. Be disciplined and good and you will never experience these problems that the language has. Also all of your team needs to be disciplined and good, and the people who used to be on the team before you joined should be disciplined and good, and thus there should not be any code that is old enough to be written in a way that does not fit our modern definitions of disciplined and good.
- mirekrusin 5y agoYou could have programming language with just NAND as "small instruction set". The reality is that you want "instruction set" that you're using to solve your problems. But other people will want to work on different abstraction levels - yours and theirs desired "instruction set" will vary.
- bryanrasmussen 5y ago>The reality is that you want "instruction set" that you're using to solve your problems. yeah either that or by having a small instruction set you can know all the language at a reasonably deep level, but with a large enough language and the need to write maintainable code this becomes more difficult. You may be hit with situations where you need to look up the specification of the language you are supposed to be an expert in. But you're right, you definitely know better than I what I mean when I say I like languages with a small instruction set.
- mirekrusin 5y agoIt helps to have terse code constructs (destructuring) or more sane behaviour (const/let vs var scoping). I don't think constructs like pipe operator, nullish coalescing or optional chaining hampers language to the point that it becomes impossible to know at reasonably deep level. Those are quite fundamental, often quite simple, concepts and many of them are sprinkled around different languages here and there already. TypeScript for example has much harder learning curve. Personally I find things like generators, async generators, tagged templates absolutely essential in day-to-day work and can't imagine working without them. Recent additions to JavaScript language through healthy community interaction were absolutely great IMHO.
- twistedpair 5y agoThe slippery slope toward Scala's operator madness. Much of the value of a language can be its simplicity and grokability by typical devs. Please find a sensible stasis. Checkout this list of new JS/Node.js features [0] as an example. Will a world with the following be an improvement? [1] • ??= • ||= • &&= And don't forget the strife around the Python "walrus operator" := [2] [0] https://node.green/ https://node.green/ [1] https://github.com/tc39/proposal-logical-assignment/ https://github.com/tc39/proposal-logical-assignment/ [2] https://realpython.com/python-walrus-operator/ https://realpython.com/python-walrus-operator/
- lyjackal 5y agoI feel like this is spreading misinformation about scala. Those are not operators, rather methods. It’s syntax rules are fairly simple to reason about. The problem here is more the growing language syntax complexity of JavaScript That being said, just because you can name a method ‘||=‘ in scala, doesn’t mean you should. A lot of us scala devs realize that it’s not very readable. Symbols as method names should be used rarely if at all. But One can write unreadable code in most any language with poor naming, and that’s all this is
- twistedpair 5y agoI <3 Scala a great deal. Wrote it professionally for years and did just as you suggest; set rules about what patterns were acceptable and not. Regardless, the common critique against Scala is that of an impenetrable haven for type astronauts, such as the Admiral Ackbar operator.