News for hackers. Stuff that matters.
Re:30 years later, QBasic is still the best by rbanffy on Thursday May 05, 2016 @11:58AM (#11637214)
As soon as you get to iterate over an array, you will be confronted with JavaScript's ugly design.

No. It's a language to scare - and scar - young programmers for life.

Re:30 years later, QBasic is still the best by lettergram on Thursday May 05, 2016 @12:32PM (#11637542)
My favorite is the date, where you months are 0 to 11, and days are 1 - 31. Along with optional semicolons, and there's this[1]:

true == 1 → true

true == "1" → true

false == 0 → true

false == "0" → true

false == undefined → false

false == null → false

null == undefined → true

"\t\r\n" == 0 → true

"\t\r\n 16 \t\r\n" == 16 → true

"\t\r\n 16 \t\r\n" == "16" → false

var a = "foobar"

var b = typeof a → 'string'

var c = a instanceof String → false

[1] https://whydoesitsuck.com/why-does-javascript-suck/

Re:30 years later, QBasic is still the best by TeMPOraL on Thursday May 05, 2016 @03:46PM (#11639155)
> My favorite is the date, where you months are 0 to 11, and days are 1 - 31.

I think this is something you need to blame UNIX for. Or who knows, maybe something made even earlier.

That said, there is a logic behind that. Days we usually represent with numbers. Months we often represent with names. So the month numbers are returned as an index of a sequence of names. (Not saying I like this logic, but it sort of makes sense.)

Re:30 years later, QBasic is still the best by eropple on Thursday May 05, 2016 @04:23PM (#11639393)
> I think this is something you need to blame UNIX for. Or who knows, maybe something made even earlier.

Continuing forward with bad designs doesn't absolve you from them, though. Plenty of languages avoid this--look at how .NET handles dates and times, it has no real relation to the underlying OS on either Windows or *nix.

Re:30 years later, QBasic is still the best by wvenable on Thursday May 05, 2016 @04:32PM (#11639451)
The fact that we typically represent dates as "05/05/2016" kind of ruins the argument that we don't represent months as numbers.
Re:30 years later, QBasic is still the best by kragen on Friday May 06, 2016 @06:20PM (#11647117)
This was a design error introduced by, apparently, Dennis Ritchie (RIP) in the early 1970s, when ctime() was split into asctime() and localtime(), around the time UNIX was rewritten in C. It kind of makes sense in the context of implementing ctime(). But it was still a design error.
Re:30 years later, QBasic is still the best by news_to_me on Thursday May 05, 2016 @12:31PM (#11637532)
I'm not sure that's a very good example.

  myArray.forEach( (item) => {
    // process item
  });
doesn't seem ugly to me. It's flexible and concise.
Re:30 years later, QBasic is still the best by rbanffy on Thursday May 05, 2016 @01:10PM (#11637934)
An array was a poor example. Think instead of an object:

  for (item in myObject) {
    // process item 
  }