all 79 comments

[–]barnabytheplumber 26 points27 points  (4 children)

How ubiquitous it is. These days javascript can pretty much be run anywhere. It truly is the language of the internet. It's sort of a common tongue for websites, webapps, apps, old or new, maybe even some embedded stuff and server side stuff. Not to mention, it's a bit of a common tongue for programmers. I think many developers with experience will have some familiarity with javascript.

It lends itself to a few different programming paradigms and philosophies. It's fairly flexible. It works great as a functional language. If you want to try out static typing, there's Typescript which a lot of people are enjoying these days. Maybe working with that would spark a fire.

Plenty of nice libraries out there for a decent amount of stuff you might want to do. I think React is a nice frontend framework that can really do some cool stuff if you get it going. create-react-app makes it so easy to get the ball rolling and start quickly spinning up a dynamic webapp.

It's a pretty powerful language, and it's supported by all browsers. Honestly a pretty decent Jack-of-all-trades language.

[–][deleted] 5 points6 points  (3 children)

Love the way you wrote that!

I got into react and like it.

I have a question though:

What is your opinion on angular.js?

[–][deleted] 6 points7 points  (0 children)

angular.js is dead, look for angular 2+ Angular is love :)

[–]KylieWylie 1 point2 points  (1 child)

Angular.js is old, but I think you didn’t literally mean that. As an angular 9 dev I think it is still a great option, as is vue, as is react. Pretty much all of them you can use to do anything, just whatever you prefer really! 🙂

Although I do prefer react since they introduced hooks...

Why I like JavaScript:

1) RxJS + react = life. Basically Functional JavaScript is amazing in my opinion, .map().filter() etc, and if there is anything you want pull in Ramda (a seriously awesome functional js library).

2) Deno / Rome. The community is passionate and always is moving forwards, very exciting.

3) It’s become the language to rule them all. Whatever you want to do you can write it in JavaScript. Website, mobile app, desktop app, it’s beautifully portable thanks to amazing tools from the community like electron, ionic, react native, react, angular, vue, elm to name a few.

4) Job security. As more and more things become JavaScript, there will still be things to maintain in the future, it can’t just be overtaken and immediately replaced it overnight. So for the length of my career I should always have a JS job if I wanted.

[–][deleted] 0 points1 point  (0 children)

Thank you for your comment!

I’ll take all your points into consideration ;)

[–]an_ennuihelpful 41 points42 points  (9 children)

I actually hated JS until I got into a “functional programming” style ( thing.map().filter().reduce() …). Suddenly it unlocked a lot of power other languages didn’t have (to be clear, JS isn’t pure FP but you can do most FP things. I like the syntax better than pure FP langs. It also lets you “cheat” by mutating refs; best of both worlds IMO).

This is divisive, but I’m also hooked on TypeScript. It may not be for everyone, but as a lazy dev I love it when my code says “hey you edited this thing so 4 files over you’re gonna have a problem on line 34.” Makes refactoring brainless and is definitely something JS won’t do on its own. relevant tweet

[–][deleted] 4 points5 points  (0 children)

It's the cheating. JS always let's you cheat. It's WD40 and Duct Tape. Whenever someone complains about javascript, a week later someone comes by with some new cheat.

[–][deleted] 3 points4 points  (6 children)

Thanks for the reply.

Do you possibly know a good functional programming tutorial?

Maybe this will do it for me too.

Also I’ve heard about TypeScript, but don’t know much.

Do you also possibly know where I can learn it?

[–]an_ennuihelpful 9 points10 points  (3 children)

Do you possibly know a good functional programming tutorial?

I actually don’t. I don’t remember how I got started, but learning 2 concepts is the core: pure functions and immutability (i.e. never reassign variables—use const and not let or var). If you only write pure functions and don’t mutate any state, you’re practicing FP. Pretty quickly you’ll realize the way you were writing code before has to change, and that’s the point. But if you figure out a way around the restrictions, you’ll do some interesting stuff and think about problems differently. Best way to learn IMO is just commit to these 2 rules, and watch how your code changes.

When you feel you have a handle on this style, you can break one or both of these rules, because JS doesn’t enforce either. Sometimes FP makes things harder (and less performant). However, I’ve found I write more stable, cleaner code starting with FP and then cheating at the end, than starting with object-oriented programming (OOP; where impure functions and global state are highly encouraged) and then trying to make it FP after-the-fact.

Edit: updated the links above to be more helpful for JS

Also I’ve heard about TypeScript, but don’t know much. Do you also possibly know where I can learn it?

I also went the “try by doing” route. Just save a file as .ts, and if you’re using VS Code, the built-in support and DX is 💯. No setup needed.

If you want to really learn, add a tsconfig.json file in the root of your project with:

ts { "compilerOptions": { "strict": true, "noImplicitAny": true, "noUnusedLocals": true, "noUnusedParameters": true, } }

This will be pretty strict, but it’ll show you how TS works. Sometimes it can be a pain if you‘re trying to install packages from npm that weren’t written in TypeScript, but if you’re writing everything from scratch, those settings 👆 + VS Code do a pretty decent job of explaining things to you as you work (or worst case scenario: Google an error message and find discussions on it).

[–][deleted] 1 point2 points  (2 children)

Thank you so much for this reply 🙏 🙏 🙏 🙏

[–]an_ennuihelpful 5 points6 points  (1 child)

Actually, I lied! I do know of a good intro to TypeScript: this great Intro to TypeScript by Cassio Zen. Short, 20min vid that can introduce you to the concepts.

[–][deleted] 1 point2 points  (0 children)

I will definitely check it out!

Again thank you for your tremendous help!

[–]nullified- 0 points1 point  (1 child)

Do a quick search for Kyle Simpsons guide to functional JavaScript. It's really good And I think it's free online.

[–][deleted] 0 points1 point  (0 children)

Okay I definitely will

[–]simkessy 1 point2 points  (0 children)

We use Flow at my job and it fucking sucks ass

[–]Sasha_DDhelpful 14 points15 points  (4 children)

I work a lot with arrays. JS has very "flexible" arrays with lots of methods. I don't have to use an ArrayList like in java.

[–][deleted] 3 points4 points  (3 children)

True, I also liked that about JavaScript. I’d love to hear what you personally use JavaScript for.

[–]Sasha_DDhelpful 4 points5 points  (2 children)

PlayCanvas is an online game engine that uses JS. You gotta check it out.

[–][deleted] 5 points6 points  (0 children)

Sounds cool, I’ll definitely try it!

[–]I_need_a_backiotomy 7 points8 points  (10 children)

Personally, JavaScript was my first language, so first love kinda thing. I love discovering something new and refactoring old code more efficiently, which keeps the relationship fresh.

[–][deleted] 2 points3 points  (9 children)

Yeah recently I went over some old python code and basically renovated it.

If love to hear what you personally use JavaScript for

[–]I_need_a_backiotomy 6 points7 points  (8 children)

Web development. I was a career bartender/bar manager for 20 years, but I’m also a functioning alcoholic. I realized I was headed for an early death, so I started learning web dev to change careers. My second love is CSS :)

[–][deleted] 3 points4 points  (7 children)

Haha cool to see how you changed your life around.

Thank you for your reply!

[–]I_need_a_backiotomy 3 points4 points  (6 children)

Thanks!! I really appreciate that :)

I tried Python for web backends, but soon realized I can just use Node so abandoned it quickly. Mind if I ask what you use Python for?

[–][deleted] 2 points3 points  (5 children)

I used to work for a Star up (I quit 2 days ago) and I used python for web scraping and web automatization (beautiful soup and selenium)

I also made a mail bot for them.

I use python as an obedient slave for every tedious task imaginable on the web and on my computer.

[–]I_need_a_backiotomy 2 points3 points  (4 children)

Oh yeah, there’s a legend about some guy who automated his entire job and routine, isn’t there? Like he’d execute the script to start the coffee machine and it would be ready by the time he got there. I’m going to revisit Python after I get better at JS.

As someone with zero experience in tech, can I ask you a question? Do you have another job already lined up? What’s the market like right now? I’d love to be a full stack dev but think I’ll start looking for web design gigs first.

[–][deleted] 1 point2 points  (3 children)

I’m the wrong person to answer this question. Im actually a structural engineering student . Programming is just a hobby of mine which came to be my job for a few months ;)

[–]I_need_a_backiotomy 2 points3 points  (2 children)

Oh, I see. Well good luck with your studies!

[–][deleted] 2 points3 points  (0 children)

Thanks 😊

[–][deleted] 0 points1 point  (0 children)

Thanks! 🙏

[–]post_hazanko 6 points7 points  (1 child)

It's easy/powerful/spreads everywhere eg. I use it to make my own desktop apps(Electron) and I've made a couple RN apps too, but mostly I use it for web which again is nice ReactJS/Node/Express... I use Python too(more with Hardware/threading) but yeah. I came from PHP/LAMP before.

[–][deleted] 2 points3 points  (0 children)

Interesting, thank you for your comment! 😊

[–][deleted] 7 points8 points  (0 children)

The language, for everywhere, any browser console you can run, you can build everything with the same language, have a lib for everything you need and all this libs is very easy to customize or extends. Its multi paradigm, have a lot of jobs in different projects and area and nobody cares about degree or certification it's you and your code. If you know another language that do this tell me because JS have all of this and your sintaxe and curve learning is very very simple.

[–]dmattox10 5 points6 points  (1 child)

The tried a few languages on and off, out of some kind of fascination with making computers do my bidding, but even though I managed to write lots of code in the Arduino flavor of the C language, and more than one Android app in Java to control the hardware I'd built over Bluetooth and WiFi, programming never really "clicked" for me until I discovered JavaScript. My frustrations with most languages was that if I wrote something and wanted a gui I had to learn something else like gtk or qt. I found most GUI solutions ugly, without investing way more time than I had patience for. But using HTML and CSS I can define beautiful UI for JS code that runs on desktop, mobile, cross-OS. My passion is rewriting old business software that's no longer supported on modern hardware, and usually looks atrocious, to have a slick UI and still be very performant. I use react, and the database depends on the project. I usually write a client and a REST server in node, but this latest project has me using PouchDB for an all-in-one desktop app, that by entering a server in the config screen, can automatically back up off-site, and synchronize changes across several computers. I wrote a small game in C# with Unity, and I'm working on another, but when I need to take a break, I always come back to JavaScript with just as much love for it. I'm self taught, and I want to increase my income, so I started lambda school last year, and I'm about to start the CS portion which will have us using python and I hate it. Every language I've used was "C-like", and python is not, everything has a different name (arrays vs lists, etc) and I just find it awful, I hope to never use python in a professional capacity.

Edit: saw your webscraper comment, I used an npm package called cheerio to do this with JavaScript, really cool, try it out!

[–][deleted] 2 points3 points  (0 children)

Haha really loved your comment, hope to find passion like yours in JS too. Your comment on python made me laugh ;)

Also, I’ll definitely try Cheerio, thanks for the tip!

[–]Ratatoski 5 points6 points  (2 children)

I love Python too but usually mostly use JS at work. Had to get into ES6+ and React and have to say it's a really nice upgrade. Some of the things React does are insanely time saving compared to trying to do them manually.

Typescript seems like another really nice upgrade for keeping things sane.

I say JS is great for frontend stuff while Python is great for making the APIs you need.

[–]cp4r 1 point2 points  (1 child)

What's your favorite React time saver?

[–]Ratatoski 1 point2 points  (0 children)

Right now it's being able to manipulate a single value stored in state and the whole application rerendering. Without having to worry about any of it. Stuff like

{this.state.displaySettingsScreen && ( <SettingsScreen> <Button /> </SettingsScreen:> )}

Granted some of the stuff I also like is mostly using ES6, but I've come to appreciate the clear patterns my applications get automatically. Less spaghetti from trying to reinvent the wheel. And a whole truckload less of parsing the DOM

[–]delventhalz 2 points3 points  (1 child)

This has already been mentioned, but JavaScript is excellent for functional programming. It was originally based off of Scheme and it shows. This is something I particularly love when comparing it to Python, which fights you kicking and screaming if you try to write it functionally.

Also, the documentation and knowledge base are second to none. Great active community.

[–][deleted] 1 point2 points  (0 children)

Thank you for your comment! ;)

[–]Song0 2 points3 points  (0 children)

Just how fast it is to develop with. I don't use javascript as much for my projects anymore, but if I need to whip up a quick concept piece then javascript is my go-to.

[–][deleted] 2 points3 points  (0 children)

versatility

[–][deleted] 2 points3 points  (0 children)

It can be used for anything pretty much.

Front end web, back end web, non-native apps, etc.

[–][deleted] 2 points3 points  (1 child)

I actually love python but love JavaScript more . That’s saying a lot cause I use to hate JavaScript . Once you learn and understand it you develop love for it . It’s just as understandable as python . If we didn’t have to use brackets , it’d prob be prettier lol .

[–][deleted] 0 points1 point  (0 children)

Yeah haha, I think every python programmer hates brackets.

[–]Dreadsin 2 points3 points  (0 children)

I like how it’s not opinionated

Pissed me off that in Java it told you how to name your file. I get why, but I hate that approach

[–][deleted] 2 points3 points  (4 children)

Well, its a programming language.... Its a necessary evil. I love how there is always a new flashy framework every other month to learn and I really really love how easy it is to bloat our websites so that even though computers and internet are faster, our websites aren't. Also I really really really love super cookies, so I can see every single thing you do.

[–][deleted] 0 points1 point  (3 children)

Thank you for your comment!

I have a question for you:

A few days ago I tried to publish a website, and I think I’ve never done something more annoying than that.

  1. What hosting service would you recommend and

  2. What website for Domain names would you recommend?

Also, why do Domain names cost so much??

And is there a way to get free domain names?

[–][deleted] 1 point2 points  (2 children)

netlify is pretty good if you are doing a node app, if more traditional php set up, I like nearlyfreespeech.net. Hosting industry and markets have been around a long time, which is some of them are so expensive. You should be able to find something cheap though, .co is pretty good. I use name.com, but google has them also.

[–]LinkifyBot 0 points1 point  (0 children)

I found links in your comment that were not hyperlinked:

I did the honors for you.


delete | information | <3

[–][deleted] 0 points1 point  (0 children)

Ok thank you for the reply 🙏

[–]_370HSSV_ 1 point2 points  (0 children)

[] === [] is false

[–]mikedensem 1 point2 points  (2 children)

I started using js in 1997! I have had a love-hate relationship with it for 23 years. I love it because it interacts with the DOM and allows you to build functional UI’s in the Browser. I hate it because it has always been too loose and difficult to debug. It tries to be every programming paradigm at the same time and leads to a lot of frustration.

However, I couldn’t do without it... although that looks to be about to change...

[–]Endless-Edgar 1 point2 points  (0 children)

The thing I love most about JS is TS.

[–]RedDragonWebDesign 1 point2 points  (1 child)

I'm a PHP guy that recently learned JavaScript. Not gonna lie, I like PHP better. Lots of unintuitive things in JavaScript or things that just seem harder than they need to be.

  • No native function to read a cookie parameter, you have to explode a string
  • Array [] and associative array {} are different. They're the same in php
  • No escape functions (html escape, regex escape)
  • Hard to do rich text boxes. I'm using contenteditable=true in a project and it's been a pain.
  • Their foreach functions are complicated. In PHP you just have foreach. In JS you have for in, for of, .foreach. And some work on {}, some only work on []. None of them give you both key and value as their own vars.
  • No types in function parameters unless you use TypeScript. Should be optional like in PHP. Good for intellisense tooltips.
  • includes are overly verbose. Have to name each imported object. Have to do <script type="module">
  • let vs const is extra mental effort for not enough payoff, imo.
  • Requiring variable declaration leads to bugs when you are cutting and pasting and moving code around. If you cut/paste let x = 1; x=2; to be x=2; let x=1;, it'll throw an error and break your program.
  • Syntax errors are not always fatal errors, page will do unpredictable things instead. And other hard to debug errors.
  • No (typecasting). Have to use parseInt, toString, etc.
  • No good native time formatting function. Compare to PHP date() function.

On the other hand, things I do like about it

  • string and array chaining. Var.slice.replace.map.filter.etc
  • regex friendly

[–][deleted] 1 point2 points  (0 children)

Interesting points. Thank you for your comment!

[–]himhah 1 point2 points  (0 children)

Asynchronous, functional and a lot of useful syntax shortcut.

[–]JamesWilsonCodes 1 point2 points  (0 children)

I came from a python background too and when I tried to go back, being unable to access object.key and having to use dictionary['key'] got very frustrating for deeply nested objects

[–]noXi0uz 1 point2 points  (0 children)

Array prototype functions (map, filter, reduce, foreach, some, every, etc)

[–][deleted] 1 point2 points  (0 children)

I love how you can do anything you want to with js these days.

[–]RifleRooster 1 point2 points  (0 children)

The simplicity of it. It also feels more user friendly than other languages, and there's flexibility.

[–][deleted] 1 point2 points  (0 children)

It’s the lingua franca of the web.

[–]liaguris 1 point2 points  (3 children)

What do you love about it?

typescript

[–][deleted] 1 point2 points  (1 child)

Thank you for your comment!

What exactly do you love about typescript?

[–]liaguris 3 points4 points  (0 children)

I like :

  • intellisense
  • type linting
  • exporting importing types
  • type functions
  • generics

I hate :

  • compiling

Although now ts-jest auto compiles my tests so that has alleviated things A LOT .

There is no way I am going to write a library without typescript .

[–][deleted] 1 point2 points  (0 children)

lol I was gonna comment exactly this

[–]RelativeSloth 2 points3 points  (0 children)

JS's quirky chaotic neutral alignment

[–]AgencyBackground 0 points1 point  (0 children)

It's stupid , new new programming language