|
Shouldn't you ask Nagy?
|
|
|
|
|
I'm not going to ask Nagy anything, he might still be upset about the goulasj
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
That is Joels' take.
I rather not see prefixes at all. I can imagine the type, if you're reading from a printout and taking a ... walk, but not "Apps", where different abs got different meanings for each product.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: where different abs got different meanings for each product.
That's the whole point.
|
|
|
|
|
GOTO can be useful and there are moments where it is needed. Misusing it can result in spagetti code I know but...
I would like to see you coding in LAP (PLC) or assembly without JMP instructions...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
That's why I added the second sentence.
|
|
|
|
|
mmmm... ok. I forgive you
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
There's an example in Code Complete (first edition at least) where they provide a code example using Goto. Apparently almost no-one was able to rewrite the code correctly without using Goto.
Kevin
|
|
|
|
|
Jörgen Andersson wrote: D) Use GOTO. so break and return are not to be used?
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
They all become jumps in the end.
Breaks, returns and exits have a quite lower probability of becoming pasta.
|
|
|
|
|
Those are not goto s.
Aside: While simplifying some code this week I removed a switch (that was inside a while ) ... and later realized that I hadn't removed a break that was left over.
I really dislike that break operates on switch -- I hope DMR's harp gives him blisters.
|
|
|
|
|
True - back when I was at university in the late 80's we were taught 'structured programming' and anything that threw you out of an iteration was forbidden, until year two when we were told that there were circumstances where there was not other option.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: anything that threw you out of an iteration was forbidden
But break goes only to the end, not somewhere completely different, it's structured (still prefer to avoid it though).
|
|
|
|
|
I've used GOTO in driver development when it made sense. Generally speaking I don't use it but when it's needed there's nothing wrong with it.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
-- Marcus Brigstocke, British Comedian
|
|
|
|
|
More to the point: I have not seen a GoTo in the wild since VB6 - and even then only for err handling (On Err Goto).
I would seriously doubt that GoTo is a real problem in any .Net shop.
|
|
|
|
|
D) Storing numbers and datetimes as string in database / counfounding a value with its string representation.
E) Not reading the documentation of the objets used in the application.
F) Not checking/validating user inputs.
G) Copy-pasting a code from anywhere on Internet and expecting it to work without having to think about the requirement ; asking someone else to solve the problem when copied code does not behave the exact desired way (without defining the correct behaviour whatsoever).
I never finish anyth
|
|
|
|
|
D.1) Storing "numbers" as integers just because they're called numbers.
(Telephone numbers, social security numbers, etc.)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
So true
I never finish anyth
|
|
|
|
|
|
|
Committing commented-out code. I'm not sure whether it's a misdemeanor or crime though.
|
|
|
|
|
harold aptroot wrote: Committing commented-out code. That's called good practice.
Actually, there have been times when business requirements went back to what they were before and so uncommenting the code was quite simple.
I don't leave commented code in forever though. After a certain amount of time passes, it can go.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
One of the biggest dangers in software development is when code gets into the code base without first going through the human brain.
Un-commenting a block that looks like it shouldn't be commented out is a classic way that this occurs.
|
|
|
|
|
Duncan Edwards Jones wrote: Un-commenting a block that looks like it shouldn't be commented out is a classic way that this occurs. Never heard of someone doing that. If you thought that was what I was suggesting, you misread.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|