DEV Community

Cover image for Why I love Javascript

Why I love Javascript

Aro on June 23, 2020

Version française -> Pourquoi j'adore Javascript I know, I know. Naysayers will tell you that if you love Javascript, you are a person with a...
Collapse
 
hangindev profile image
Jason Leung 🧗‍♂️👨‍💻

Besides its constantly evolving features, the thing I like most about JS is how easy I can build something and share it with the world. I guess I like JavaScript because I like the web. 🌐

Looking forward to your future articles. 🍻

Collapse
 
itsnotaro profile image
Aro

I agree, the web is so fascinating.

Thank you :)

Collapse
 
jrogers8835 profile image
jrogers8835 • Edited

I've been a tried and true java dev most of my coding career and though loosely typed languages make me cringe a little, these are all features I love about javascript as well. Also, for tinkering around with an idea, spinning up a node server locally is 100x faster than java.

Collapse
 
itsnotaro profile image
Aro

I too have been cringing on lossely typed language before. But now, I saw those language as a good choice for learning and trying algorithms.

I have just to focus on the algorithm and not on the data type nor the memory I forgot to deallocate (hello C and C++)

Collapse
 
itsjzt profile image
Saurabh Sharma

Try typescript

Collapse
 
miketalbot profile image
Mike Talbot ⭐

I understand typescript for big projects and wider teams to keep code self-described etc. I do think that there is an awful lot of extra typing writing TypeScript for small projects for minimal benefit. I could count on one hand the number of bugs I've had in my JS projects due to passing the wrong type to a function. I'm just not a fan of typing a bunch of stuff out twice when I don't need to.

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
itsjzt profile image
Saurabh Sharma

I'm also not a very big fan of static typing, but the person is coming from Java so, Im expecting typescript would be easier transition for him

Thread Thread
 
miketalbot profile image
Mike Talbot ⭐

That's true... I come from a C# background so TypeScript looks very familiar to me. I just appreciate the flexibility and terseness of JS and I'm not sure there are always benefits to type-safety when weighed up against the cost of declaring it. Again it depends. In C# I feel it helps because the JIT or AOT compiler use it to make code, in TypeScript it has no benefit unless I abuse the underlying calls without understanding the implication (then we end up in a premature optimization argument).

I'm not seeking to be argumentative, I feel I learn something from the debate.

Thread Thread
 
itsjzt profile image
Saurabh Sharma

Actually types in typescript are just used to provide better tooling (better ide support kindof stuff)

Collapse
 
himujjal profile image
Himujjal Upadhyaya

Was about to say this too. Even beginner javascript programmers should not be taught JavaScript. TypeScript should be a first class citizen.

Thread Thread
 
merri profile image
Vesa Piittinen

I disagree. Not every codebase requires TypeScript. Strict typing is too often a waste of time with a negative ROI. Especially if you do your unit tests! They cover far more cases of bugs than TypeScript can ever catch.

I know I'm in the current minority of about 20% of JS devs who don't want to use TypeScript, but popularity alone shouldn't make you not think about things. Such as "does this thing really provide me value for this particular codebase?"

Thread Thread
 
himujjal profile image
Himujjal Upadhyaya

Yes. Its a matter of opinion and you might have a different one.

TypeScript saved me a lot of time when using React and Redux. Passing data around is not a child's play. Then again even in unit tests you are supposed to write tests for type checking. A lot of that is reduced because of you using TS.

In my opinion, I consider writing extra types is a tradeoff for maintainable and scalable code. Many a times we don't even have to refer to the documentation of a library. The types themselves give an idea about what you need to pass (I know JSDoc exists).

JSDoc is again messy code (it seems that way to me). TS is cleaner code.

TypeScript would have been a lot better again if it also included runtime type checking (hegelJS like).

Admit it. Typechecking saves time. It's a trade off

Thread Thread
 
merri profile image
Vesa Piittinen

You have a very bad attitude on this and due to that fail to be open to differing opinions. Instead you keep on pushing that you are right and I should change my opinion because of that. Why is that?

What if I'd end up with the same kind of style:

"Admit it. Being open to and respectful of different opinions makes you a better person and a better developer. There is no tradeoff to that."

Does that make you feel good? Or would you just get angry and defend your opinion no matter what?

Thread Thread
 
himujjal profile image
Himujjal Upadhyaya

I am sorry if my attitude was too pushy. Never intended it to be that way। Peace 😊✌️

Collapse
 
zzz404 profile image
zzz404

I am coming from java, kotlin, c#. Typescript is great for me.
Even through I write python code, I use typing everywhere if I can.

Collapse
 
asiros profile image
Chonbashev Artyk

try haskell =)

Collapse
 
leobm profile image
Felix Wittmann

I would use Purescript.

Collapse
 
donnisnoni profile image
Don Alfons Nisnoni

Yeah... because Javascript is easy, dynamic, multi-paradigm programming language.Its easy to get started, also very flexible. So make sense it's a lovely language, especially when it comes to web development. Typescript make it more easy with static-typing. Well, the remains is speed, security, etc. Now I'm looking to learn Go & V.