Remix.run Logo
xyzsparetimexyz an hour ago

> But nothing gets in your face how to use the programming language "correctly".

It doesnt let you have unused variables and theres no multiline comment support. These are fairly significant productivity issues for me

saintfire 7 minutes ago | parent | next [-]

The unused variable error drives me insane

If they wanted the release build to be an error I wouldn't care. Having the current solution be "have the editor automatically change code to include or remove the underscore" is so wrong to me. Just invented a problem that needs tooling to modify source code to fix.

afirmativ an hour ago | parent | prev | next [-]

I agree - can't create and toggle between rough code sketches of functions in a source file without these features. It's more than annoying.

galangalalgol an hour ago | parent | prev [-]

What do you like to ise those features for?

xyzsparetimexyz an hour ago | parent | next [-]

In rust, having unused variables as a warning (but not an error) let's you refactor code, test it and see what is now unused as a result. You can then remove the unused items. Zig requires you to remove the unused items (e.g. with '_ = ...;' which is then something you might forget about) before testing, increasing friction.

Multiline comments are less important, but its still convenient for commenting out large chunks of code. IDEs make this a bit easier when you can press e.g. Ctrl+/ to comment out the selected lines with //, but it doesn't work in all cases.

The friction stops zig from being fun imo. A shame because I really like comptime.

galangalalgol an hour ago | parent [-]

Thanks, there is always a risk of people jumping on replies like that to scream that you are doing it wrong. I just wanted to see how other people do stuff. Hope everyone stays nice.

Weebs an hour ago | parent | prev [-]

Not the person you replied to but I leave unused variables as future TODOs. It's a warning in F#. I also often use them for inspecting data in the debugger