ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Good coding conventions - Discussion

<< < (8/8)

f0dder:
I had no idea that Iceland, Denmark and Germany were strict about what you can name your kid. Just seems bizarre to me.-Renegade (January 03, 2013, 11:56 AM)
--- End quote ---
The urban legend (which I have done no research of whatsoever) goes that the naming laws were introduced after a girl who was conceived during a bombing in WWII was named "Raketta Bombardina". I personally do find that name laws are sane, considering how mean children are to eachother, and given that some parents are clusterfsck insane - as an adult, you can change your name anyway, and the rules there are somewhat more lax.

But it's all going down the drain anyway, in 2012 "Ninja" (and several other just as silly names) were added to the approved list. "Aloha Ninja" should be approved, for instance... >_<

Renegade:
I probably should add this:

http://xkcd.com/327/



 :Thmbsup:

Jibz:
As an example, if you take this simple function-Jibz (January 03, 2013, 07:47 AM)
--- End quote ---
Well... your sut_open is actually an example of what I consider to be "noise" comments - IMHO they don't really tell anything that the individual API calls don't already (I'm not familiar with those APIs, though I guess they're related to performance counters). Personally I'd probably rename make_counterpath() -> make_uptime_counter_path(), and get rid of all the comments...

But I might add a comment on how to actually get at the counter value, since that's not evident from the code if you're not familiar with the Pdh API (hm, you add a counter to the query, but there's no "execute" thingy, and you close the query handle right after the add? That looks quirky, but none of the comments say anything about it.) Oh, and I'd replace sizeof(array)/sizeof(elem) with a lengthof macro (for C++, I'd probably use a template function for it, since it's slightly ever more typesafe, but this seems to be über-pure C code, from the single-line block comments :P).
-f0dder (January 03, 2013, 11:43 AM)
--- End quote ---

I am sorry, I thought it was obvious that this was a single function taken from a file -- there are functions to access the values and close the query as well :Thmbsup:.

And (if you'll excuse the tongue-in-cheek) if you think it closes the query right after adding, then I'll take that as an example that even simple code is not easy to read compared to comments :-[.

f0dder:
I am sorry, I thought it was obvious that this was a single function taken from a file -- there are functions to access the values and close the query as well :Thmbsup:.-Jibz (January 03, 2013, 01:11 PM)
--- End quote ---
I guessed that much :) - it's just that, coming back to the code after several months & given the other comments in the function, I'd be wondering "why isn't *this* part being commented?". See next comment, though :P

And (if you'll excuse the tongue-in-cheek) if you think it closes the query right after adding, then I'll take that as an example that even simple code is not easy to read compared to comments :-[.-Jibz (January 03, 2013, 01:11 PM)
--- End quote ---
Ah yes (double-tongue-in-cheek), I obviously got distracted by the comments and didn't read the code properly ;-p

Navigation

[0] Message Index

[*] Previous page

Go to full version