News for hackers. Stuff that matters.
Re:Ask HN: How do I learn JavaScript? by finnjohnsen2 on Wednesday February 19, 2020 @06:01AM (#22364534)
A little side note; You could consider ClojureScript.

I've worked with JavaScript many times through the years, and never felt that I got close to becoming an expert no matter what. The language it self is in the way. Browser compatibility, language weirdness (like the =, == or === mess) and there are a lot of standards around. But now a days working with ClojureScript, which settles the language problems, I get to focus on getting good at libraries, react and browser-stuff.

I hope I never have to work with vanilla JavaScript again, but since ClojureScript is a niche I'm pretty sure this dream will burst at some point. But I can attest ClojureScript has brought significantly more enjoyment into my life when dealing with front-end development.

Re:Ask HN: How do I learn JavaScript? by vorpalhex on Wednesday February 19, 2020 @09:17AM (#22365569)
Unfortunately, when one is seeking to learn JavaScript, you will encounter all variations of:

+ Use Typescript (no, it's not the same as JS)

+ Use ClojureScript

+ Use Elm

+ Use Reason

+ Use ...

If you go back about five years, you'll find this pattern also exists, except all the things people were saying to use are dead. Dead like a forgotten Egyptian pharaoh - buried and never to be seen again.

Unfortunately, all the code bases written in these poor JS-likes are still alive and I and many other poor souls still have to maintain the dang things.

You know what's still alive? Javascript. You know what still basically works the same? Javascript. You know what codebases from five or seven years ago I don't mind maintaining as much? Javascript.

Re:Ask HN: How do I learn JavaScript? by blunte on Wednesday February 19, 2020 @10:11AM (#22366102)
JavaScript is still alive not because it's worthy of being alive (compared to the four other languages you mentioned), but because it was first and became well entrenched. COBOL is still alive too...

ClojureScript and Reason are superior languages, period. They will live long happy lives, too.

Re:Ask HN: How do I learn JavaScript? by vorpalhex on Wednesday February 19, 2020 @01:15PM (#22368289)
Oddly enough, being a superior language isn't the same thing as being a language anyone actually wants to use. There's a reason Python and JS are some of the most popular languages in the world despite "superior languages" existing.

I suspect that most of the ones I name will join the bone pile of the many other "superior languages" or continue to be used at most by a niche few.

Re:Ask HN: How do I learn JavaScript? by woodrowbarlow on Wednesday February 19, 2020 @11:07AM (#22366737)
something else will come along that's even more superior, and the tooling surrounding your once-superior codebases will bitrot as the community jumps onto the next passing ship and you're caught holding the bag.
Re:Ask HN: How do I learn JavaScript? by jazzyjackson on Wednesday February 19, 2020 @03:12PM (#22369540)
Betamax and HDDVD were superior too.
Re:Ask HN: How do I learn JavaScript? by finnjohnsen2 on Friday February 21, 2020 @06:58AM (#22382492)
I get your point. However I recently encountered 5 year old javascript and it was horrible. Full out jQuery and the (function(export){})(arg) pattern. And lots of dead test in some some long gone test library. But your point is valid if it were CoffeeScript and jQuery. That would be even worse for sure.

There is no relief in sight and it'll suck for a long time because everything is very fluid everywhere. Legacy will suck.

But if you want to be as productive and confident as you can these days; my take it is to not engange in vanilla JavaScript.

Re:Ask HN: How do I learn JavaScript? by azangru on Wednesday February 19, 2020 @10:03AM (#22366018)
It really feels that with typescript it may be finally different. Deno, the new version of Node, will speak typescript natively; and the adoption and satisfaction rates for typescript are over the roof. Coffeescript or clojurescript don't even come close.
Re:Ask HN: How do I learn JavaScript? by mpfundstein on Thursday February 20, 2020 @03:30PM (#22378289)
Deno is doa
Re:Ask HN: How do I learn JavaScript? by mxschumacher on Wednesday February 19, 2020 @09:49AM (#22365866)
how common are larger vanilla JS codebases?
Re:Ask HN: How do I learn JavaScript? by vorpalhex on Wednesday February 19, 2020 @09:55AM (#22365939)
There are millions.
Re:Ask HN: How do I learn JavaScript? by mxschumacher on Wednesday February 19, 2020 @11:08AM (#22366753)
can you name a few?
Re:Ask HN: How do I learn JavaScript? by LandR on Wednesday February 19, 2020 @06:03AM (#22364541)
I would second this, CLojureScript is the first language that has made front end seem sane to me.

Unfortunately your chances of getting a job doing ClojureScript is probably slim to none :(

Re:Ask HN: How do I learn JavaScript? by blunte on Wednesday February 19, 2020 @10:15AM (#22366143)
There was a time when you couldn't get a job with Linux, and you couldn't convince a company to try Linux. So you snuck it in, and in some cases the company never knew (partly because it was so much more reliable than other options that it didn't crash nor reboot).

Sneak ClojureScript in. I know of one shop that trained its JavaScript engineers to use ClojureScript in two weeks. Quite frankly, if one is smart enough to write actual good, safe JavaScript, then one can definitely grok ClojureScript.

Re:Ask HN: How do I learn JavaScript? by LandR on Wednesday February 19, 2020 @10:42AM (#22366442)
I'm a bit tempted to do something like this.

We have an old creaky app which I'm tempted to rewrite in ClojureScript in my own time and then show them it.

Worst case scenario they say it's great, now can we please rewrite it in JS. Best case scenario I get something in Clojure / CLJS into our system.

Either way I'd probably learn a lot just from the project. And I kinda need a new side project at the minute.

Re:Ask HN: How do I learn JavaScript? by blunte on Wednesday February 19, 2020 @04:13PM (#22370128)
I would go for it. As you say, it will be a valuable learning experience. And writing anything the second time (even if switching languages) tends to be much easier than the first time since the problem is more known. So you lose not much time if you ultimately throw ClojureScript away in favor of something else.
Re:Ask HN: How do I learn JavaScript? by subhobroto on Wednesday February 19, 2020 @02:56PM (#22369395)
> So you snuck it in

Linux did not win the server space because admins snuck it in. It won because it was free and worked well enough compared to signing up for tens of thousands of dollars worth of lengthy contracts with SCO/HP/IBM or even Microsoft.

> Sneak ClojureScript in

I don't see this ending well.

It's great to do your side projects in your favorite language but foisting it onto your employer so they they are forced to use it is a pretty bad violation of trust.

What happens if you quit and ClojureScript programmers are hard to find at the price the employer can afford without going out of business?

I would never try and pull this off.

Re:Ask HN: How do I learn JavaScript? by blunte on Wednesday February 19, 2020 @04:12PM (#22370112)
Linux won because it got proven to be effective before any money had to be spent. The risk of trying it out was very low. And it ran well on old or low spec hardware, which Windows did not run (well) on. So we snuck Linux in by installing it on old puny PCs, setup some useful network services, and let it do its job well for months. Then we would casually mention to management what we did.

Many companies would not or because of SLAs _could not_ use free Linux. They would pay RedHat or Suse fees that included support/maintenance. Yes, it was still usually cheaper than Window licenses, but the price was not really the point.

Now about sneaking languages, platforms, and stacks in... Java was once too risky and unknown to be used in place of C/C++, but we snuck that in and proved it was up to task. Python... hah, Python was a toy "scripting language". No self-respecting CIO would approve of building company products in Python. Ruby? Rails? Surely not, those were also free, unknown, unproven technologies (which ironically were trying to supplant Java-based systems... that same Java which was once too risky).

PosgreSQL or MySQL? No way, that's not reliable for production. Of course it is, and it got snuck into companies whose engineers despised Oracle and SQL Server (not because MSSQL sucked, but because it only ran on Windows).

You can pick any modern best of breed tool, and I can point in history when that tool had to be snuck in to prove itself and gain acceptance.

Re:Ask HN: How do I learn JavaScript? by subhobroto on Wednesday February 19, 2020 @04:23PM (#22370229)
> You can pick any modern best of breed tool, and I can point in history when that tool had to be snuck in to prove itself and gain acceptance.

I don't like the idea of "snuck in".

Working with management and having buy in that there's going to be a risk involved in taking something up that's new and unknown is OK.

That way we have a plan and action in place if things go other than expected.

That is exactly why I left a BIG5 firm and now work at startups because I can run these by the CEO and have a discussion.

The place where I work does not exist for my amusement.

Many people's livelihood including those of close friends and their families depend on the decisions I make.

If I am at a VC funded startup I am playing with the retirement of millions of people.

I owe it to them to be in the know of any risky decisions I take that I judge to be risky enough to affect them negatively.

Anything that's new and relatively unknown is risky.

That does not mean we don't try it.

It does mean we need to have a plan and action in place if things go other than expected.

Thats just good engineering and business because people depend on me.

Otherwise it's just a hobby and pastime.

Re:Ask HN: How do I learn JavaScript? by traitsnspecs on Wednesday February 19, 2020 @02:41PM (#22369228)
I feel the same. I do full-time ClojureScript - at least a few jobs exist! If you would like a job doing ClojureScript, email me at the address in my bio.
Re:Ask HN: How do I learn JavaScript? by subhobroto on Wednesday February 19, 2020 @02:52PM (#22369343)
Where's your bio?

My email is my handle at gmail.com

No obligation. I just want to connect with an individual interested in a "non-traditional" language :)

Re:Ask HN: How do I learn JavaScript? by qwerty456127 on Wednesday February 19, 2020 @06:18AM (#22364611)
Why not Elm or Reason then?
Re:Ask HN: How do I learn JavaScript? by finnjohnsen2 on Wednesday February 19, 2020 @06:25AM (#22364651)
ClojureScript is Clojure. Which eventually keeps me in the JVM universe where I'm experienced and familiar with tools, libraries, devops and everything around the development environment.

So as a Java developer ClojureScript keeps me a little in a familiar realm instead of jumping to a whole new ecosystem where I have to pick up every new aspect in the tool chain, including the language.

But this is personal, and I have absolutely no experience in these other languages you mention and they may be awesome.

Re:Ask HN: How do I learn JavaScript? by sergiotapia on Wednesday February 19, 2020 @01:05PM (#22368178)
Don’t do this. Zero jobs. Might as well learn Elm