340 reputation
16
bio website
location Oslo
age
visits member for 3 years, 2 months
seen Dec 17 at 16:20

Mar
5
comment What are the problems of bringing C++-like const into a language?
I completely agree with Doval. "Const poisoning" is not a problem, as long as you always mark functions const when they really are const. And if an external library says a function your're calling is not const, then you can no longer guarantee constness of your function and can not mark it as const, simple as that.
Aug
20
comment Is a well written documentation a good enough reason for learning a programming language?
There is a fourth reason I think you have skipped: Because the language looks fun!
Jun
20
comment What's with the aversion to documentation in the industry?
+1 for "If your code is so hard to read that you need comments, wouldn't time be better spent cleaning the code?" In my experience code and documentation seldom tells the same story.
Mar
14
answered Scrum Master in the organization
Mar
5
awarded  Caucus
Jan
25
revised Git: rebasing on top of a refactor that affects the target rebase branch
added 499 characters in body
Jan
24
answered Git: rebasing on top of a refactor that affects the target rebase branch
Jan
17
comment Refactoring: Two big chunks within a function
+1: Only thing I am not sure about is if a and b should be re-inlined anyway. If you make this method call either a or b, it is already doing one thing, it is deciding which route the code should go. Then it's the subroutines that are responsible for doing the actual work. At least my take on it. But yeah... I think he should do the obvious refactoring first, and see where it takes him.
Jan
15
comment How should I distinguish between built-in types in Python?
True. Given that the lookup is as easy as you assume in your code.
Jan
15
comment How should I distinguish between built-in types in Python?
I agree. Ideally I would have had two functions: lookup_person_dict, lookup_person_string and force the user to be specific. The problem I find with this is that you basically use a try/except block for control flow, is a big no-no in my eyes. However, having a function which accepts both string and hashmaps is also a no-no in my eyes, and so this exception flow is the cleanest alternative I can think of at least.
Jan
4
comment Is it necessary to add the default case while using switch cases?
In case 1 and 2, a default case should be an error. If your coding style always use default, then do that, but make it emit an error in 1 and 2. Is possible, it should emit it at compile time, but that might not always be possible, if ever in java. I at least think it's important for the user to get the message that "You are shooting yourself in the foot by passing in this value"
Jan
3
comment Should I use the new C++11 'auto' feature, especially in loops?
@fish: range based for-loops rules, but I would have been pedantic and done: 'for (T& it : x)' instead when using range based for-loops, as I feel using auto there is less informative. Kind of a misuse of auto in my mind.
Dec
15
comment How do you balance between “do it right” and “do it ASAP” in your daily work?
As Uncle bob says: The slow way is the fast way. Take the time it takes to write those unit tests, and write your code well. This might cause it to take some more time for the feature to be implemented, but will save time in the long run as it will be easier for others to modify and fix bugs in.
Dec
14
comment Why does the Scrum guide say no testers?
@Maxood: Testers should, in my opinion, not touch unit tests. They should work on acceptance tests, in cooperation with developers, and have responsibility for the manual/GUI testing. The unit testing is on a level that is only interesting for the developers. The test pyramid (blogs.agilefaqs.com/2011/02/01/inverting-the-testing-pyramid) also has responsebilities, Unit-testing=developers, acceptance testing = shared, GUI testing = testers.
Dec
14
comment Review tests first
I understand your concern, and it is therefor the test should never pass the first time. A TDD cycle goes like this: 1) Write the minimal, sane, test needed for the tests to fail. 2) Write only the production code you need to pass that test. 3) Refactor 4) goto 1. Clearly, you should try your test before even starting writing production code, to verify that your test will catch that bug/missing feature. Then you should implement enough of the feature to make the test pass, refactor, and then write a new minimal test.
Nov
5
comment Co-worker uses ridiculous commenting convention, how to cope?
How the hell does he mean that it makes it easier for him to read the code? The comments are identical to the code, does he struggle reading the code? Can he code? I'm confused, frustrated and a bit angry about this! Edit: What he actually does here is undermine all the important comments. I, and most likely your teams developer, would be so accustomed to see crappy comments that you just ignore them. When a real important comes along, you will ignore that too. A comment should be a red flag, not spam you just ignore.
Nov
5
comment Co-worker uses ridiculous commenting convention, how to cope?
Management will never care about stuff like this. They are not coders (in most cases), and have no idea about code smells. Have you asked him about his rational for doing this? That might give a clue as to why he does it, and what you can do to change his mindset. You could also tie him to a chair and force him to see the clean coder videos from Uncle Bob: cleancoders.com
Oct
26
comment How do operating systems… run… without having an OS to run in?
And even more incredible if you go from desktop to embedded. 1) Hardware looks for a bootloader in a given sector on disk. 2) Bootloader runs from disk and sets up memory and GPIOs. 3) Bootloader loads itself into the memory. 4) Bootloader finds kernel and loads it into memory. 5) Bootloader dies, and kernel lives. This of course, requires detailed knowledge of the memory addresses on the board, as well as what type of memory is used. Or to say it in other words: U-boot load the kernel by magic!
Oct
22
awarded  Yearling
Oct
10
comment Is a coding standard even needed any more?
I agree that indentation style is a minor thing, as long as you keep the same style for a project/library.