Skip to main content
8 events
when toggle format what by license comment
Sep 13, 2011 at 8:22 comment added Kilian Foth No, it's a completely made-up value. But the fact that you wonder about it just emphasizes the point: if the code had said mixLeadedGasoline(), you wouldn't have to!
Sep 13, 2011 at 7:06 comment added user1249 Is "0x006A" a known brand in some cultural circles or is it "just" the magic constant?
Sep 13, 2011 at 6:55 comment added Péter Török +1 for pointing out that code within a method should be in the same abstraction level. @vemv, it is good practice because it makes the code easier to understand, by avoiding the need for your mind to jump up and down between different levels of abstraction while reading the code. Tying abstraction level switches to method calls/returns (i.e. structural "jumps") is a nice way to make the code more fluent and clean.
Sep 12, 2011 at 18:56 comment added user131 If you're just saying that petrolFlag |= 0x006A; without any kind of decision making, it would be better to simply say petrolFlag |= A_B_C; without an additional function. Presumably, engageChoke() should only be called if petrolFlag meets a certain criteria and that should clearly say 'I need a function here.' Just a minor nit, this answer is basically spot on otherwise :)
Sep 12, 2011 at 18:31 comment added WernerCD I would say that a constant abstraction level leads to... consistency... which is a good thing.
Sep 12, 2011 at 17:18 comment added deprecated +1 I'm all for self-documenting code :) by the way, I think I agree on keeping a constant abstraction level through blocks, but I couldn't explain why. Would you mind expanding that?
Sep 12, 2011 at 15:33 comment added Coder That 0x006A is lovely :D A well known constant of carbonized fuel with additives a, b and c.
Sep 12, 2011 at 14:39 history answered Kilian Foth CC BY-SA 3.0