10 ms·
I mean I haven't been a professional for multiple decades but I've written professionally in a very wide range of fields in C, Matlab, Java, Python, Verilog, As
by rxhernandez 7y ago
I mean I haven't been a professional for multiple decades but I've written professionally in a very wide range of fields in C, Matlab, Java, Python, Verilog, Assembly, Fortran, and Javascript, and, there is no language that I've seen that has more hair pulling, braindead I just learned to program yesterday type programming nearly as much as I've seen in Javascript.
(I've worked intimately with decades old scientific programming codebases where the scientists didn't give a single damn about writing cleanly and even that was an order of magnitude more readable than the willy nilly, consistency be damned crap I've been seeing in Javascript)
(I feel like I could describe a small portion of hell for me and it would include Javascript)
- deleted 7y ago[deleted]
- tomgp 7y agoI 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.
- IggleSniggle 7y agoIt's all about who is writing it and why they are writing it, not the language. Well ok JavaScript has some legacy warts, but ECMAScript 2019 enables a variety of very well written code in a variety of styles, and TypeScript is icing. As for me, I've only recently entered the JavaScript game, but the php I've seen has been much, much worse. I find the quality of JavaScript I typically encounter is on-par with typical Python code, and a fair bit better than the Frankenstein monsters of dev-ops code that often has a different convention for each line of bash (with attendant third-party applications) mixed in with inscrutable environment states as you shift in and out of various orchestration layers that have zero sense of application hierarchy or even running processes. I've seen scientific codebases too, but the thing you're getting there is an authorship that is often small-team (1 or 2) and very slow to shift, with highly enculturated domain context. Of course JavaScript code is going to be a mess in organizations where you have devs coming from vastly different contexts and staying a max of 2 years with a team where all you care about is getting the pretty graphic on the screen.
- test6554 7y agoSeconded on php. I have used php, I can use php, I just choose not to any more if I can help it.
- iratewizard 7y agoSmart choice. I opted to stop accepting php jobs several years ago and life has never been easier.
- fao_ 7y ago> It's all about who is writing it and why they are writing it, not the language. But who is writing it and why they are writing it are inextricably linked with the language. Every language has a culture and a reason for existing, those are pressures that bear as much on the person writing the language and the code produced as much as the person writing the code does on the code and the language. Whether or not say, modern Java encourages good code is neither here nor there, as not only is there resistance to learning new things there is resistance to using the new things properly. Java has a history of bloated, inefficient code for a reason, and when you use Java, the abstractions you use will alter the code that you write. It's impossible to get away from 'bad code' without rewriting things, and then you're not coding your new project you're rewriting someone else's. It's also 'good practice' to use x y z language idioms, but there are cases when such idioms make the code much harder to read and much less clean. As an example from C: I like POSIX, but dirname and basename are two ridiculously shit functions. If I choose to use them, the rot starts infesting my code, and everything that deals with them has to account for that, which itself causes a bias towards more obtuse code.
- ourlordcaffeine 7y agoFor me, R probably has a worse rate of churn than javascript in the case of breaking changes. Javascript is full of hyped frameworks, but R is the only language I've used where a minor update to a package caused an entire project to break (because the package author had changed its api)
- mighty_bander 7y agoIt's such a shame! JS could be a concise little language with a lot of power (in terms of being able to ignore types until they matter), but instead you end up transpiling unusable garbage with 10MB string manipulation libraries that release breaking changes as patch versions. Python is what JS is supposed to be, although I do feel like Bart Simpson in front of the blackboard every time I write `lambda x:`.
- bro25 7y agoBeing a small language would be irrelevant to JS. The web could benefit from a sound type system built into browsers (aka typescript in the strict mode), but it's not like anybody complains about python lacking the type system, right? What web really needs is a way to write highly modular apps and let the browser download only relevant modules, with caching, prefetching and so on. None of the attempts have worked so far. If you look an any app today, it looks like the main module that has static deps on other modules that deoent on other modules and so on. When everything is linked together, we get this 50MB binary. Not a big deal for native apps or services, but it's a big deal for web apps that need to download all this mess and maybe actually use 20%. There is no way today to conveniently write a web app that would pull only necessary modules at runtime. It's not just that the language is missing some keywords, it's about the entire web world is designed around static linking: we'd need to redo existing non modules, existing frameworks, upgrade to http2 for batching multiple requests to download a bunch of small modules and so on. That's a lot of work that needs a lot of expensive devs and the returns of that work are non existent: there's no profit to be made there. That's why it'll stay this way: bloated web apps with thousands of unused deps.
- nesadi 7y ago> anybody complains about python lacking the type system. Well, Python does have strong typing. It's just dynamic, not static, and I've seen enough criticism about it to say that it isn't as unimportant as you make it out to be. JavaScript gets a lot of criticism for having dynamic and weak typing. And I think both forms of criticism are valid, though not everybody agrees, which is fine too.
- vinceguidry 7y agoThe only thing JavaScript was ever even barely good for was that which it was designed to do, be the programmable interface for a browser. Why anyone would want to do anything else with it simply boggles my mind. It's like if someone took the BASIC my calculator offered back in the day and turned it into a general purpose programming language.
- heavenlyblue 7y agoBut JavaScript's got asynchronous!
- andrewprock 7y agoSo was Windows 95.
- robocat 7y agoA race to the "promised async hell". I wonder how many devs are struggling to debug and fix bad code written using Promise and async features. With care you can use these features safely and productively, but it is also very easy to make subtle mistakes that cause intermittent faults or strange corner case errors.
- heavenlyblue 7y agoThe comment is a reference to a phrase “It’s got electrolytes!”.
- deleted 7y ago[deleted]
- bsder 7y ago> there is no language that I've seen that has more hair pulling, braindead I just learned to program yesterday type programming nearly as much as I've seen in Javascript. I would argue that anything for phones is similarly braindead. While the languages are okay, the API's, UI idioms, and general ecosystem seem to have a half-life of about 6 months. If you step away from programming phones for 18 months, it's like you're learning everything from scratch. (Side note: All right, Groovy should be taken out and shot and the idiot who foisted it on the Android build system needs to be taken to the woodshed and beaten severely.)
- heavenlyblue 7y agoIdk - there is definitely a difference between learning about React and a completely different way to do programming. If you were any good 12 months ago - you will pick up any of the trends quite easily in a week or so (partially because you have also predicted the future).
- zmmmmm 7y ago> Groovy should be taken out and shot and the idiot who foisted it on the Android build system I think your beef there should really be with Gradle, or at least, how it is using Groovy. The way Groovy is implemented as a DSL for Gradle is, in my view, toxic. Almost everything is implicit behavior, crucial aspects rely on totally incidental "magical" features that just make things happen when you invoke some cryptic incantation that has an unobvious connection to its context. Groovy itself is pretty good and IMHO much better than Java for most purposes.