News for hackers. Stuff that matters.
Re:Name before type: why ‘age int’ is better than ‘int age’ by dchest on Sunday August 06, 2023 @04:36PM (#37026387)
Another example.

Jumpy Dart:

  (String, int) userInfo(Map<String, dynamic> json)
  int userAge(String name)
Regular Swift:

  func userInfo(_ json: Dictionary<String, Any>) -> (String, Int)
  func userAge(_ name: String) -> Int
Re:Name before type: why ‘age int’ is better than ‘int age’ by Someone on Sunday August 06, 2023 @04:46PM (#37026532)
FTA: “In C, the following declares x to be a pointer, but (surprisingly at first!) y to be a normal integer:

  int* x, y;
Whereas the equivalent in Go does what you’d expect, declaring both to be pointers:

  var x, y *int
”*

I don’t see how that’s an argument in favour of `age int` over `int age`. Both C could easily have picked the alternative semantics. Go could have, too:

  var x*, y* int; // two pointers
  var x, y* int;  // x is an int, y a pointer to int
or

  var *x, *y int; // two pointers
  var x, *y int;  // x is an int, y a pointer to int
Re:Name before type: why ‘age int’ is better than ‘int age’ by rowanG077 on Sunday August 06, 2023 @05:25PM (#37026957)
Honestly I really don't get people who are obsessed with this. Static vs dynamic? That matters A LOT! Error handling style? Very important. Expression based vs statement based? Now you are talking.

but whether a type is before or after the name of a variable? Come one man.,,

Re:Name before type: why ‘age int’ is better than ‘int age’ by benhoyt on Sunday August 06, 2023 @06:16PM (#37027464)
Are people "obsessed" with this? As the OP, I'm not. I agree with you that static vs dynamic typing and the other issues you mentioned are more important than this, but that doesn't make smaller details not worth discussing. The little details matter in language design, for code readability, cohesiveness, and so on.
Re:Name before type: why ‘age int’ is better than ‘int age’ by rowanG077 on Sunday August 06, 2023 @06:49PM (#37027746)
Then I got the wrong impression. I didn't expect someone to write a article about something they don't really care about.
Re:Name before type: why ‘age int’ is better than ‘int age’ by benhoyt on Sunday August 06, 2023 @06:55PM (#37027795)
There's a big area between "obsessed with" and "don't really care about"! I clearly care about it and think it's interesting and important, hence writing the article, but I have better things to be obsessed with. I don't think painting things in extreme terms like that is particularly helpful.
Re:Name before type: why ‘age int’ is better than ‘int age’ by simon_o on Monday August 07, 2023 @10:49AM (#37035232)
Your "it's just a matter of taste" just shows a lack of research.

The decision has a lot of important second-order effects, and a lot of people are heavily invested in denying that because they are more familiar with "Type name".

Re:Name before type: why ‘age int’ is better than ‘int age’ by rowanG077 on Tuesday August 08, 2023 @11:28PM (#37058384)
What are these important second-order effects? As far as I know it simply only syntax. There is nothing you can't express semantically in one and not the other.
Re:Name before type: why ‘age int’ is better than ‘int age’ by simon_o on Tuesday August 22, 2023 @11:27AM (#37224111)
If you know nothing, maybe don't comment?
Re:Name before type: why ‘age int’ is better than ‘int age’ by Slashbot3 on Monday August 07, 2023 @02:41PM (#37038737)
type name ....is better, any other arrangement including adding stupid symbols like : ...is just retarded alot of retarded people around these days alot of them took the vax.. because they are retarded.