5 ms·
I've been a huge fan of JavaScript since 2005. My roots are in Fortran, Pascal, C/C++, ASM, later Perl and Python and Java. JS is by far is the most convenient
by _pdp_ 9y ago
I've been a huge fan of JavaScript since 2005. My roots are in Fortran, Pascal, C/C++, ASM, later Perl and Python and Java. JS is by far is the most convenient language I've ever worked with and thanks to BabelJS it is even better.
Yes JS is not perfect and it has a fair dose of inconsistencies but 99% of the time it just feels right and it works well. Also thanks to NPM the community is alive and healthy, surpassing the success of Perl's CPAN and Ruby's Gems and Java's Maven and what not.
If you haven't tried JS yet, you should!
EDIT:
P.S. I talked to HD Moore back in the days during the Metasploit rewrite why Ruby was chosen for the next iteration of Metasploit. The reason was that Ruby was so much closer to Perl then JS and I don't think Node was around. I wish I tried harder to make my case as it would have been a huge asset now.
- BrandoElFollito 9y agoMy roots are the same as yours (except Java). I am not a professional developer, but rather code to simplify my work, so some projects or write as a hobby. I like JS but one of the things which are horrendous is debugging. Pycharm allows me to debug Python code in a simple, intuitive way. I still need to find a setup in JS where I can debug the same way (there is always something which does not work, between the IDE and Chrome and DevTools). This is really the ONE thing which is pushing me away from that otherwise nice language.
- 11235813213455 9y agoyou can debug js with: node --inspect-brk some-file
- cjoy 9y agoIt seems a bit unfair to blame the language for the added complexity that is introduced when debugging a browser script. Pycharm (or any of the JetBrains IDEs with JS support) offer a very comparable debugging experience for server side Javascript.
- BrandoElFollito 9y agoNot being a professional, I tend to see a language through holistic glasses : the ease and versatility, the libraries, IDE support, debugging, etc. I was mostly referring to front end JS, where I sometimes managé to debug in my IDE and sometimes not (and I then need to have DevTools open).
- alangpierce 9y agoPyCharm/WebStorm lets you debug node processes in the same way as python processes, so debugging tests doesn't seem to be much different for me. For code running in a browser, you can do in-IDE debugging with PyCharm/WebStorm via a run configuration [1], although I tend to not bother and just use the Chrome devtools instead, which I find to be very high-quality. My company does a lot of JS and Python, and I've found that people tend to be more comfortable using a debugger with JS because you can just open Chrome devtools, set a breakpoint, and go. In Python, you need good editor support or you need to use a command line debugger, so there's a larger barrier to entry. [1] https://blog.jetbrains.com/webstorm/2018/01/debugging-javascript-with-webstorm-2017-3/ https://blog.jetbrains.com/webstorm/2018/01/debugging-javasc...
- pjmlp 9y agoI have a hate/love relationship with JavaScript. Also have similar background in programming languages, plus a few more given my interest in programming language research. What I can't stand is seeing projects with npm, grunt, yeoman, webpacker altogether. Thankfully I am spending most of my time in other eco-systems and can still do Vanilla JS projects.
- auxym 9y agoHow would you say JS compares to python? (asking as someone would never touched JS and for whom Python holds this "most convenient language" spot).
- alangpierce 9y agoI use both JS and Python professionally. Overall, I prefer JS, but I also see plenty of nice things about Python. Here's my comparison: (Full disclosure with all of this: I haven't spent as much time researching Python tools as JS tools, and I'd love to hear if I'm wrong with any of this.) Nice things about JS: * The state of type systems is much more mature. TypeScript and Flow are both well-maintained language extensions that make it practical to have full type coverage, and both provide language servers for nice autocomplete in any editor. It has been a while since I've tried Python type annotations and mypy, but my understanding is that they aren't at the same level. * The tooling seems to be better overall. npm and yarn seem to be more well-thought-out than pip and virtualenvs and better handle version pinning and avoid dependency hell. ESLint seems to give much higher-quality results than flake8, and has many autofixers. I recently set up Prettier at work, and people have felt that it significantly improves their coding process and have asked if I could set up the same thing for Python. The answer I have to give is "no, because nothing like Prettier exists for Python". * Object destructuring (and related features) is probably the biggest language feature that I miss when I'm coding in Python. Tuples and namedtuples both feel much more awkward to work with than JS objects. * JS has block scoping. It's amazing how many times I've seen a loop assignee or list comprehension variable wreak havoc in Python because of a name clash with some other variable, and that problem simply doesn't happen in JS. * JS (like almost all languages except Python) allows statements within expressions, so you can pass in a callback lambda function with non-trivial code in it. Python context managers (`with` statements) and decorators seem to cover many of the common use cases for code-within-a-function-call, but I still run into cases in Python where it feels like I need to awkwardly work around the language. * The JS import system seems better-thought-out. Circular imports tend to be a big problem for us in Python, but not in JS. Nice things about Python: * List comprehensions are nice to write and read. In JS you use `map` and `filter`, which isn't so different in theory, but I still like list comprehensions better. * Python makes it much less of a pain to work with complex types, e.g. having a dict where the keys are tuples. In JS, plain object keys must be strings, and the newer Map type only allows identity equality for keys, so you need to find workarounds. * Keyword args are nice. * Python's approach to method instance binding is more intuitive. You never have to worry about `self` not being correct, whereas every new JS programmer need to go through a phase where they learn how to make sure `this` is correct. (Newer JS features like arrow functions make this less of a concern.) * Python is more likely to fail fast when you make a mistake (e.g. accessing a nonexistent property due to a typo), whereas JS is more likely to fail silently. * While Python and JS both have a "dark history" and plenty of legacy warts, Python has fewer of them. But I consider both to be pretty minor: Python 3 fixes a lot of things, and pretty much any reasonable ESLint config disallows code using problematic older JS features (like `var`, `for...in`, and global assignment).