Reputation
1,293
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
9 18
Impact
~53k people reached

  • 0 posts edited
  • 0 helpful flags
  • 260 votes cast
Aug
9
comment Using all the parameters of a function
@CdMnky: You provided the method getEaten() which can be used only sometimes in order to solve something what I don't consider to be a problem (see my answer). Such "optional methods" are sometimes necessary, but there should be a very good reason for them. Here, anything else (leaving it alone, creating a different interface, passing NULL, ...) seems to be better.
Aug
8
comment Why was Python's popularity so sudden?
@Mason Wheeler Agreed, but what's the line length limit before you need to scroll? For me it's surely more than 80 chars and in the few cases the line gets longer it's mostly easy to refactor it in two shorter lines. When you stick to the recommended 80 chars per line, you have some problems. But 80 chars is what reminds me of punched cards.
Aug
6
comment When are Getters and Setters Justified
@TheLQ That's what Builder with fluent syntax is for, see e.g. Guava's MapMaker.
Aug
6
answered Using all the parameters of a function
Aug
6
comment Using all the parameters of a function
What you did is far worse than using a single method ignoring its argument.
Aug
6
comment What is the point of properties?
@Dean Harding I guess he's brought some arguments for his opinion and is looking for good counterarguments. He could have left them out, but then there'd appear in the answers, so he's already done part of the work. Unfortunately, some people think it deserves downvotes.
Aug
6
answered Is SRP (Single Responsibility Principle) objective?
Aug
3
comment Minimising little coding mistakes
Make sure you switched on all warnings (except for those where you're sure you don't need them). Use a tool like FindBugs, this is what it's for. While FindBugs is only one of such free tools for Java, I don't know if there's anything for VS.
Aug
3
comment How to better start learning programming - with imperative or declarative languages?
Prolog is based on logic, but departs from very quickly (cut symbol, etc.). Its syntax and semantics are very far from any other language, which is bad for beginners when they encounter "a real language".
Aug
2
comment Why should I write all the Statements within Try-Catch?
@CyprUS Sorry, but your company head is empty, there's no brain inside. Catching all exception in places you can't handle it is the single worst beginners mistake in Java (doing it is wrong in any language; in Java it's just more common because of the checked exceptions). Most of the time, letting the exception bubble up is the right thing. If you don't want you program to abort, then you need to make sure all exceptions are catched somewhere, but surely not in each method.
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).