News for hackers. Stuff that matters.
Re:From Rust to TypeScript by ape4 on Saturday September 12, 2020 @02:37PM (#24454417)
Does anyone else hate foo(), bar() and baz() as example names. They are meaningless - except communicating that its a programmer selected name. Even func1(), func2() would be better.
Re:From Rust to TypeScript by jpxw on Saturday September 12, 2020 @02:51PM (#24454525)
f(), g() and h() are decent alternatives.

Of course, the real solution is to come up with an reasonable example scenario with meaningful names.

Re:From Rust to TypeScript by hu3 on Saturday September 12, 2020 @04:06PM (#24455167)
a, b, c seems more intuitive
Re:From Rust to TypeScript by fortydegrees on Saturday September 12, 2020 @02:42PM (#24454451)
Yep.
Re:From Rust to TypeScript by friedman23 on Saturday September 12, 2020 @02:40PM (#24454435)
I dont think it matters
Re:From Rust to TypeScript by someHnUser on Saturday September 12, 2020 @02:55PM (#24454555)
I'm ok with it but I think it does matter a bit.

here's a small example:

"Did baz call bar or did bar call baz ?" "Did func2 call func3 or did 3 call 2?"

Again not a big deal but if I'm trying to show a snippet of code then I would try to make that snippet as simple to follow to get my point across. I think it's a sensible rule.

In this case, could it have helped if instead of ,hypothetically, keeping this information in your head "foo called bar which baz" you could rely on meaningful names to help the reader ? Yes. Yes I think it would be beneficial (matters a bit).

Whether that's specifically "func2"..3 or very verbose names "funThrowsExceptionOn0()", I think it would help.

You can argue if that was necessary here for this example but I think it'd be hard to argue against meaningful names.