News for hackers. Stuff that matters.
Re:Comparing Parallel Rust and C++ by saghm on Thursday November 07, 2019 @12:40PM (#21475293)
I'm not convinced that the C++ way is better here; either `fn` or `function` makes it clear that you're looking at a function (and incidentally makes it very easy to search for a function with a given name in a file), whereas just having the return type and then the function name makes it ambiguous until you read further whether you're looking at a variable or a function. If I see `fn size`, I know I'm looking at a function before I get to the parentheses, but if I see `int size`, that's still ambiguous until you go a character further.
Re:Comparing Parallel Rust and C++ by boring_twenties on Friday November 08, 2019 @01:41PM (#21485327)
Unfortunately, one character further is not enough to disambiguate the C++ syntax:

    int size();
Am I declaring a function returning an int? Or defining an object of type int and invoking the default constructor?