4 ms·
I have a similar set of experiences but have a feeling that it's at least partly down to the sheer number of people writing Javascript and the very public natur
by tomgp 7y ago
I have a similar set of experiences but have a feeling that it's at least partly down to the sheer number of people writing Javascript and the very public nature of much of that code that so much of it is a mess. I don't think there's anything inherent in JS that make is produce messy code other than the fact that it's easy for amateurs to get results (thanks to the fact it runs in a browser and there's lots of easily available code samples).
- tenaciousDaniel 7y agoI'm a JS dev and I love it, but JavaScript is to programming languages what the electric guitar is to musical instruments. It's the thing that attracts a lot of new beginners who may or may not be interested in the more serious theory that makes programming what it is.
- rxhernandez 7y agoHave you worked in other languages for substantial amounts of time?
- tenaciousDaniel 7y agoI did Objective C for about 1-2 years, and a bit of java over the years. But no, not really.
- rxhernandez 7y agoFair enough. Thank you for taking the time to a question that, in retrospect, sounds antagonistic (apologies for that).
- tenaciousDaniel 7y agoNah, I didn't take it that way
- celim307 7y agoI used kotlin, golang, and ruby for multiple. not a huge sample of languages but i still like es6 javascript the best
- filoleg 7y agoYep. Python for many years, Java+TurboPascal+C# for a couple of years, C+Matlab for a bit under a year, and a few other ones that I wouldn't list simply due to how little work I've done in those. TypeScript and Python (with typehints) are the current favorites. Golang seems to be getting up there for me too, but I don't have enough experience with it to actually be able to say that.
- _bxg1 7y agoAgreed. I've gotten to where I don't like it as much for really large projects - TypeScript helps a bunch but is inherently limited by aspects of JS itself - but there is absolutely no language I'd rather sketch something out in. The core data types actually strike a really excellent balance between representing the major distinct paradigms (named collections, unnamed collections, strings, numbers, booleans) while giving you maximum flexibility within them. Its standard library - array functions in particular - has become very mature. FP and OOP concepts are both quite well-supported, and doing async stuff (client or server or otherwise) with promises just smashes every other language I've used in terms of ergonomics. Much of the above could be said about Python too, but regardless.
- tenaciousDaniel 7y agoYeah definitely, it's amazing for scratching together ideas. Though at a certain scale, it starts to feel pretty fragile. I don't have much experience with other languages but the explicit interface/implementation paradigm that Objective C used was so amazing to me (as someone who started out in JS). I find myself missing it every now and then, especially for large projects.
- marshray 7y agoAlso, it's used with high levels of added distortion.
- deleted 7y ago[deleted]
- MiroF 7y agowhat killed Javascript for me (and I think many others) is that there is no idiomatic way of writing Javascript. There is no "javascript"-y way of doing things (unless you count callback hell). I'm not saying that a language should only offer one approach to a problem, but there should be general guardrails and guidelines. A shared vocabulary. None of that exists in modern JS
- _bxg1 7y agoThe same criticism (which is a valid one) is doubly true of Lisp, but Lisp doesn't take half the flak that JavaScript does.
- mceachen 7y ago"Standard" [1] and "Airbnb" [2] seem to capture some amount of sensible guidelines. Adding Prettier [3] gets you something akin to gofmt, and adopting standard eslint rules [4] can help too. [1] https://standardjs.com/ https://standardjs.com/ [2] https://github.com/airbnb/javascript https://github.com/airbnb/javascript [3] https://prettier.io/ https://prettier.io/ [4] https://eslint.org/ https://eslint.org/
- MiroF 7y agoYou're talking about style, I'm talking about idioms. Those aren't the same thing!
- deleted 7y ago
- imesh 7y agoI have made a few Wordpress sites for customers that required me writing Javascript and PHP code as I learned them for quick features and fixes. In other words, I had to write Javascript and PHP code before I even considered myself a programmer, I basically copy-pasted and edited until it worked. I imagine that accounts for a lot of bad Javascript and PHP code. By the time I wrote any C++ or Python professionally I had a CS degree and a decade of programing experience.
- LargeWu 7y agoI agree that there's nothing inherent that makes it produce messy code, but it also doesn't really promote good code either. There's half a dozen different syntaxes for importing/exporting functions, creating functions, creating objects, etc., and it's all fair game. Then there's the asynchronous nature, so sometimes it's async/await, and sometimes it's promises, and sometimes it's callbacks, sometimes all happening in the same function. And then on top of that there's all the front-end web frameworks which are like, totally un-opinionated, man, except for the parts where they're implicitly super opinionated.