1,160 reputation
815
bio website
location
age
visits member for 3 years, 8 months
seen 2 days ago

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.
Apr
25
comment Do you use i-->0 for backward loops?
@David Thornley: That's true for the case I was the only one doing this. But what if C&R had propagated it in their first C book and it have become common? Or a big company declared it as the way to go. Would it be still a bad practice?
Apr
25
comment Why do programmers still use mailing lists?
@André Paramés: I'm actually happier with google groups (in any browser) than with Thunderbird. Do you mean "locked" or "logged"? In case of logged, yes, but storing my password for the site in "magical wand" is no worse than storing it in the Email client, and logging in is fast. I agree with the rest.
Apr
25
comment Do you use i-->0 for backward loops?
@B Tyler: Writing operator and "operator" means something different; the quotes should make clear it's not serious. I also explained that it parses as (i--)>0, which IMHO must make it clear.
Apr
25
comment Do you use i-->0 for backward loops?
In your first paragraph your restate what I wrote in the question itself. --- I surely agree that the very first time it takes some time to understand the expression, but what's two minute once in a life? Don't get me wrong, I'm not promoting the use of -->.
Apr
25
asked Do you use i-->0 for backward loops?