231 reputation
18
bio website stackoverflow.com/users/23118/…
location Norway
age 41
visits member for 4 years
seen 2 days ago
Linux user since 1994. Main programming language: C.

Jun
30
comment Software Requirement Specification documentation by professionals
There exists swebok.org (which redirects to computer.org/portal/web/swebok). I assume this is new relative to when this answer was written.
May
15
comment I am making 4-5x more story points than average, but producing bugs at half the rate. Graphs say it's 2x more bugs, how to deal with that?
Great programmes might actually produce more errors than the average programmer - because great programmes tend to work on harder problems.
Jan
14
comment Intentional misspellings to avoid reserved words
classToBeAccessed is a good name indeed (classToBeChecked would perhaps be even better).
Feb
21
comment How to minimize the data loss when laying off a programmer?
The way to minimize losses it to have longer mutual lay off/resign periods. See my answer workplace.stackexchange.com/a/6905/513 for more details. The incredible short lay off time only triggers bad feelings/psychological effects on both parts, and whatever theoretical positive economical flexibility effect there might be it is by far out weighted by the negative social effects.
Jan
21
comment Naming conventions: camelCase versus underscore_case ? what are your thoughts about it?
The "usability" point is irrelevant for this. Code is typically written just once by one person, but let's say in the order of 1-10 times accounting for some editing and potential pair programming. But code is typically read dozen/hundreds/thousands of times by one or potentially many people. Thus making code easy to read is several magnitudes more important than having code easy to write.
Aug
29
comment Is it a common practice to minimize JavaScript usage when building a website?
Absolutely. Javascript should be used as spice, not the main course.
Aug
12
comment how do I know I've split my program into too small pieces?
For some reference to what others are using there is Figure 3. Median and average size of implementation files ("*.c") in st.cs.uni-saarland.de/edu/empirical-se/2006/PDFs/godfrey00.pdf for the Linux kernel.
Apr
24
comment Recommendations for teaching junior programmers good coding style
Yes, absolutely. They need to see and work with good code as well. My answer was meant to be an addition to all the other answers; I do not think that just showing them bad code will be enough.
Apr
6
comment How do you maintain focus when a particular aspect of programming takes 10+ seconds to complete?
Just 30 seconds? Be glad you are not compiling SLOBOL: SLOBOL is best known for the speed, or lack of it, of its compiler. Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to take a trip to Bolivia to pick up the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile.
Feb
23
comment (Why) Should I learn a new programming language?
For anyone not conscious about the HUGE impact language has on thinking, reading about Newspeak in George Orwell's 1984 will be an eye opener, wikilivres.info/wiki/Nineteen_Eighty-Four/….
Dec
2
comment Elegant ways to handle if(if else) else
It is very common to use goto like this. The linux kernel contains a 5-digit number of goto statements.
Nov
30
comment Elegant ways to handle if(if else) else
And another aspect is that the code written this way is orthogonal. For instance the two lines "if(!FileExists(file))\n\tgoto notexists;" are now ONLY related to handling this single error aspect (KISS) and most importantly it does not affect any of the other lines. This answer stackoverflow.com/a/3272062/23118 lists several good reasons to keep code orthogonal.
Nov
30
comment Elegant ways to handle if(if else) else
Yes, Yes! This is the absolutely "right" way to write code. The structure of the code now is "If error, handle error. Normal action. If error, handle error. Normal action" which is exactly like it should be. All the "normal" code is written with just a single level indentation while all the error related code has two levels of indentation. So the normal AND MOST IMPORTANT code gets the most prominent visual place and it is possible to very quicly and easily read the flow sequencially downwards. By all means accept this answer.
Feb
4
comment What are useful metrics for source code?
Ah, excellent. Very nice to have some specific numbers to refer to. Thank you.
Dec
20
comment What are useful metrics for source code?
As far as I remember typical industry numbers are around 2-3 errors per 1000 lines of code for average projects, approaching something like 0.5 errors per 1000 lines of code for nuclear plant control software or NASA projects where they put down an enourmous amount of effort, control, testing, review, etc because failures can have very severe consequenses. Anyone that have some reference to numbers supporting this?
Dec
20
comment What parts of your coding standard contribute to quality code?
Indeed. In my oppinion there are three ways to write code: 1) write unreadable code. 2) write unreadable code and comment it readable. 3) write readable code.
Dec
20
comment Is using ELSE bad programming?
I do not try to avoid else as such, but I think I agree with what you write. The point is that the thing you are testing should be the exception and not the normal case (stackoverflow.com/questions/114342/…). Here authentication failure is the exception and (only) that should be tested.