Reputation
2,060
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
7 19
Newest
 Yearling
Impact
~58k people reached

Jul
30
comment TODOs in Checked in Code
Your point on "Team's workflow vs. personal workflow" is why I like using a custom marker. Pick a word, any word; a nonsense word is even better because it won't appear in legitimate code. Use that as your "todo" marker. Keep that out of the mainline branches the same you would/should a "TODO" marker (I do a branch-wide search for my own marker before merging).
Jun
26
revised What is the Best Collation for Use in MySQL Tables?
added 942 characters in body
Jun
9
comment What is the “type” of data that pointers hold in the C language?
@Rob In a segmented memory model, a pointer can be either a single value (an address relative to the start of the segment; an offset) with the segment implied, or a segment/selector and offset pair. (I think Intel used the term "selector"; I'm too lazy to look it up.) On the 8086, these were represented as two 16-bit integers, which combined to form one 20-bit physical address. (Yes, you could address the same memory cell in many, many different ways, if you were so inclined: address=(segment<<4 + offset) & 0xfffff.) This carried forward through all x86 compatibles when running in real mode.
May
18
comment The principle of least knowledge
Related: Is code like this a “train wreck” (in violation of Law of Demeter)? (full disclosure: that's my own question)
May
6
comment Should we define types for everything?
And of course, what does 05-03-2015 mean when interpreted as a date?
Apr
16
comment Why the recent shift to removing/omitting semicolons from Javascript?
"I keep forgetting where where the semi-colon lies on my keyboard" So your inability to learn the keyboard layout should be used as a justification for causing possible extra headache for the next programmer to maintain the code? (Remember: The maintenance programmer who has to fix something in your code is a violent psychopat who knows where you live.)
Apr
14
comment Why do many exception messages not contain useful details?
@anaximander While it is certainly true that in some cases it's not possible to provide more details in a meaningful manner, that does not preclude the possibility of providing additional details when doing so is practical.
Mar
30
comment Does path coverage guarantee finding all bugs?
Here is another implementation that passes the test (please pardon the non-linebroken Python): def abs(x): if x == -3: return 3 else: return 0 You could possibly elide the else: return 0 part and get 100% coverage, but the function would be essentially useless even though it does pass the unit test.
Mar
15
comment why is the latter function 10% faster although it must create the variables over and over again?
And even if the "optimization" doesn't affect performance negatively, it almost certainly is going to affect code readability negatively. Which, unless you're doing some crazy computational stuff, is most often a bad tradeoff to make (apparently no permalink anchor unfortunately; search for "2009-02-17 11:41"). As the summary there goes: "Choose clarity over speed, if speed is not absolutely needed."
Feb
25
comment Is it reasonable to assume that any physical quantity can be represented by a 64-bit integer without overflow or underflow?
Even the 8086 could perfectly well address 1 MiB natively. Reserving the upper 384 KiB for various system-related address spaces was IBM's idea, not Intel's or even really Microsoft's. (Microsoft may have influenced the decision of the exact cutoff point, but IBM did the hardware design and at some level Microsoft had to make their software work with IBM's hardware.) And given that a high-end computer at the time might have had 128 KiB RAM, 640 KiB really must have seemed like a lot. Scale that naiively to modern personal computers and you're looking at a cutoff around 160 GiB. Unreasonable?
Feb
10
comment How can I ask my boss (in a polite way) to comment his code?
@DocBrown Working in a separate branch is a good strategy in general, but if adding comments breaks something, then I'd say the codebase has bigger problems......
Feb
10
comment How can I ask my boss (in a polite way) to comment his code?
Like Jan Doggen said. Either schedule some time with him and buffer up questions that you find yourself struggling with while working with the code, OR consider emailing your questions to him. If you do email him, ask first to make sure he's okay with it, and before you email a question, do your best to find the answer yourself first. Email has the advantage that it is asynchronous: he can answer whenever he has a small block of free time, even if you are doing something completely different at the time, and the answer will still be equally useful to you when you get it.
Feb
8
comment Why is instance creation the way it is?
...and that's why you have clazz.
Feb
2
revised Is a 1 < 10 comparison less expensive than 1 < 1000000?
Valid code is better
Feb
2
suggested approved edit on Is a 1 < 10 comparison less expensive than 1 < 1000000?
Jan
21
revised Is address 0000000C a special address?
65 KiB = 66 560 bytes != 65 536 (2^16) bytes
Jan
21
suggested approved edit on Is address 0000000C a special address?
Jan
20
comment How to make significant technical decisions given very little time
Although if technology X is a good enough fit, and Fred is willing to educate the other developers, doing so may be a good way to kick-start the team.
Dec
18
comment Are all magic numbers created the same?
@durron597 Nothing special happens when your timekeeping software is deployed on Mars, because by convention Mars days are 24 hours long, but each hour is 2.7% longer than it is on Earth. Of course, neither an Earth sidereal day nor an Earth solar day is exactly 24 hours (exact numbers are on that same page), so you can't use 24 anyway! Like Izkata mentioned, leap seconds hurt. Maybe you'd have better luck actually using the constant 24 on Mars than on Earth!
Nov
21
revised PHP Source Code Encryption Concept
added 476 characters in body