News for hackers. Stuff that matters.
Re:Static Types Are for Perfectionists by static_void on Monday May 19, 2025 @06:48PM (#44035762)
In Rust, the `todo!()` macro will fill in type holes without needing to be finished.

Surely you can't be against putting a TODO in an unfinished part of the code?

Re:Static Types Are for Perfectionists by lisper on Monday May 19, 2025 @06:57PM (#44035830)
I'm against anything that adds cognitive load without a compelling reason, anything makes me do unnecessary work. Typing "todo!()" is not a huge burden, but it's not zero, and if the Rust compiler is smart enough to fill in the hole it should be smart enough to do it without my having to explicitly tell it.
Re:Static Types Are for Perfectionists by kibwen on Tuesday May 20, 2025 @08:15AM (#44040681)
No, because 99.9999% of the time, you explicitly do not want the compiler implicitly filling in a hole like that, and do want the compiler to tell you that you've forgotten an entire branch of control flow. Typing `todo!()` to make your intent explicit is among the least obtrusive things imaginable.
Re:Static Types Are for Perfectionists by lisper on Tuesday May 20, 2025 @09:40AM (#44041538)
> No, because 99.9999% of the time, you explicitly do not want the compiler implicitly filling in a hole like that

Who are you to tell me what I want? You are making all manner of tacit assumptions about the kind of work I do and what my requirements are. I absolutely do want the compiler filling in every hole it possibly can. For me, that's the whole point of using a high-level language in the first place. For the kind of work I do, what matters most is getting things done as quickly as possible. Correctness and run-time efficiency are secondary considerations.

Re:Static Types Are for Perfectionists by kibwen on Tuesday May 20, 2025 @10:37AM (#44042143)
If correctness is a secondary consideration, then you'll be happy to learn that LLMs will let you code in plain English, so there's no need to bother with using a programming language at all. The LLM will happily fill in all the holes it encounters, more eagerly than any compiler would ever dream of.

But for people who prioritize precision and correctness, that's what programming languages were invented for.

Re:Static Types Are for Perfectionists by lisper on Tuesday May 20, 2025 @10:55AM (#44042341)
There are two problems with using LLMs for writing code. The first is that when the code they produce doesn't work (which is most of the time) I still have to debug it, and now I'm debugging someone else's (or someTHING else's) code rather than my own. The second is that the work I do is very specialized (custom ASIC design) and LLMs are utterly useless.

But yeah, if all you need to do is build a vanilla app then an LLM is probably an effective tool.