Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
vardump
on May 11, 2018
|
parent
|
context
|
favorite
| on:
The Evolution of C Programming Practices: A Study ...
Boilerplate doesn't mean (binary) bloat.
WalterBright
on May 11, 2018
[–]
Rather than debate, here's an example of replacing goto's with a nested function:
https://github.com/dlang/dmd/pull/6656/files
vardump
on May 11, 2018
|
parent
[–]
I guess it's a matter of taste, but I often (not always) prefer less return statements in a function with gotos to error handling/cleanup code. Especially in kernel mode drivers.
WalterBright
on May 11, 2018
|
root
|
parent
[–]
Check the asm code generated by your compiler - it may optimize multiple returns into one.
vardump
on May 11, 2018
|
root
|
parent
[–]
Not performance or code size I'm concerned, it's mainly about correctness. Stuff like input validation and releasing a spinlock in kernel code.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: