r/javascript • • Jan 06 '20

AskJS [AskJS] Why Javascript is your favorite language ?

A) What are the strength of Javascript over C#, Java, Python or Php and is it the best programming language to learn in 2020 for webdev ? Do you feel the others are getting outdated or less popular ?

B) How's JS performance today compare to the others tech stack ? (interpreted vs compiled, single thread vs multi-threads etc) Are you guys worried about Web Assembly and the performance of C/C++ coming to webdev ?

C) Why there is so much hate/disdain toward Javascript from programmer of other tech stack like C# / Java for example ? is it because they are stuck with their old 80’s concept and OO mentality and they have trouble with functional programming and the new stuffs ?

0 Upvotes

8 comments sorted by

8

u/AngularBeginner Jan 06 '20

User signed up to post these questions in various subreddits. This looks like marketing/research spam to me.

5

u/react_dev Jan 06 '20

A) Easiest and lowest barrier of entry for beginners by far. Intuitive (yes even accounting for the type coercion) and not verbose. No need to learn OO. No need to know all the quirks of different modifiers. Little system design required for interfaces and abstract classes. No need to solve obscure build issues. No meta programming (except Reflect but who uses that)

B) JIT is getting much faster. Sure the compiled code will almost always run faster, unless it’s some runtime optimized by the JIT process, but we’re engineers foremost so fighting for nanoseconds might not be a business need.

C) Wasm will never take over JS. But it might grow to a tool that is powerful enough to create a special class of engineers who are adept at it and get paid a lot of money. This will again bump non traditional educated engineers to second class citizens as compiled languages become much more relevant in Frontend.

1

u/fucking_passwords Jan 06 '20

A) Its not a competition. JavaScript is a great language for working on web applications because it runs natively in the browser. It’s also convenient to be able to share code between front and back end. It has a relatively low learning curve to get basic ideas working.

B) No, we should be excited for WebAssembly!! Again, it’s not a competition, I welcome new ideas and we already have a wealth of languages that compile to JS (Dart, clojure, elm, etc). Also wasm will be extremely useful for performance critical work, regardless of what the source language is.

C) JS was conceived in 10 days by a single person. It was considered a toy language, not very powerful and meant for adding a little bit of interactivity in your front end. However. a LOT has changed since those days.

It’s still not uncommon for back end engineers to laugh at node, some of it is just not understanding how much better things have gotten, some is complaining about how complicated the ecosystem is. Setting up your project with typescript, eslint, webpack, Babel, etc can be pretty complex.

1

u/[deleted] Jan 06 '20

[removed] — view removed comment

1

u/fucking_passwords Jan 06 '20

Of course, I was just giving an example of why I like it.

1

u/[deleted] Jan 06 '20 edited Jan 06 '20

A) Developed ecosystem with a ton of work done for you. One just have to be careful.

B) Comparison hugely depends on requirements and VM implementations. But in general - we're good and will get better. As for wasm, I doubt that it will take over small apps terrain. It's kinda low-level engineering adds pointless cost to the development process, where all you wanted is to add an Item to the Cart. On the other hand, things like SaaS with heavy-clients will hugely benefit from performance boosts we will get once wasm will be fully developed and ready. For now there still some parts missing and the adoption of all the features is not complete yet.

C) Those who actually hate JS are living with stereotypes of old days, when JS and client-side haven't got as much attention as it gets now. Also reinventing the wheels over and over again (hello redux and CQRS) and presenting it as an Innovation, or forcing approaches or paradigms as The Only Way (hello elliott and FP) makes a reeeeealy bad impression.

P. S. Now C) is interesting. Implying that "80's concept" is bad is utter bs. If something was invented long ago it doesn't mean it's bad. Space-X launches it's payload into space using fundamentals discovered in early 1920s. Same goes for "modern" JS. Even more, there are rockets that have ignition mechanisms on wooden planks below the engine, and this still works and works good and better than some over-engineered smartass crap. Most of current tech, at least conceptually was discovered and implemented long before most of front-end devs got their first job. Sorry, I just get triggered on this kind of crap.

1

u/c_eliacheff Jan 06 '20

A)

  • Easy to get in, but hard to master. A big pro is than you can use the same stack/language for front or back, mobile or desktop, giving you more possibilities to master it.

  • However, I use only TS nowadays. Static typing is a must have for me, while keeping JS flexibility.

  • JS/TS is good enough for functional programming.

  • The ecosystem is vast, but messy. For webdev, JS/TS is a good choice. PHP is still very popular and since v7 is more solid and fast. Python is also a good choice, less used but the recent work in ASGI may make it more popular. Java feels outdated, C#/.net seems to replace it at corporate level. Kotlin may also be an alternative, Scala is better, but fewer devs really master FP.

B) Perfs are good. If you have a very demanding tasks in webdev, just use JS bindings of a C library. WA could be good to allow other languages to write code for the frontend, and gain some perfs.

C) FP is not new. In fact it's older than OO in software engineering (which started to be widely used around the 90'). You can also find articles about Alan Kay's definition of OO, which was designed toward the Actor Pattern, not inheritance, or some others OO tricks. I guess some devs see JS as the new PHP: low level entry, more bad devs.