Coding standards?
-
Ditto....That's alright, exceptions are lame anyway. ;) Thanks, Marcus
marcus78 wrote: Ditto....That's alright, exceptions are lame anyway. Ditto 2 Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
It's really sad that there are so many people claiming to be software engineers, when all they engineer are poorly constructed designs and badly written code. Imho, unaware and undereducated managers shoulder a lot of the blame for this unhappy state of affairs. I think things will change only when the software development industry is held accountable like other industries such as makers of airplanes, toasters and water heaters. /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com
Ravi Bhavnani wrote: I think things will change only when the software development industry is held accountable like other industries such as makers of airplanes, toasters and water heaters. I agree with you but I really do have to wonder whether my toaster manufacture can be held accountable. About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. Every time it happens I stand their jaw dropped wondering how in this day and age such a thing is possible.:confused: Neville Franks, Author of ED for Windows. www.getsoft.com
-
Ravi Bhavnani wrote: I think things will change only when the software development industry is held accountable like other industries such as makers of airplanes, toasters and water heaters. I agree with you but I really do have to wonder whether my toaster manufacture can be held accountable. About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. Every time it happens I stand their jaw dropped wondering how in this day and age such a thing is possible.:confused: Neville Franks, Author of ED for Windows. www.getsoft.com
Neville Franks wrote: About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. Really? That's so cool. Can you get some MPEG footage of this? I'm more than happy to post it on CodeProject purely for the giggle factor. cheers, Chris Maunder
-
I can't believe my eyes. I was looking over some code we were supposed to port for use in a W2K COM project. I found the previous authors had created about 800 lines of macros, divided into about 25+ header files (some with just one line). Their implementation was basically nothing more than calling these macros. No exception handling, code formatted with no regard to tabs, 30-40 blank lines in the middle of a routine. What gets even worse is the lead developer for this project thinks this is the best they can produce. Makes me glad to be a consultant. One, I'll always have work fixing their work, and two I can leave when the axe begins to fall.;P
I guess it's always the case that the other peoples code doesn't look the way we would expect it to. I am not sure about the macros and exceptions problem because it often depends on the problem and implementation and it might be justified. However the bad formatting of the code is quite bad. The 30-40 blank lines is really bad. If I was a manager and some of my people would produce blank lines like that I would simply fire the guy on the spot. People who do not take a second to review their code and leave mess behind are only to cause the troubles in the (near) future. People who review their code and think that's OK are not worthy to keep either. In my office the main problem I notice is a lot of copy-paste that leads to a huge multiplicated chunks of code that is a nightmare to maintain. I blame it for the company's policy to code fast and without proper design - that always forces people to take shortcuts to make job done fast.
-
Funny you should mention that. Altough I understand the concepts, I really have never been able to implement anything I was satisfied with. Do you know of any good reading material on some good exception handling techniques? Thanks, Marcus
Do you know of any good reading material on some good exception handling techniques? Exceptional C++ - http://www.gotw.ca/publications/xc++.htm More Exceptional C++ - http://www.gotw.ca/publications/mxc++.htm - Wilka
-
:eek: :eek: :eek: Until I started working on a debugging tool this week, I've written one macro ( mid, to return a value clamped between two values ). Macros are evil, in fact Stroustrup says they are usually indicative of bad design. He must have consulted there before you did. :-) Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
****Christian Graus wrote: Macros are evil I disagree. I use them often in code where, if it weren't for speed considerations, i'd use a small subroutine. yes, i could use an inline function, but as i see it, aside from type checking (which isn't really required in the sections of code i'm talking about), inlines and macros are identical. ****Christian Graus wrote: Stroustrup says they are usually indicative of bad design that's quite a broad statement from someone who probably hasn't written every possible program under every possible constraint. :) -c
-
Ravi Bhavnani wrote: I think things will change only when the software development industry is held accountable like other industries such as makers of airplanes, toasters and water heaters. I agree with you but I really do have to wonder whether my toaster manufacture can be held accountable. About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. Every time it happens I stand their jaw dropped wondering how in this day and age such a thing is possible.:confused: Neville Franks, Author of ED for Windows. www.getsoft.com
Neville, In the US, we have a non-profit watchdog organization (Consumer's Union) that publishes a monthly magazine (Consumer's Report) in which they review household kitchen appliances, among other things. The magazine accepts no advertising and has been partially responsible for exposing the truth about the Suzuki Samurai in the '80s. I think your errant toaster would make it to the magazine if you wrote to them and it was sold in the US. PS: Ed looks very cool! /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com
-
****Christian Graus wrote: Macros are evil I disagree. I use them often in code where, if it weren't for speed considerations, i'd use a small subroutine. yes, i could use an inline function, but as i see it, aside from type checking (which isn't really required in the sections of code i'm talking about), inlines and macros are identical. ****Christian Graus wrote: Stroustrup says they are usually indicative of bad design that's quite a broad statement from someone who probably hasn't written every possible program under every possible constraint. :) -c
Chris Losinger wrote: I use them often in code where, if it weren't for speed considerations, i'd use a small subroutine. Before yesterday I had a couple I used, I suspect in similar circumstances to you, when I need a small routine inside a loop iterating over an image's bits. I've had to write several over the past day, because of the nature of the code I am working on. I still believe they are an option to only use after careful consideration of available options. Chris Losinger wrote: that's quite a broad statement from someone who probably hasn't written every possible program under every possible constraint. I'm not sure why you're discounting the fact that he has had to consider the broadness of uses for C++ when he designed it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Chris Losinger wrote: I use them often in code where, if it weren't for speed considerations, i'd use a small subroutine. Before yesterday I had a couple I used, I suspect in similar circumstances to you, when I need a small routine inside a loop iterating over an image's bits. I've had to write several over the past day, because of the nature of the code I am working on. I still believe they are an option to only use after careful consideration of available options. Chris Losinger wrote: that's quite a broad statement from someone who probably hasn't written every possible program under every possible constraint. I'm not sure why you're discounting the fact that he has had to consider the broadness of uses for C++ when he designed it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
****Christian Graus wrote: I'm not sure why you're discounting the fact that he has had to consider the broadness of uses for C++ when he designed it. because i discount most statements that are as broad as that one :). IMO, macros are no more dangerous than pointers, virtual functions, gotos or any other C++ concept. they are all perfectly valid and useful when used appropriately. -c
-
I also find it hard to believe some of this code was written by someone with 10+ years experience and a Master's Degree. You can lead a horse to university, but you can't educate him. :)
When he got the degree, were the computers still made with vacuum tubes?
-
Ravi Bhavnani wrote: I think things will change only when the software development industry is held accountable like other industries such as makers of airplanes, toasters and water heaters. I agree with you but I really do have to wonder whether my toaster manufacture can be held accountable. About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. Every time it happens I stand their jaw dropped wondering how in this day and age such a thing is possible.:confused: Neville Franks, Author of ED for Windows. www.getsoft.com
Neville Franks wrote: About 6.53 times out of 10 the toast pops out so vigourously that it lands on the floor. I had one like that! After a time, I ceased thinking of its ballistic payload as toast and began viewing it as skeet for my BB gun. Great entertainment until a BB fell into the launcher, shorting the heating wires... Ah, sweet bedlam:-)
-
****Christian Graus wrote: I'm not sure why you're discounting the fact that he has had to consider the broadness of uses for C++ when he designed it. because i discount most statements that are as broad as that one :). IMO, macros are no more dangerous than pointers, virtual functions, gotos or any other C++ concept. they are all perfectly valid and useful when used appropriately. -c
Chris Losinger wrote: IMO, macros are no more dangerous than pointers, virtual functions, gotos or any other C++ concept. they are all perfectly valid and useful when used appropriately. That's probably true, pointers are obviously also dangerous if misused. But goto - that's just the Devil you're talking about. I use macros sparingly, pointers often, and goto not one in my entire time of using C++. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Chris Losinger wrote: IMO, macros are no more dangerous than pointers, virtual functions, gotos or any other C++ concept. they are all perfectly valid and useful when used appropriately. That's probably true, pointers are obviously also dangerous if misused. But goto - that's just the Devil you're talking about. I use macros sparingly, pointers often, and goto not one in my entire time of using C++. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
****Christian Graus wrote: But goto - that's just the Devil you're talking about. I use [...] goto not one in my entire time of using C++. there is power and a kind of sinister clarity in the directness and forcefullness of GoTo. give in to the dark pleasure of goto! do not be afraid. fear is for those who do not understand. -c