News for hackers. Stuff that matters.
Re:In web design, everything easy is hard again by BigJono on Saturday February 10, 2018 @06:52AM (#16346931)
I've been a professional Javascript dev for over 5 years and never once run into a bug due to any of these problems.

I agree that they are problems, but their impact on day to day use of the language is zero.

If you want examples of real problems that give good front end devs hell day in and day out, start looking at some of the libraries, tooling and abhorrent "best practices" that get thrown out and cargo culted to death by the community.

The language itself is the last problem with JS

Re:In web design, everything easy is hard again by hnzix on Saturday February 10, 2018 @07:16AM (#16346994)
I've spent days tracking down a bug around a color picker widget, turns out JS was implicitly casting my string value to octal.

I've worked with heaps of toy languages like Lingo, vbscript and ActionScript, and nothing has made me as viscerally angry as JavaScript (ok maybe PHP's complete lack of naming consistency). JS is an accident of history that has somehow become the de facto standard.

I guess worse really is better.

Re:In web design, everything easy is hard again by kaoD on Saturday February 10, 2018 @08:36AM (#16347233)
> turns out JS was implicitly casting my string value to octal

How exactly? I'm really curious. AFAIK it's pretty hard for a JS string to be casted into anything (pretty easy the other way around though).

I guess maybe parseInt can do that, but that's neither casting not implicit.

Re:In web design, everything easy is hard again by hnzix on Saturday February 10, 2018 @08:54AM (#16347276)
Looks like it's been fixed in ES5. From memory I was performing an operation on a html color string and if you clicked a color with a certain prefix it would crash.

I could easily reproduce the bug but it took me forever to work out why JS was choking. I think I added in some ridiculous string padding to prevent the auto casting.

https://stackoverflow.com/questions/2547836/why-doesnt-an-oc...

Re:In web design, everything easy is hard again by rwaldron on Saturday February 10, 2018 @02:57PM (#16349231)
> Looks like it's been fixed in ES5

That was published 9 years ago.

Re:In web design, everything easy is hard again by phpnode on Saturday February 10, 2018 @10:25AM (#16347656)
Presumably by calling parseInt('010') which used to detect zero leading strings as octal.
Re:In web design, everything easy is hard again by k__ on Saturday February 10, 2018 @07:58AM (#16347114)
That's like saying group XY of people is bad because you got mugged by one person of that group one time.

While I understand that a problem like this is unnerving, it isn't the rule.

Re:In web design, everything easy is hard again by hnzix on Saturday February 10, 2018 @08:10AM (#16347155)
Wait, did you just call me racist for not liking JavaScript?
Re:In web design, everything easy is hard again by k__ on Saturday February 10, 2018 @08:30AM (#16347210)
A chauvinist.

People throwing around strawmen in here like nobodies business.

We can do this with all languages and tell ourselve we're using the "superior" language.

Re:In web design, everything easy is hard again by mythrwy on Saturday February 10, 2018 @09:52AM (#16347513)
I enjoy Javascript, have also programmed in it professionally for a little longer than you, didn't read all the docs in depth, don't have a great memory, and it on (admittedly less and less all the time) rare occasions still surprises me with unexpected or downright bizarre behavior. (But I also use other languages and thus know what sanity looks like).
Re:In web design, everything easy is hard again by innocentoldguy on Saturday February 10, 2018 @06:40PM (#16350288)
Sure, you can work around JavaScript's warts, but it is one thing to say the warts can be circumvented and quite another to claim that JavaScript is on par with well-designed languages like Python.

I do agree with you that the JavaScript community's issues you mentioned are hell to deal with; however, in my opinion, JavaScript's internal weaknesses are one of the driving factors behind this churn.