Hacker News new | past | comments | ask | show | jobs | submit login

A language that uses archaic syntax with dollar vars, semicolons, is pretty verbose itself may die before it evolves into something sensible. Not that I believe PHP will die any time soon, but just replying to your "slow is good".



There is no real producticity gain through not having semicolons and somewhat leaner syntax. That was never the bottleneck: ecosystem, libraries are.


There is a real productivity gain when you remove all things that cause a mental tax on reading. After Swift I don't want to look back at the C-like syntax languages any more (just that occasionally I have to).


You may think so subjectively. But there is no objective study whatsoever that would support that.


I do like dollar vars, because I know immediately when it's a variable and don't have to rely on syntax highlighting.


> A language that uses archaic syntax with dollar vars, semicolons, is pretty verbose itself may die

Careful there :-) Modern javascript has semicolons and is introducing pretty horrendous syntax for private variables (an octothorpe) and possibly for the pipe operator (percent sign, was it?) and for tuples and records, yet is showing no signs of dying.


I have never written JS with semicolons after 2015 idk why you are saying Modern JS has semicolons? I simply didn't get it. Am I missing something.


I mean, it clearly has them; it's part of the syntax. You can skip them, and the parser will insert them for you; but the language has them.


yea but its optional so does it matter? In PHP its compulsory, right?


Sometimes the extra options can produce unexpected problems. For example, in JavaScript, this would return nothing and may result in an unreachable code warning:

  function go() {
      return
          5 + 3;
  }
  console.log(go())
Since semicolons are optional, it's treating "return" as its own statement and "5 + 3" as a separate one.

There are no hidden gotchas like this in PHP though since semicolons are always used:

  function go() {
      return
          5 + 3;
  }
  var_dump(go());
This will return int(8).




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

Search: