Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1.

  Indexes start at 1.
That's your opinion.

2, 3.

Using "it's easier for new users" is not a good argument for a good programming language.

  x = x + 1 is not hard to grasp.
It's not, but it's more typing. I would argue that ++x and x += aren't that hard to grasp.

4. Javascript has bitwise operators even though it only has doubles. It simply casts it to an int32 before doing the operation

5.

Continue is very much necessary in loops like this, unless you want some deeply nested code:

    for(...){
    	if(...) continue;
	if(...) continue;
    	if(...) continue;
    	if(...) continue;
    	if(...) continue;
    	
    	...
    }
6. It's what the most popular languages out there use. It doesn't have to be !=, which is why it's towards the end of my list, but being different than everyone else is even worse for new users, which is the opposite of what you're arguing for.

--

Garry Newman blogged a bit about this too. His game used Lua extensively, but he changed his opinion about it: https://garry.tv/2014/08/16/i-fell-out-of-love-with-lua/.

Now, I don't like JavaScript, but at the moment, it's the best scripting language for embedding out there. I have embedded both lua and v8, and I consider v8 simpler in terms of getting it to work with your code.



1. Indexes start at 1.

It's not my opinion. In any area other than programming, the term index has a specific meaning and indexes start at one. The term used in C for arrays should be called an offset, not an index. It's the wrong word. We called 2^10 a kilobyte too, even though kilo means 10^3.


  for ... do
    if ... then goto continue end
    if ... then goto continue end
    ...
    ::continue::
  end




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: