News for hackers. Stuff that matters.
Re:Zig; what I think after months of using it by zamalek on Tuesday February 04, 2025 @11:22PM (#42943757)
The example given isn't that great. Here's a significantly more common one:

    var age = get_string_from_somewhere();
    var age = parse_to_int(age);
Without same-scope shadowing you end up with the obnoxious:

    var age_string = get_string_from_somewhere();
    var age = parse_to_int(age_string);
Note that your current language probably does allow shadowing: in nested scopes (closures).
Re:Zig; what I think after months of using it by chrisco255 on Tuesday February 04, 2025 @11:37PM (#42943862)
Changing the type on a value is an anti-pattern, in my opinion. It's not obnoxious to be explicit in your variable names.
Re:Zig; what I think after months of using it by zamalek on Wednesday February 05, 2025 @12:38AM (#42944284)
That implies that Hungarian notation is not obnoxious? Sure, that's a fine opinion to have, but I guarantee it is an exceedingly rare one.
Re:Zig; what I think after months of using it by zozbot234 on Wednesday February 05, 2025 @02:56AM (#42945383)
If you're writing in a language without strong type checking, Hungarian notation makes sense.