Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by array_key_first

2 months ago

var x: int is much easier for a machine to parse and let's you do some neat things.

For example, in C++ because the type must come first, you have to use "auto" - this isn't necessary in langs who put the type after the variable name.

It also helps avoid ambiguous parsing, because int x; conflicts with some other language constructs.

0 comments

array_key_first

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities