Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

steve2470

(37,457 posts)
Mon Dec 24, 2012, 04:41 AM Dec 2012

What Compsci textbooks don't tell you: Real world code sucks

http://www.theregister.co.uk/2012/12/21/financial_software_disasters/

There’s a kind of cognitive dissonance in most people who’ve moved from the academic study of computer science to a job as a real-world software developer. The conflict lies in the fact that, whereas nearly every sample program in every textbook is a perfect and well-thought-out specimen, virtually no software out in the wild is, and this is rarely acknowledged.

To be precise: a tremendous amount of source code written for real applications is not merely less perfect than the simple examples seen in school — it’s outright terrible by any number of measures.

Due to bad design, sloppy or opaque coding practices, non-scalability, and layers of ugly “temporary” patches, it’s often difficult to maintain, harder still to modify or upgrade, painful or impossible for a new person joining the dev team to understand, or (a different kind of problem) slow and inefficient. In short, a mess.

Of course there are many exceptions, but they’re just that: exceptions. In my experience, software is, almost as a rule, bad in one way or another. And lest I be accused of over-generalising: in more than 20 years I’ve done work for maybe a dozen companies, almost all of them in the banking industry and many of them household names.
18 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
What Compsci textbooks don't tell you: Real world code sucks (Original Post) steve2470 Dec 2012 OP
Why do you think The Flying Spaghetti Monster gets so much play nowadays? intaglio Dec 2012 #1
And that crappy software is increasingly being used to control nuclear power plants bananas Dec 2012 #2
Actually there are additional regulations for the control systems of nuclear facilities in the US ProgressiveProfessor Dec 2012 #9
The absolute worst code... ChromeFoundry Dec 2012 #3
Agreed. There's reason why... discntnt_irny_srcsm Dec 2012 #5
I've worked in... discntnt_irny_srcsm Dec 2012 #4
I always try to write good clean well documented code, drm604 Dec 2012 #6
Are you/do you usually work as an employee or as a contractor? n/t discntnt_irny_srcsm Dec 2012 #7
Employee drm604 Dec 2012 #8
I've done both. discntnt_irny_srcsm Dec 2012 #10
Coding standards and code reviews help to a large extent. ManiacJoe Dec 2012 #11
Best reference for good coding jrandom421 Dec 2012 #12
A corollary to Murphy's Law: HuskiesHowls Dec 2012 #13
There are infinate ways to write a program AgingAmerican Jan 2013 #14
Structured coding was supposed to solve that. Then object oriented was supposed to solve that. drm604 Jan 2013 #15
Yeah AgingAmerican Jan 2013 #16
Well, there may be too much spaghetti to do what I said. drm604 Jan 2013 #17
That is exactly what my professors point was AgingAmerican Jan 2013 #18

intaglio

(8,170 posts)
1. Why do you think The Flying Spaghetti Monster gets so much play nowadays?
Mon Dec 24, 2012, 04:56 AM
Dec 2012

The Noodly One is the God/Demon of coding

bananas

(27,509 posts)
2. And that crappy software is increasingly being used to control nuclear power plants
Mon Dec 24, 2012, 10:34 AM
Dec 2012
http://www.democraticunderground.com/?com=view_post&forum=1014&pid=4471

Reply #7
In the discussion thread: Elevator Death Probe Focuses on Computer Replacement [View all]

Response to TexasProgresive (Reply #2)

Fri Dec 16, 2011, 03:08 PM

bananas (19,146 posts)
7. they're starting to to do this with nuclear power plants

View profile
2009: "UK safety regulators assessment of EPR and AP1000: grim reading"
http://www.democraticunderground.com/discuss/duboard.php?az=view_all&address=115x219052

2009: "Regulators call for redesign of Areva's EPR reactor"
http://www.democraticunderground.com/discuss/duboard.php?az=view_all&address=102x4130287

2010: "Safety fears about French Areva EPR raised in Europe and U.S."
http://www.democraticunderground.com/discuss/duboard.php?az=view_all&address=115x254581

2011: "SC's Oconee Nuclear Station to upgrade to digital"
http://www.democraticunderground.com/discuss/duboard.php?az=view_all&address=115x270337

ChromeFoundry

(3,270 posts)
3. The absolute worst code...
Mon Dec 24, 2012, 10:47 AM
Dec 2012

comes from projects that have been offshore outsourced. Most of it is cut-n-paste from Google search results. 95% of it is not scalable. No comments. And 100% riddled with bugs.

discntnt_irny_srcsm

(18,482 posts)
4. I've worked in...
Mon Dec 24, 2012, 11:22 AM
Dec 2012

...heavily regulated industries including FDA medical devices, FAA (military, commercial and private) avionics, military systems including weapons systems and various unregulated commercial fields. The regulated industries are much better but still don't always get it right. Sometimes that's due to thinking in a mostly linear fashion. Sometimes it's due to having requirements phrased poorly. Heavily regulated code is always very costly. In today's numbers regulated code, would average 20 lines per man-week including requirement development, coding, review, verification and QA. An average cost would be around $250 per line, more for some industries (DoD, DoE...) which require a government clearance. However, Dilbert always has his finger on the pulse of software development:



drm604

(16,230 posts)
6. I always try to write good clean well documented code,
Mon Dec 24, 2012, 02:02 PM
Dec 2012

but unfortunately, the bean counters make them hire cheaper (younger or H1b) coders, and they get what they pay for; and I get the shaft.

I recently applied for a job where they gave me some coding problems. I gave them nice clean well documented code with a good intuitive user interface, extensive error checking, and some useful features that they hadn't even asked for. I guarantee you that 90% of their applicants don't give them anything near what I gave them. They loved my code. Then they hired someone else. I can only think that it was based on money.

drm604

(16,230 posts)
8. Employee
Mon Dec 24, 2012, 02:41 PM
Dec 2012

Although often as the employee of a contractor. I really got screwed in my most recent position because of that. I was hired by a contractor to do IT support at a growing corporation. I really cleaned up their IT. I got their equipment inventory in order (at least in better shape than it was), got things running smoothly, reduced the number of support calls, and was uniformly praised for the job I was doing. I was there for 2 1/2 years.

I did my job. I improved things. The company is growing. So I'm in a good secure position, right?

Wrong. The corporation decided they wanted to bring IT in house. They knew about it for months. My employer knew about if for months. Nobody told me. Nobody gave me the opportunity to apply for the job. Nobody gave me a decent amount of time to look for other work. They wanted to make sure they had someone in that seat until they had a replacement. Then, the Monday before Thanksgiving, my boss, who was not usually present at that site, walked into my office, told me that he'd lost the contract, and gave me two weeks notice. Two weeks, when both he and they knew for months. Two weeks, right after Citibank laid off thousands of IT workers. And I had to spend those two weeks teaching the new guy my job.

People who I had worked with for 2 1/2 years, who I considered friends, hid it from me. I was told that they "assumed" that I knew. Sure. And in all of those months it never came up in conversation, even though they "assumed" I knew.

Do I sound bitter?

discntnt_irny_srcsm

(18,482 posts)
10. I've done both.
Mon Dec 24, 2012, 09:05 PM
Dec 2012

I'm currently contracting via my S-corp through a 3rd party. Everyone gets a cut. One place I worked for (process control system for medication manufacturing) doing QA and test work was very grateful when I pointed out that it's not a good thing to allow edits to the database architecture while data in being entered and retrieved. Of course they like my idea to use an Oracle like server to control write access but canned me just the same since the redevelopment with Oracle would take about 6-8 months and in the mean time they didn't need me.

I worked for this one shop for while as W-2 contracted to another client and I had an interest in going direct with the client. It never happened because the shop was greedy and wanted their commission of about $12k on top of the 30% markup they had been collecting for over a year.

bitter?? Of course not.

Have a good holiday.

ManiacJoe

(10,136 posts)
11. Coding standards and code reviews help to a large extent.
Mon Dec 24, 2012, 09:35 PM
Dec 2012

But they don't completely solve the problem.

HuskiesHowls

(711 posts)
13. A corollary to Murphy's Law:
Sat Dec 29, 2012, 10:44 AM
Dec 2012

If builders built the way programmers program, the first woodpecker that came along would destroy civilization.

 

AgingAmerican

(12,958 posts)
14. There are infinate ways to write a program
Tue Jan 1, 2013, 04:19 AM
Jan 2013

I had a professor who worked at MS after college. They put him on the Excel team and the first job he had was to put a feature that had long been buried in menus, on a button. It took him a month. He said that so many people had worked the code over so many years, that every change he made to the code, he had to make it in 50 different places. He said it a flaming mess. Took him a month to do something that should have taken at best a day.

drm604

(16,230 posts)
15. Structured coding was supposed to solve that. Then object oriented was supposed to solve that.
Wed Jan 23, 2013, 06:09 PM
Jan 2013

So what's the next paradigm that will supposedly solve it?

There was nothing wrong with structured coding. There's nothing wrong with object oriented coding. If people use them the way that they're supposed to.

If the functionality of that feature had all been in one place, in one class or one object, then he could have made the changes once, in one place.

In your professor's position, I would have been tempted to yank it all out and rebuild it in one place. You could probably do that in the month it took to make every change in 50 places.

 

AgingAmerican

(12,958 posts)
16. Yeah
Thu Jan 24, 2013, 03:13 AM
Jan 2013

But thats how Microsoft does things. They build on top of ancient code rather than do it right from scratch.

drm604

(16,230 posts)
17. Well, there may be too much spaghetti to do what I said.
Thu Jan 24, 2013, 05:52 AM
Jan 2013

It may be so convoluted that you'd have to totally rewrite the app to clean it up.

 

AgingAmerican

(12,958 posts)
18. That is exactly what my professors point was
Thu Jan 24, 2013, 03:19 PM
Jan 2013

He said the code was an absolute clusterfuck, from a software engineering standpoint.

Latest Discussions»Help & Search»Computer Help and Support»What Compsci textbooks do...