1,996 reputation
719
bio website michael.kjorling.se
location
age
visits member for 4 years, 6 months
seen Apr 21 at 18:40

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
Nov
21
answered PHP Source Code Encryption Concept
Nov
21
comment PHP Source Code Encryption Concept
Don't forget also that storage can (and does) develop errors. Depending on exactly how the checksum calculation is implemented, this can cause a different checksum to be computed. Now you've permanently blocked that IP address. Some great customer service, there.
Nov
10
comment Is it imaginable to teach a machine how to program itself to a defined specification?
I think it's fair to say though that Jeopardy is a bit of a special case: it boils down to recalling and associating facts. Take even the best specialists, and there will be nuggets of even public knowledge that they are unaware of, or unable to recall under pressure. On the other hand, to a computer which is capable of analyzing an encyclopedia (such as Wikipedia, Encyclopedia Britannica, or any other), no fact stated in that encyclopedia is more (or less) exotic than any other.
Oct
25
awarded  Yearling
Oct
24
revised Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
Convert from double back to double makes no sense