173 reputation
6
bio website unclezeiv.kerid.org
location Italy
age 34
visits member for 4 years, 3 months
seen Dec 19 at 16:21
Yet another geeky guy with a thing about code, graphics and trains.

Dec
19
comment When is a number a magic number?
@Deduplicator, sure, but while I do think that yours is a valid point, it is more an answer to the general "raw number vs. named constant" debate, it doesn't seem to address the concern that Daniel raised here. hours_per_week = 24 * 7 is fine, but frames_per_duration = 24 * 60 * 60 is already a bit more confusing... are we computing seconds per day or frames per hour? Sure, you might argue that the variable is named incorrectly, still naming the constants would help as well.
Dec
18
comment When is a number a magic number?
@Deduplicator, I think you missed the point of Daniel's answer. It's obvious that there are 24 "hours per day", but it's not obvious if that's the concept you are referring to when there are other "24" constants floating around in your code.
Aug
12
comment What is beautiful code?
You might be interested in reading Beautiful Code: Leading Programmers Explain How They Think then!
Aug
9
comment changing value of a private member of a class in c++ without using member or friend function
True. By singling out the C-style cast I just meant that it's a particularly strong type of cast... you are basically shouting "I know what I am doing!" :)
Aug
9
answered changing value of a private member of a class in c++ without using member or friend function
Jun
11
comment Visual programming for serious software
very good points, especially n.1
May
14
awarded  Editor
May
14
revised Why is putting something on the stack called “push”?
Improved formatting
May
14
suggested approved edit on Why is putting something on the stack called “push”?
Apr
6
comment How do you maintain focus when a particular aspect of programming takes 10+ seconds to complete?
@Leo: I believe you can customize libnotify desktop alerts by calling the notify_send utility: notify_send title message and it also has options for icons, how long it should persist, etc.
Mar
23
comment How would you know if you've written readable and easily maintainable code?
"Of course in your point of view your code is readable" - not that obvious!
Mar
21
comment Why was Java chosen for Android?
@ZJR: the main languages in use at Google have always been Java, Python and C++. Java was always there even before Android.
Jan
19
answered Date as software version number
Jan
13
comment Are there good techniques or tests for naming types?
@S.Lott: hm, no, you just repeated the first three, I was thinking more of 7. spend a lot of time on inventing names 8. use code reviews and 9. don't hesitate to rename
Jan
13
comment Are there good techniques or tests for naming types?
In case it's a public API, there are three additional techniques you can use...
Nov
30
comment Elegant ways to handle if(if else) else
@herby: no, you would still have two functions, and then an additional one that wraps them. I don't think that would break "single responsibility"?
Nov
30
comment Elegant ways to handle if(if else) else
... of course I meant "go the extra mIle"... :)
Nov
30
comment Elegant ways to handle if(if else) else
or go the extra male and create an additional FileExistsAndConditionMet(file) method...
Nov
3
awarded  Commentator
Nov
3
comment Why are brackets required for try-catch?
I think the real question is the other way round: why do some constructs allow for "naked" statements? Braces should be compulsory everywhere for consistency.