Hacker News new | ask | show | jobs
by gambler 2420 days ago

  var a = new Array('5');
  // what is a?

  var a = 5 + '5';
  // what is a?
It's sad that many languages force people to memorize trivial stuff like this.

This is one of the things that really impressed me about Smalltalk/Pharo syntax when I started learning it recently. The language itself encourages you to name things in a way that labels all the parameters. E.g. you can have a constructor like this:

  OrderedCollection ofSize: 5.
And method names are composed of parameter names:

  array insert: 11 before: 2.
Instead of

  array.insertBefore(11, 12);