Ask Slashdot: What Are Some Lies Programmers Tell Themselves? 548
snydeq writes: "Confidence in our power over machines also makes us guilty of hoping to bend reality to our code," writes Peter Wayner, in a discussion of nine lies programmers tell themselves about their code. "Of course, many problems stem from assumptions we programmers make that simply aren't correct. They're usually sort of true some of the time, but that's not the same as being true all of the time. As Mark Twain supposedly said, 'It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so.'"
The nine lies Wayner mentions in his discussion include: "Questions have one answer," "Null is acceptable," "Human relationships can be codified," "'Unicode' stands for universal communication," "Numbers are accurate," "Human language is consistent," "Time is consistent," "Files are consistent," and "We're in control." Can you think of any other lies programmers tell themselves?
Lies? (Score:2, Funny)
"Good programming discussion is found at /." (Score:2, Insightful)
"Good programming discussion is found at Slashdot"
Re: (Score:3)
Who believes that?
Re: "Good programming discussion is found at /." (Score:5, Insightful)
The main one: 'I'll fix that later'
Re: "Good programming discussion is found at /." (Score:5, Insightful)
This is what I was going to say. You see it ALL THE TIME.
Your boss is NOT going to let you go back and clean stuff up later unless there's an imminent business need to do so. Do it right the first time. Don't commit sloppy code.
The only time it's ever acceptable to tell yourself this is on a personal project, and only if you have the discipline to make it be true.
Re: "Good programming discussion is found at /." (Score:5, Insightful)
Often found in close proximity: "Hmm, it's not *that* bad".
Re: "Good programming discussion is found at /." (Score:4, Insightful)
Often found in close proximity: "Hmm, it's not *that* bad".
Or "This is how I/we have always done it".
Duplication of the same bad code over and over again is the sign of inept programmers. ... and hundreds of other examples of things programmers do over and over again. It compiles, it runs, so it must be okay? What's my next task?
Passing enormous structures as a stack arguments might work fine the first time or even the fifth. But sooner or later it will blow up.
Empty try/catch blocks might work well when there isn't anything that needs catching, but sooner or later, there will be.
Eschewing "this.", using generic names, and letting the compiler handle it might work well now, until someone else makes a change somewhere else.
Oversizing arrays and always having an off-by-one that ensures overrun if the array ever were to get full will work as long as the array never gets full. But one day it will.
Not providing a default case because you "know" a variable can only be one of N things create code that works. Now, that is.
Writing unittests that rubberstamps the exact code you wrote and not what it's meant to do will give you a pass for code coverage. But it is a waste of time.
Re:Lies? (Score:5, Informative)
"I am worth what they pay me."
"I am an engineer."
"Users wish they knew who created this wonderful software."
Re:Lies? (Score:5, Insightful)
Re:Lies? (Score:5, Insightful)
Number one lie:
"Yes, this program/module/milestone will be completed on schedule. "
Re:Lies? (Score:5, Interesting)
Where do you draw the line on being an engineer? Seems like a good topic for a discussion.
I think of myself as an engineer, but then again I work at a pretty low level (C/assembler, no OS) and do hardware design too (design, schematic capture, PCB layout). I engineer whole systems, engineer firmware from the ground up.
The desktop guys... Well, some of the stuff they do is just plugging modules together. But they also build stuff, like web platforms, and have to know how to assemble the modules and write all the glue code. Maybe it's not so different from when I use chips made by other people, rather than building op-amps and microcontrollers out of transistors.
What makes an engineer in the US? (Score:3, Interesting)
In the US, if you want to be a mechanical, or civil, or electrical, or plumbing engineer, these are the rules you generally have to follow.
- you go to school and eventually graduate
- you may have to serve as an apprentice (in my state, electricians serve a 5 year apprenticeship)
- you take an exam that's created and run by the state government in which you want to practice (not by a vendor)
- if you pass the exam, then you ask the state, not the vendor, for a license (probably some money involved here too)
Re: (Score:3)
On the other hand, even without a government seal of approval, there are highly-skilled programmers in the world who have written lots of important and well-respected code that runs critical systems and does it very well. These are clearly worth of the name software engineer. The same applies to certain people who do software architecture, and deserve the label software architect.
So it's not that software engineering doesn't exist, or isn't a valid title, the only issue is that there's no defined standard
Re: (Score:3)
An electrician and an electrical engineer are rather different.
Global? Ha. If you have a professional license it's good in one state. Other states _may_ provide reciprocity, or they may not. If the state you want to move to requires that your education took a slightly differen
Re: (Score:3)
Interesting way of defining it. For me I certainly do have to consider the physical world, even when writing firmware code. For desktop... Well, we mock patents that are just something that happens in the real world by "on a computer", so maybe building virtual stuff counts too.
Re: (Score:3)
Why would this be a lie? [...] Even when I was junior I was earning the equivalent of about $60,000 USD, but the development I was doing with very little input from anyone else was directly pulling in over half a million USD in sales.
I highlighted the lie he was talking about in your statement. If there was really very little input from anyone else, you really should have went into business for yourself and made that half million dollars directly. But my guess is your work required your company's existing products/services, clients, marketing, client services, business processes, etc to make that $500k. You might not have needed many people on your team, but there was still a huge infrastructure put in place by your employer to attain t
Re:Lies? (Score:5, Insightful)
"I'll clean up this code later."
Re:Lies? (Score:5, Insightful)
Re:Lies? (Score:5, Funny)
"I'll have sex later."
Re: (Score:3)
Re:"Rust will replace C++" (Score:5, Funny)
"Java is fast"
Re:"Rust will replace C++" (Score:5, Insightful)
If the customer asked for it, that must be exactly what they want.
Re: (Score:3)
*Doffs Colander*
Re: (Score:3)
"Java is fast"
What is generally not a lie, though, is "Java is fast enough".
Re:"Rust will replace C++" (Score:5, Insightful)
My job can't be replaced by artificial intelligence.
But ... but ... but ... (Score:4, Interesting)
Oh.
I get it.
That means I'm not a programmer.
I'll document it tomorrow (Score:5, Insightful)
Re:I'll document it tomorrow (Score:5, Insightful)
and "anybody can understand this by just looking at it, it doesn't need to be explained."
Re:I'll document it tomorrow (Score:4, Insightful)
That old code of mine is unintelligible rubbish. Thankfully I'm a much better programmer now, so this new code will be a monument of pure, self-evident brilliance.
Re: (Score:3, Insightful)
Re: (Score:3)
"Searching for another job just to invite my employer into a bidding war over my salary is an asshole thing to do."
It's not an asshole thing to do, it's a stupid thing to do. If you pull it off, you'll be gone within a year. If you don't pull it off, you'll still be gone within a year.
Search for another job to find a new employer who is willing to pay you more for leaving your old job and starting with them.
"I've done enough testing" (Score:5, Insightful)
or even "My code is correct, so I don't need to test."
Re: "I've done enough testing" (Score:3)
Along the same lines, "It was just a minor change, I don't need to test it."
Seriously? (Score:5, Insightful)
I'm just a hobby programmer but... (Score:5, Funny)
Re: (Score:3)
Sounds more like the message is unintelligible because it's being used by retarded morons.
It will be finished next week (Score:3)
"I can make that deadline ..." (Score:2)
Most coders (Score:5, Insightful)
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
Better than the average programmer but still like warranties that guarantee nothing. It's like the warranties that programmers like, kind of prove how they are all equally bad.
Re: (Score:3)
"1) The overwhelming majority of the time, the programmer is not in control of key aspects of the development process, all of which cause bugs. Examples include determining the deadlines (rushed code = buggy code), determining the required hours (overworked programmer = buggy code), determining the right amount of QA resources (too little investment in QA = buggy code), and enforcing requirement stability (changing requirements during development = buggy code)."
And that's they lie developers tell to themsel
Re: (Score:2)
A = set of all programmers. |A| = 100%
W = set of programmers that are worse than average. |W| = 50%
B = set of all programmers that believe they are better than average. |B| = ?%
(W intersect B) is a subset of W and therefore |W intersect B| <= |W|
Even if every programmer thinks they are better than average (|B| is 100%) then only half of programmers are lying (not most) to themselves.
I, however, 100% agree with this sentiment. From my experience, I would guess that |
Re: (Score:2)
This is also not mathematically true. You are assuming an even and symmetrical distribution of "better than average" and "worse than average" programmers, but the term "average" doesn't necessarily equal the median.
If you have a number of exceptionally-good programmers, but few exceptionally-bad programmers, the average will be raised to where over 50% of your programmer population is actually qualified as "below average", regardless of their opinions about their skill.
However, we must consider the dynamics
The best in town learn from the best in the world (Score:5, Insightful)
I've discussed the Linux RAID code with Neil Brown, who wrote most of it. That conversation made me keenly aware that my grasp of Linux storage it is rather pitiful.
I've discussed proposals for new internet protocols with Vint Cerf, known as "the father of the internet". I was reminded I'm the big fish only in a very, very small pond.
A few weeks ago someone at work asked for "a Perl guru". Just that morning I had participated in the Slashdot discussion with Larry Wall - a fresh reminder of who is a Perl guru and who isn't.
My co-worker read something about Linux on Stackoverflow, and he knew as much as other people posting to that question knew - he felt like an expert.
A co-worker once used "telnet 25" to do smtp. Nobody else he knows does that, so he's an expert.
My own experience is that the more I learn, the more I am exposed to actual experts, the more I discover that there are many people much more knowledgeable than I. If I think I'm really good, that actually just means I *might* be better, in some ways, than the people I talk to - thinking I'm good just means I'm failing to learn from people who are better.
I strongly suspect those who are humble are the people who read the work of Knuth, T'so, Engelschall, etc - the really programmers know they aren't the best.
So is Poettering, and me, and a million others (Score:5, Insightful)
> I am the best developer for my domain.
For an sufficiently narrowly defined domain, so am I. Then again, so is Lennart Poettering.
Eric S. Raymond is a far more accomplished developer than I am. It is good for me to remember there are many, many far more accomplished, and many who are just plain more knowledgeable all around.
I happen to be, or once was, the best in the world at protecting paid web sites from unauthorized access. I was a longtime member of many cracker forums, and got a certain amount of respect because I had been around for many years and knew the ins and outs of the various security systems. Little did they know I was a spy, that the most senior member of their community was there to surveil them and feed them misinformation. So I was the best at my particular speciality, but plenty of people are better than me in much larger, more general domains. Being the best at one very specific thing doesn't make me good, it makes not versatile.
Re:Most coders (Score:4, Insightful)
W = set of programmers that are worse than average. |W| = 50%
Says who? As an example of a situation where 99% are above average: Most people have two arms. Some are unlucky and have one or none. The average number of arms is maybe 1.99. More than 99% of humans have more than the average number of arms.
Re: (Score:3)
The majority of coders can actually be better than the mean (average) coder. The median coder, though...
If the number of coders is odd, then less than half the coders are better than the median. And less than half are less good than the median. And at least one is exactly as good as the median.
If the number of coders is even, then at most half are better than the median.
That Slashdot is still worth reading. (Score:2)
His numbers may be accurate, but his English? (Score:2)
It's "the Sierra". Singular.
It compiles... (Score:5, Funny)
Re:It compiles... (Score:4, Funny)
"I don't need any unit tests." (Score:2)
Seems obvious. (Score:5, Interesting)
"The code is self-documenting!"
Delphi will make a comeback. (Score:2)
I tell myself that all the time.
Re: (Score:3)
I tell myself that all the time.
"I would kill you but then I'd have to fix your shit"
What I tell our (only) Delphi programmer at work
Re: (Score:2)
I'll add the documentation (Score:2)
as soon as I get this working.
Deus Ex Scriptus (Score:2)
One day, a Slashdot /Soylent/The Inquirer article will point me to silver bullet tech that'll make all this wasted time worthwhile.
Unit Tests (Score:4, Interesting)
All units pass. Who needs integration tests/functionality tests/load tests?
or... (Score:3)
Fortran is a dead language.
Lies (Score:5, Informative)
"That error condition will never happen because I trap for it."
"No one will ever put that kind of stuff into this form field."
"No customer will ever need more than X number of records for $DATA_ITEM." (kids names, addresses, cars, phone numbers, etc etc etc)"
"TLD extensions will never be longer than X number of characters."
"I can positively validate an email address with my home-grown code."
"No one has a one-letter name." ...and on and on and on....
The smartypants fallacy (Score:5, Insightful)
Biggest Lie: We know better (Score:2)
than the people paying for it.
Ultimately software is supposed to solve a real world problem. Its a means not an end. If you focus on writing the greatest, most stable software of all time and the company goes bankrupt around you because you never released and you feel it doesn't reflect badly on you - after all your code was perfect- than you are lying to yourself.
I will clean up later (Score:2)
... not just for code.
Someone will read the manual (Score:2)
I have honestly sent out software with a 1 page manual and have someone ring me up about a question that is answered in bold at the top of the page.
It's not my fault. (Score:5, Insightful)
Order of blame;
1.) The error is in the hardware.
2.) The error is in the library routine.
3.) The error is in my code.
Order of probability;
1.) The error is in my code.
2.) The error is in the library routine.
3.) The error is in the hardware.
Re: (Score:3)
Order of probability; 1.) The error is in my code. 2.) The error is in the library routine. 3.) The error is in the hardware.
This is exactly why errors in library routines and hardware tick us off so much. Its the next best thing to being betrayed.
I can get that done by... (Score:3)
I can get that done by <any duration>.
Time, Names, Murphy's Computer Laws (Score:4, Informative)
These should be required reading for programmers AND designers. I'm looking at you Mr. shitty designer/programmer that only lets me put 13 characters in for my (first) name.
* Falsehoods about Names [kalzumeus.com]
* Falsehoods about Time [infiniteundo.com]
* Falsehoods about Computers [imgur.com], aka, Murphy's Computers Laws
* 97 Things Every Programmer should know [oreilly.com]
My gripes with the first 2 (Score:2)
"Null is acceptable"
Yes null is problematic. What's the solution? Some languages (like java) allow you to use notnull annotations, etc, but what do you do when something went wrong in a function and you don't have an object to return? Sometimes you can just abort (I'd rather have a nice core dump than a messy memory bug), but this is not always appropriate. You can use exceptions, but exceptions come with their own problems that are worse than NULL pointers in many cases. So I would say NULL is accept
Re: (Score:3)
For a given function, null return either has a meaning or it does not. "Something went wrong" is not a good enough reason to return null, unless your function documentation says what might go wrong and what that null therefore means.
If null has no meaning then make it a notnull return, or in Swift a non-optional.
I used to work with a programmer that used to make all returns optional "just in case". I wanted to punch him.
"There are jobs for programmers." (Score:4, Informative)
All throughout school, everyone told me there are jobs for programmers. Everyone lied. I have multiple advanced degrees in computer science. I have started open source projects. I have contributed to open source projects. I debug software for fun. I live and breathe code. And yet, I have no job, and I have no prospects. I apply for jobs, and nothing happens. In my experience, all job listings are lies, and there aren't any jobs out there. There's absolutely nothing at all.
I'll fix that later (Score:2)
No. No you won't.
Just a quick fix? (Score:5, Insightful)
It's just a quick fix - that'll only take 10 minutes.
Be open minded (Score:5, Funny)
"If something seems stupid to me, it is, because I am definitely smart."
Example:
"Smart pointers are stupid. I know how to manage memory, and anyone who can't have zero memory leaks directly using malloc and free shouldn't be coding anyway."
Re: (Score:3)
Programmer lies: (Score:3)
1. I can have this done by the deadline
2. Oh, it's a simple change, just commit it.
3. I can adapt another routine, it'll cut the programming time
4. Your code sucks
5. My code shines
6. Don't bother with that use case, it'll never come up.
7. Our users wouldn't be that stupid.
8. Our users wouldn't be that smart.
9. It's completely debugged.
11. There are no errors in this top 10 list.
I work for a good company (Score:2)
Coding is a profession with a long term future (Score:3)
demo code (Score:4, Insightful)
"Don't worry. This will be used only as a demo/proof of concept and never in production".
Actually that's a lie told to me by the management and I tend to believe it up to the date when the demo happens.
My current situation (Score:3)
"I fully understand the problem"
later (Score:3)
The most often told and most consequential lie that programmers constantly tell themselves is this one:
I'll fix this later.
Usually... (Score:3)
I will document that piece of code later so that I remember why it does what it does.
Documentation (Score:3)
MM/DD/YYYY (Score:5, Insightful)
This will take 10 minutes. (Score:3)
Well, 10 minutes after the upgrades, the install of the new service, the hard reset of the router, the changes to the firewall ... ... this month.
Currently only had one 10 minute job that's hit the day 3 mark
null? (Score:3)
Whats the deal with nulls?
While I can attest to the accuracy of the other 8/9 issues causing extended bouts of hair-pulling stress, I've never found nulls be problematic.
I mean, sure they have been a source of errors while developing, but dealing with them is just as aspect of dealing with function boundry conditions, and whether you do it via bools, nulls, exceptions or whatever, it has to be done.
Re:So topical (Score:4, Informative)
You meant, of course, discrimination FOR women:
http://www.news.cornell.edu/stories/2015/04/women-preferred-21-over-men-stem-faculty-positions
Re: (Score:2)
Women even better off in industry (Score:3)
I calll bullshit. There's a HUGE difference between positions in education and in industry and commerce.
Outside of the educational community, the desire for companies to hire ANY technical women is massive. You can for sure gat an interview at any tech company if you are a woman. You will be 99% sure to be made an offer if you are at all competent (and sometimes even if not, the power of quotas).
I have a friend with a daughter who is a CS major, and she was offered extremely well paid internships with a l
Re: (Score:3)
Why spread lies?? (Score:3)
Remember that stat, that 25% of women in colleges have been sexually assaulted? How initially it seems unbelievable because, hey, you wouldn't, and I wouldn't, and most men you know wouldn't, so how can that be?
And then you found out that it was unbelievable because it was a lie [washingtonexaminer.com]?
One office I worked for had such a person
Nothing helps a lie along like a nice little one-off anecdote, am I right?
But the idea it's limited to SV is absurd
It's not limited to SV but it's rare outside of there. In SV it is pervasiv
Re: uh huh (Score:5, Funny)
I understand the task
I have thought of all the possible test scenarios
I have coded for all possible test scenarios
The scope will not change
Re: (Score:2)
1 is prime, 3 is prime, 5 is prime, 7 is prime, 9 is prime ...
Re: (Score:2)
A programmer I used to work with would never say that his code had bugs, he would always refer to them as anomalies and not know how to fix them. He didn't last long.
Re: (Score:3)
They usually do not know what they are talking about. They don't understand the business, the customer, the product, or the technologies in use. But they have a stack of certifications.
Re: (Score:2, Interesting)
Are you fucking kidding me? I refactor just to break shit because my code works too well!! Tech debt my ass! If it's working right, it's got hidden bugs I just haven't fixed yet!!
Re: (Score:2)
Swift helps a bit with this, in that it insists you either cover all possible values, or have a default clause.
Of course you can just leave the default empty. But at least that's a visual clue you missed the error handling.