Hacker News new | ask | show | jobs
by ikfmpwdsoz 2700 days ago
Minor nits:

1. "Single return and out parameters" should have a special mention for Haskell, since Haskell doesn't even have multiple input parameters!

2. Python has assignment expressions now.

Overall, it's a pretty good list of shortcomings of C, but I disagree with several of the points: (a) special-casing subtraction lexing to be whitespace sensitive is silly, and (b) integer division is essential whenever working with arrays or modular arithmetic, and converting types explicitly, like Rust mandates, is definitely the way to go. Who knows if I'd want a float, double, rational or currency type to be the output, anyway?

3 comments

Numbers are hard. They can be made to look easy, but that just sweeps the corner cases under the rug.

Probably what people want is a Number type providing integer bignums for those situations when you don't want to care, a set of "machine integer" types with controllable overflow handling, IEEE floating point, a Rational/Fraction so you can handle 1/3 correctly, a Money type with controllable rounding, and COBOL-style "picture" types.

Oh, and complex numbers, and matrix types of all of the above.

I mean, Haskell does not have multiple input or output parameters, but it simulates both of those well enough.
>Python has assignment expressions now.

PEP 572? If so, that doesn't support multiple assignment at all.

Yes, but the post mentions assignment expressions as a bad thing, and says Python "gets it right" in this regard, which would no longer be true.