Slashdot Asks: Are You Ashamed of Your Code? (businessinsider.com)
Programmer and teacher Bill Sourour wrote a post last week called "Code I'm Still Ashamed Of," where he recounts a story in which he was hired to write code for a pharmaceutical company. Little did he know at the time, he was being "duped into helping the company skirt drug advertising laws in order to persuade young women to take a particular drug," recaps Business Insider. "He later found out the drug was known to worsen depression and at least one young woman committed suicide while taking it." Sourour was inspired to write the post after viewing a talk by Robert Martin, called "The Future of Programming," who argues that software developers need to figure out how to self-regulate themselves quickly as software becomes increasingly prevalent in many people's lives. Business Insider reports: "Let's decide what it means to be a programmer," Martin says in the video. "Civilization depends on us. Civilization doesn't understand this yet." His point is that in today's world, everything we do like buying things, making a phone call, driving cars, flying in planes, involves software. And dozens of people have already been killed by faulty software in cars, while hundreds of people have been killed from faulty software during air travel. "We are killing people," Martin says. "We did not get into this business to kill people. And this is only getting worse." Martin finished with a fire-and-brimstone call to action in which he warned that one day, some software developer will do something that will cause a disaster that kills tens of thousands of people. But Sourour points out that it's not just about accidentally killing people or deliberately polluting the air. Software has already been used by Wall Street firms to manipulate stock quotes. "This could not happen without some shady code that creates fake orders," Sourour says. We'd like to ask what your thoughts are on Sourour's post and whether or not you've ever had a similar experience. Have you ever felt ashamed of your code?
Yes, but I will never admid it in public. I will defend it till the end how others are wrong.
Don't fight for your country, if your country does not fight for you.
We're waiting for a response.
In civil engineering, when any project is bigger then a certain amount, it's required to have a civil engineer signing the project, responsible for all the stuff. Sometimes I wonder if we need a similar regulation in software. By example: if it's covering something sensible to life, like medical, airport, etc, law should require a software engineer signing the project and responsible for it.
Like on civil engineering, probably this will force software people to really invest in QA (until current days, QA is really, really bad in software).
Hell, no. I ain't ashamed of my code, and if a man says something bad about my code, there's gonna be some blood spilt.
You are welcome on my lawn.
I thought "ashamed of code" would be e.g. using a for loop on a Java Collection rather than an Iterator; or using EJB methods to simply wrap database layer calls, instead of encapsulating business rules (because you see our project uses a 3-tier architecture because someone somewhere read it is a good thing to do); or not doing unit tests.
Writing code to put bread on the table for employers whose business ethics are questionable (or cut corners when it comes to generally accepted good software engineering practices) is to be expected. It's not as if these things are discussed at the hiring interview. And jumping ship at the drop of a hat when these things crop up is seldom practicable - a new round of interviews takes time, so does induction into a new workplace.
We are all prostitutes, either from the neck up or the neck down.
Free, as in your money being freed from the confines of your account.
I've at times had to code up things I haven't been happy with, but rather than refuse to do it, I tried to modularize stuff so it could be fixed later when management changed.
This is, I think, better than refusing, and having someone else code it up. To quote Mordin Solus, "someone else might have gotten it wrong".
(And in at least one occasion, that worked -- for one product I worked on, we managed to safely and quickly kill the "phone home" DRM before it got out into the wild. Felt filthy working on it, felt good to bury it.)
I am ashamed of some of the code that's been written in programming languages I've written
Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.
The last thing programmers need is a power grubbing QA task manager on top of the idiot scrum manager, in addition to whoever else wants to run things. Quality starts with planning and thinking before coding and not rushing code out the door. A better approach would be not allowing non software people the ability to make statements of quality, cost and capability about software, via legal fiat. Let software engineers as individuals sign off on it.
Folks there's a lot less science, predictability and consensus in the legal profession. People need a license to cut hair. If software as a profession isn't to be regulated, neither of those professions should be as well.
I worked (briefly) in a call center where we handled people who had called an 800 number. We asked a series of questions that we read from and filled out on an HTML page.
I suspected something was fishy and looked at the source -- it was exactly like what Bill Sourour had coded -- it didn't matter how people answered, the same non-result in the end.
People thought the number would help them, but it was used to harvest information, nothing else. One of the most screwed up environments I've ever worked in.
I come here for the love
If we're talking about how are code was used, I remember in high school (many moons ago) writing Turbo Pascal programs and Lotus 123 macros for a shipping department of a sizable company that hadn't yet computerized. I was brought in by the manager of the shipping department because he could hire a high-schooler when he couldn't get authorization to computerize from within the internal IT department (which was busy sinking the company with some massively expensive software controlling the manufacturing).
Anyway, I was very proud of allowing my boss to get all the data that he wanted, and he was very, very pleased that his department now had some means of seeing what was going on.
I distinctly remember when he called me in and thanked me. Due to my program, he'd had enough data to improve efficiency 25%!
I glowed.
Now he'd been able to let go 2 out of the 8 drivers they had.
I stood there speechless.
There were real people underneath those numbers.
It points out a real problem, and I'm glad the author has the conscience to care and to promote change. But I wonder what can effectively be done. In the average corporate environment, senior programmers are typically read in on the business details only on a need-to-know basis. Low-level code slingers usually don't get told jack. It's pretty difficult to act according to one's conscience given such a dearth of information. And if you demand more information - well, there's always someone waiting to take your job who'll just shut up and code.
The video linked in TFS points out that civilization depends on programmers. For a century or more, it has also depended on engineers; yet we still have Volkswagen-like scandals, not to mention all the mostly-unnoticed little day-to-day ethical compromises made by engineering staff in the name of business. It seems to me that the only solution is for designers and implementers to have a say equal to that of bean-counters, PHB's, and investors. And in our current world-wide corporotocracy, that simply isn't going to happen - at least not in the absence of bloody revolution.
'The Economy' is a giant Ponzi scheme whose most pitiable suckers are the youngest among us and the yet-unborn.
I've seen some shady things, and it was ALWAYS in a setting full of people too junior to ask questions. Junior people are sometimes naive, and will believe management when told that certain shady things are normal. Junior people may have no resume to speak of and are basically forced to look good at their first real job. Junior people may not be able to afford to quit without having something else lined up, and don't want to be marked as job-hoppers. Senior people have the marketability to leave, and the experience to see through BS. They may also have enough savings to quit out of principle and take a sabbatical, or the ability to shift gears to their side business. I don't really know how to solve the problem, given that young adults need to eat regardless of their ethics. I do know that the problem is hardly contained to computing. Maybe we gravitate to this field because we love logic, but the rest of the world isn't logical. We still have to deal with human nature in this field too.
Doesn't this describe almost every job?
I mean, I generally agree with the article. But the article seems a little... self-aggrandising, doesn't it? As if to say "hey, we're just as important as doctors and engineers!"
The thing is... I kinda agree - programmers are very important and their actions can have serious consequences if done poorly or incorrectly. But like... plenty of other jobs are just like that too.
If the person stocking the shelves at your local grocery store doesn't clear out the expired stock, or maintain proper hygiene around fresh food, they could easily contribute to someone getting sick or spreading bacteria or a virus.
If the person selling gear at a bicycle store doesn't realize the wheel or frame is broken, or that a frame has been recalled due to a defect, they could easily contribute to someone being seriously injured.
If a school teacher ignores serious bullying or doesn't fact check the information they're teaching or doesn't make sure their students properly know how to do proper calculations, they could easily contribute to a serious mistake made by the student some time in the future.
If a salesperson helps someone get a loan approved when they've very much shown in all likelihood that they probably can't afford the monthly payments or that the loan is predatory in nature, they could easily contribute to that person's life taking a serious financial turn for the worse - and we all know how stressful and desperate people can get when they can't make ends meet.
Yes, programmers need to be aware of their moral compass - but so does everybody else to varying levels, pretty much. Generally speaking, just - don't be a dick, don't be apathetic and use some common sense. That'd go a long way for pretty much anybody in any situation.
I avoid shame by making sure my code does not work and is not seen by anyone else.
I also saw Robert Martin's talk, and generally agreed with it. I am generally surprised (and disappointed) at how insensitive and irresponsible colleagues are. At the end of the day, most just want their salaries in their bank accounts, and keep their jobs. Software engineers appear to be just like everyone else. So I agree with Martin that laws are badly needed.. to root out the cowboy/hacker attitude for this coming century. On the subject of Martin's talk, I actually bought his book "Clean Code" as a result of seeing his talk. Robert should be ashamed of his book though.. if it's to be an example of the self-regulating quality consciousness he's talking about, the book is the opposite (it lacks writing discipline, among many other qualities).
That escalated quickly. I assumed they were talking about how ashamed I am about that spaghetti code I wrote for my client last week, not killing people.
Popisms.com - Connecting pop culture
Some people might set out to write software that is ONLY usable for malevolent purposes - and they could be fully aware of this when they do the job and deliver the result. Just like some people will work in cigarette factories. Or design more "efficient" land mines.
However, the vast majority of software that is used for evil can also be used for good. Take GPS for example. It can be used to guide ambulances to accident victims and it can be used to guide missiles to their targets (it can also be used to make those missiles more accurate thereby reducing collateral damage - go figure).
Is the person who invented the for() loop responsible for all the unknown uses it is put to? Is the team that fixes a bug in car's firmware responsible for saving lives? These are unknowable points. The best that programmers (and testers and designers) can do is to produce high quality work, that fits within their ethical framework. Then sleep easy at night.
politicians are like babies' nappies: they should both be changed regularly and for the same reasons
I always wonder what the hell those people do when I'm gone.
They will be fine. They were just looking for the easiest and most simple path to get an answer. It was you. Without you they will use a little less simple path. They may even Google the answer! Hell, they might even learn something.
In general, people who seek help are neither as helpless nor stupid as they appear to be.
The very nature and absolutely empowering thing about software is that it is flexible. It's purpose abstracted from the machine that fulfills the purpose. It doesn't get any more awesome than that. That's why we are gods in our own little world of the systems we work on and that's why we love tinkering with and building software.
That's the whole point of it.
So when I dig up my old EDI connector/serial processing ERP software I wrote 14 years ago in Python I don't think "OMG! What was I thinking? This abstaction is non-existant and if it is it's abysmal!". I think about the other things: How I wrote the filters for Amazon Marketplace before they even had an open API. How chains of regexes filtered the competitors pricing and how another script adjusted ours one cent cheaper than the cheapest offering of our competitors. How orders went from 15 to 120 the day we started using those scripts. How we were adjusting to changes in amazons websites on a daily basis, and how we built a billing system with Python, RTF Templates and an cli-automated Open Office.
If you look at that code today without context you'd think it's some bizar experiment or something. But it pushed our revenue back then from 20 000 Euros to 480 000 Euros.
Same goes for the very first Flash video and multimedia streaming client that I built. The code looks a mess and the player works very strangely. But we had to find out the hard way that you have to render your objects off screen in order to force the flashplayer from back then to actually load them. Likewise, if you call an XML object in Flash 4 / ActionScript 2 without instancing it, the Internet Explorer would reference the file on the far server, reloading it every time and causing traffic to skyrocket from 40kb to 3MB (Note: This was before DSL and when 68kbit ISDN was avantgarde for internet access.) ... That's why that piece of code makes an 'unnecessary' copy of that XML object and deletes the old one.
Likewise today, using WordPress, I see abysmal software architecture in the whole way WP is built. But not for a moment do I delude myself and think this could've been done from the very beginning. WP is historically grown and design decisions made back then might have had very good reasons, even from a software architects perspective.
So, long story short, I'm not really ashamed of my code. At all.
I know where it came from and what it did and why.
We suffer more in our imagination than in reality. - Seneca
If they wanted quality code, they should have paid for the time to create it correctly in the first place.
Since nobody wants to pay for quality code, then they get exactly what they paid for. Something that gets assembled as quickly as possible to maximize the return on investment.
If you don't have at least one project you have worked on that you aren't proud of you probably aren't a programmer.
Mine is a steaming turd of a purchase order request "system". Written in VBS inside of Excel, talking to a MySQL database back end.
It's not pretty. It's not fast. It's not sustainable. But, it met the purpose of the request using the tools I had available to me. And it was better than what they were using at the time. 5 project managers all writing purchase orders, or not, off of their local computers. Most of the time the PO wouldn't get to the Accounts Payable person, and if they did it was usually a hard copy. There were no backups. Nobody knew how the database worked. Nobody knew how to re-install it, or where the source for it was. Many many dollars lost.
I would have never imagined they would still be using that system, this was 8 or 9 years ago. I have a feeling that's how most of these embarrassments work, a fast and messy fix to an immediate problem that will be "replaced eventually" that never gets touched again.
imagine spending millions on infrastructure to make the traffic worse and accidents more likely?
I suspect that was the design intent. There must be sadists working in the Highway Administration. These designs (including I-270, I-495, and local roads) could not have been achieved by mere incompetence.
I am both a civil engineer and software "engineer." I have also visited Maryland. I can confirm that (a) civil engineers suck (despite the fact that civil engineering is often much less complex than software engineering), (b) Maryland's freeway design is weird (lots of super-tight parclos with really short merges), and (c) calling programmers "engineers" is a complete farce because compared to actual engineering, all coding is "cowboy coding." I don't care if you're "agile" or "waterfall" or how good your code review or QA is; the process is not rigorous enough to count as engineering.
Ironically, some of the worst cowboy coders I've worked with have been Professional Engineers...
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
If one has an insurmountable ethical issue with what they are developing for an employer, the only viable recourses are to find an alternative employer or to become self-employed.
File under 'M' for 'Manic ranting'
Well, I learned what a 'parclo' was, so thank you.
Writing software is like building atop unstable ground and never finding bedrock. Even well written code is unable to entirely isolate itself from the stability issues of its platform with any level of assurance. Software cannot be relied upon absolutely. So while I agree with you that calling coders engineers is wrong, it's probably for a different reason than bad code.
HBI's Law: Frequency of calling others Nazis is directly correlated with the likelihood of the accuser being Communist.
The Reasonable question: Are you ashamed of your code's efficiency, documentation, clarity and reasonable brevity?
Unreasonable Question: Are you ashamed of your code because of some stupid SJW viewpoint?
When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
And dozens of people have already been killed by faulty software in cars, while hundreds of people have been killed from faulty software during air travel.
... the number of suicides by those early users of /. Beta may never be known ...
It must have been something you assimilated. . . .
Really lousy programmers can often otherwise be surprisingly knowledgeable in programming theory. I think it takes a certain type of person to be able to turn that high level theory plus program requirements into actual working code, all using a minimal amount of effort. The guy sounded like he believed every piece of code must belong to one of those patterns, or it wasn't fit to be published.
One of the more valuable things I learned after I had already considered myself a reasonably competent programmer was how to avoid the tendency to over-engineer things (yes, a lot of us have the gang of four patterns book). There are times you don't need three classes and two abstraction layers when a simple one-off function will do. I think there's a real art in deciding how complicated to make your solution in the guise of making them future-proof, or alternatively, when to just keep things *simple*.
Irony: Agile development has too much intertia to be abandoned now.
The guy we hired to replace him wrote it from the ground up in a month.
... a nightmare to come.
You smell that? Do you smell that? Technical debt, son. Nothing else in the world smells like that. I love the smell of technical debt in the morning. You know one time we had a code sprint, for 4 weeks. When it was all over I code reviewed. We didn't find one of 'em, not one stinkin' bug. The smell, you know that stale pizza smell, the whole room. Smelled like
- Software Architect Bill Kilgore
Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato