Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
merraksh
on Feb 2, 2017
|
parent
|
context
|
favorite
| on:
‘Abusing’ the C switch statement – beauty is in th...
OK, thanks for the explanation.
cytzol
on Feb 2, 2017
[–]
This is a perfect example of why comments that explain
why
something is going on, rather than just
what
is going on, are so useful!
aninhumer
on Feb 2, 2017
|
parent
[–]
I think in this case you could just put the write into a function/macro that documents it's intent.
mannykannot
on Feb 3, 2017
|
root
|
parent
|
next
[–]
There are many good reasons for making functions, and occasionally even a good reason to write a macro, but avoiding writing a comment is not one of them.
aninhumer
on Feb 4, 2017
|
root
|
parent
|
next
[–]
I disagree. Writing a comment to express something that can adequately be expressed by code adds overhead to reading it.
mannykannot
on Feb 4, 2017
|
root
|
parent
|
next
[–]
That looks to me like a made-up problem. I could be persuaded otherwise, though, so post some code that shows how it works for this particular case.
to3m
on Feb 2, 2017
|
root
|
parent
|
prev
[–]
It already is - the function is called "send", and rather than wasting its time just doing one write, it does a whole pile of them at once ;)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: