103 reputation
4
bio website
location Netherlands
age 25
visits member for 4 years, 3 months
seen Dec 4 '13 at 11:15

May
26
comment In languages that don't allow underscores in integer constants, is it a good practice to create a constant for 1 billion?
@RexKerr: I most certainly wasn't proposing to define NANO = 1e9. Obviously a nano-anything is 1e-9.
May
26
comment In languages that don't allow underscores in integer constants, is it a good practice to create a constant for 1 billion?
@RexKerr: "Using anything other than unicode Mu or Latin u/U for micro is asking for confusion." - Yes that's exactly my point?
May
25
comment In languages that don't allow underscores in integer constants, is it a good practice to create a constant for 1 billion?
@RexKerr: Fine here, but that pattern would cause a conflict for µs and ms: both are MS_PER_SEC when capitalised. Personally I might just use constants like NANO, MICRO, MILLI because whether you're talking about seconds or meters or teslas isn't relevant.
May
25
comment In languages that don't allow underscores in integer constants, is it a good practice to create a constant for 1 billion?
@MrFox: Considering that size_t is not going to accept double literals, not very long.
Oct
19
comment Why use other number bases when programming
@vasile: There is 60 minutes in an hour and 60 seconds in a minute because people were using base-60 systems, not the other way around. I hope you don't believe that there is something in nature that says there must be 60 minutes in an hour!
Oct
3
comment Why don't computers store decimal numbers as a second whole number?
There is a third option. Floating point with a decimal exponent, like how C# decimal is implemented: stackoverflow.com/a/5019178/174335 It's not BCD as there is no individual representation of decimal digits, and it's not fixed point.
Sep
25
comment Why are exceptions considered better than explicit error testing?
@FredOverflow: I'm going to be amazed if you can come up with a single error handling that applies to all situations where you ever allocate anything. In general, all your checked_malloc could do is pass the error on just like malloc does already.
Aug
29
comment Why do we have to use break in switch?
@DanielB: C# actually does not allow fall through at all, what it allows is having a case with multible labels. Note how the updated version of the same page does not refer to fall through anymore, as that was misleading terminology for the C# case.
Feb
5
comment Why should identifiers not begin with a number?
@DanielPittman: You'd need semantic analysis to do any sort of reliable disambiguation, so that can't be done in the lexer. Pushing the decision out of the lexer makes the parser more complex, and to what benefit? Besides the very poor cost/benefit situation, there is just no good way to handle a case like int 0u = 5; unsigned int x = 0u; However you choose to define the interpretation of this code (likely either x == 0 or x == 5), people are going to be confused because of the ambiguity. Even if it were trivial to implement the compiler this way, a good designer would likely not do it.
Jan
14
comment Are there good techniques or tests for naming types?
7. Don't hesitate to redesign types or functions if it turns out that it's impossible to devise a proper name for them. Well-designed code can always be properly named.
Oct
21
comment Should I reuse variables?
Variable re-use conflicts with choosing decent identifiers for your variables. In modern languages there aren't really any advantages to variable re-use that outweigh the benefits of having good identifiers.
Oct
15
comment Is it wrong or bad to use autocomplete?
As wrong as using sticks on a drum kit instead of your bare hands. ;)
Oct
9
comment When you should NOT use Regular Expressions?
@Jörg: It is very much true that there is a massive difference between regular expressions in mathematics and their implementations in software libraries. It is also true that most regular expression libraries have extensions that place them far beyond accepting merely regular languages, and that calling them regular expressions is not always so appropriate. I agree with you that there are two different concepts. But they have the same name; regexp is still just an abbreviation, not a term in itself. Plenty of this examples on this site of using the full term for the software libraries.
Oct
9
comment When you should NOT use Regular Expressions?
@Jörg: Regexp is just an abbreviation for regular expression.
Sep
28
comment Interviewing someone for general unix skills
@mouviciel: It's also the most efficient learn to way about the unix command line when you are online, since most forums will 'helpfully' tell you to rtfm if you ask them details about the commands. This should be okay if the man pages weren't incredibly convoluted and hard to navigate documentation. Luckily there's stackoverflow!
Sep
14
comment Recursion without factorial, Fibonacci numbers etc
blogs.msdn.com/b/ericlippert/archive/2004/05/19/…
Sep
14
comment Suggest a good programming language to learn that is not OOP and definitely not in C style syntax
@SK-logic: I agree, but describing languages as irrelevant and unimportant is an exaggeration.
Sep
14
comment Suggest a good programming language to learn that is not OOP and definitely not in C style syntax
@SK-logic: Except when you actually have to do some programming.
Jul
28
comment Why do people use programming books?
"Where the book fails, there is always google." You mean Stack Overflow ;)
Feb
15
revised Which skills would you expect and appreciate in a Junior Software Engineer?
removed superfluous question mark