Reputation
772
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 9
Newest
 Nice Answer
Impact
~19k people reached

  • 0 posts edited
  • 1 helpful flag
  • 270 votes cast
Jul
29
comment How to work with programmer with different preference of indentation width?
@Dunk – Sorry, another comment, I haven't yet responded to this: “what's clearest is a matter of taste”. Well, sure. But you might as well say it's a matter of taste how the ingredients of food are best mixed. It's still a good thing that every chef is allowed to do this according to their own discretion, isn't it?
Jul
29
comment How to work with programmer with different preference of indentation width?
(Of course, for a fact, many mainstream languages are so verbose that you seldom have enough room to express anything through layout. This then requires awkward comments to explain something the code should really have explained by itself. Oh well...)
Jul
29
comment How to work with programmer with different preference of indentation width?
@Dunk: I've not argued against uniform style conventions. I've argued against pedantically enforcing them, and I particularly disagree with your premise that automatic tools are more efficient at this than human programmers. Using a good text editor with clever autoindent cycles is one thing – to make the standard indentation trivially easy to type. Subjugating the whole appearance of the code to a rigid set of rules is quite another thing, since such rules can't possibly anticipate every situation where you might need a particular layout to best visualise what's going on.
Jul
28
comment How to work with programmer with different preference of indentation width?
@SteveJessop: “the questioner's team seems to highly value particular indentation depths” – yeah, well. My main point was that this is probably a bit of a stupid attitude.
Jul
27
comment How to work with programmer with different preference of indentation width?
@Dunk: then again, I could say if you're using a language that requires formatting tools, you are being far less efficient than you should be. Code formatting should be fully integrated into a language's design – the things where there's a clear “right” and “wrong” should be enforced by the syntax rules, and every freedom in whitespace usage etc. should be available to the programmer to make the code as readable as possible.
Jul
27
answered How to work with programmer with different preference of indentation width?
Jul
19
comment When speaking, how can I say that the time complexity order of an algorithm is O(N log N)?
“can't expect there to be a single word to describe every complexity class” – certainly not. But 𝓞 (n ⋅ log n) is such an important class that it does deserve a name of its own, IMO; and as said by Steve Jessop, linearithmic is pretty common already.
Jun
29
comment How do I design a subclass whose method contradicts its superclass?
I second Steve Jackson. Don't use OO where it's not necessary. Just because Java enforces this style doesn't mean it's a good idea to make everything a class.
May
19
comment How do you avoid getters and setters?
FTR, I think more “experts” still teach to meaninglessly create getters/setters for everything, than to never create any at all. IMO, the latter is less misguiding advice.
Apr
15
comment performance versus reusability
Modularity and optimisation are not necessarily at odds. Modern compilers can inline pretty much anything anywhere, so no matter how modular you write, as long as the compiler can stitch it together to a “non-modular executable”, there's no reason it couldn't be as fast as code that was written non-modular in the first place. Of course, not all compilers can do this very well, but...
Apr
2
comment Does path coverage guarantee finding all bugs?
@MatthewRead: if you apply this consequently, then the “error space” is a proper subspace of the space of all states. Of course it's hypothetical because even the “correct” states make up a far too large space to allow any exhaustive tests.
Apr
2
answered Does path coverage guarantee finding all bugs?
Mar
25
awarded  Nice Answer
Mar
24
answered Is there a reason to have a bottom type in a programming language?
Mar
10
comment Why aren't `void *`'s implicitly cast in C++?
Well, templates aren't really needed for such a complete safe type system: Hindley-Milner based languages get along without them quite well, without implicit conversions at all and no need to write out types explictly either. (Of course, these languages rely on type erasure / garbage collection / higher-kinded polymorphism, things which C++ rather avoids.)
Jan
22
awarded  Yearling
Jan
22
revised class in OOP language and type
added 89 characters in body
Jan
22
comment class in OOP language and type
...more importantly, my anwer does consider behaviour. Indeed behaviour is usually the reason why you use inheritance, and the unification of different possible behaviours precisely captures the sum-type aspect of OO classes.
Jan
22
comment class in OOP language and type
@ruakh: no. You can of course implement functions in OO, but in general, methods are not functions (because they modify state etc.). Nor are "functions" in procedural languages functions, for that matter. Indeed, single-static-method interfaces come closest to function/exponential-types, but I hoped to avoid the discussion of that because it has no relevance for this question.
Jan
22
revised class in OOP language and type
Typos in footnote