1,196 reputation
815
bio website
location
age
visits member for 3 years, 11 months
seen Dec 17 at 10:44

Jul
23
answered Object-Oriented Class Design
May
15
asked Reasons for separate source and generated trees
May
10
comment Are short identifiers bad?
Don't forget that the names need not only be typed but also read. Using too long identifiers may actually decrease the readability a lot. Using anything but i in a loop like for (int i=0; i<dst.size(); ++i) dst[i] += src[i] should be prohibited by law.
Apr
28
comment Are short abbreviated method/function names that don't use full words bad practice or a matter of style?
As pointed by User and dsimcha, there are very good reasons for some short names.
Apr
27
comment Subversion/source control only for production code?
@Tom Hamming: I switch from SVN to GIT nearly one year ago. After some initial swearing, I started to love it (although under Cygwin it doesn't work as good as under Linux). I never spent any money for it, I'm quite satisfied with the command line and the two free tools included. I don't even work to integrate it into my IDE (eclipse). YMMV, but if I were in your place I'd use my private git repo and git svn for the interaction. You don't need to buy anything and you don't need to convince anybody; they don't even need to know.
Apr
27
comment What syntax element do you hate most in a programming language you use frequently?
@Billy ONeal: I'd suggest to always write x.a, no matter if dereferencing happens. For C it's sufficient, for C++ not always, but nearly always, and there could be a special syntax for such cases.
Apr
27
comment What syntax element do you hate most in a programming language you use frequently?
That's nonsense, it's trivial to remember and optically very different. Using the keyword and is even a bigger nonsense. Without reading the definition, what does and mean? Is it logical or bitwise? People confused by the difference between & and && probably need something like logand and bitand.
Apr
27
comment What syntax element do you hate most in a programming language you use frequently?
@Billy ONeal: I mean, there's no shared_ptr nor anything else in C, where both . and -> could apply. So dot alone would be sufficient for C.
Apr
26
comment Do you use i-->0 for backward loops?
Probably pascal or basic would better suit you?
Apr
26
comment What syntax element do you hate most in a programming language you use frequently?
@Billy ONeal: I disagree. It's C++, not C. First, in C there should never have been -> as it's useless there. Second, for your special case another syntax could be invented. --- @Mason Wheeler: Agreed, but Delphi is much more confused (just try to overload a function on DOUBLE and TDate and call it).
Apr
26
comment What syntax element do you hate most in a programming language you use frequently?
What other type parameterization does the compiler think foo could have? - For whatever reason it things it's raw type - as if anybody sane would even mix raw and parametrized types.
Apr
26
comment What syntax element do you hate most in a programming language you use frequently?
I'd even propose to use == for equality and := for assignment. This way you have more to type, but avoiding the lonely = helps to avoid bugs.
Apr
26
comment What syntax element do you hate most in a programming language you use frequently?
@MainMa: If the original statement was in a single line, then it's his fault. Point. If it wasn't... well... use a proper editor which indents it properly. I never ever use braces in one-liner and it never happens to me.
Apr
26
comment What syntax element do you hate most in a programming language you use frequently?
@Evan Plaice: 'self parameter is just explicit in python where it's implicit in other languages' That's only one part of the story. The other part is python being weekly typed. Together it's terrible, forgetting self happens to easily and costs time.
Apr
26
accepted Command line options style - POSIX or what?
Apr
26
comment Command line options style - POSIX or what?
I like all the answers, accepted this one because of the links.
Apr
26
comment Do you use i-->0 for backward loops?
I accept this answer because it's the only one mentioning the problem with unsigned and because of the other answers being all about the same.
Apr
26
comment Do you use i-->0 for backward loops?
@davidk01 Agreed, that side effects plus return value is bad, I try to avoid it most of the time. But knowing well the basic operators in no trivial detail.
Apr
26
comment Do you use i-->0 for backward loops?
@davidk01: You should just learn it. As the name says, predecrement decrements the variable first and then returns the result, while postdecrement first returns the value and then decrements the variable. This belongs to basics of many languages and should not halt anybody from anything. That said, I agree that cryptical constructions are to be avoided.
Apr
26
comment Do you use i-->0 for backward loops?
No, for unsigned int, the condition i>=0 is always true, so the first loop never terminates while the second still works.