36

Possible Duplicate:
What is your longest-held programming assumption that turned out to be incorrect?

What do you consider to be the most harmful misconception about programming from people who are new to programming that you have seen?

8
  • 35
    should be community wiki
    – anon
    Jul 14, 2009 at 12:11
  • 3
    Been done to death in a variety of forms. eg. stackoverflow.com/questions/888224/…
    – Robin Day
    Jul 14, 2009 at 12:12
  • 2
    I will up vote when this is CW.
    – Zifre
    Jul 14, 2009 at 12:53
  • 2
    This question appears to be valueless (to a beginner or otherwise), at least judging from the current set of answers. Perhaps it should be deleted. Jul 14, 2009 at 14:06
  • 2
    Voted to reopen. The answers to this question can be valuable to people who are teaching others to be programmers. Jul 14, 2009 at 19:31

68 Answers 68

58

Re-inventing standard library functions/classes.

After going through a language book/tutorial, most beginners - knowing how to handle strings and numbers - will invent their own date functions, their own 'compression algorithms', their own SORT implementations.

Oh, and they always spend their first day searching for clrscr();.

13
  • 3
    Of course I talk from personal 'experience' too;)
    – Vlagged
    Jul 14, 2009 at 12:40
  • 41
    I can't say I agree that this is harmful. Implementing some of the basic stuff (even if it already exists) can be a good way for beginners to learn the basics, as well as how not to implement things. This is not harmful as long as you eventually figure out that standard libraries exist. I would take a programmer who wrote his own linked list implementation over one that uses the built-in libraries without question... Jul 14, 2009 at 12:41
  • 10
    @William: agreed: I would take a programmer who once upon a time wrote his own linked list implementation(s), too.
    – Vlagged
    Jul 14, 2009 at 12:44
  • 6
    Don't forget ones writing "encryption algorithms".
    – ryeguy
    Jul 14, 2009 at 12:58
  • 1
    Almost thought I would be clear of this one, except for that last clrscr(). darn! Jul 16, 2009 at 18:13
56

That because their program compiles and runs it does what they expect it to do.

3
  • 4
    Yes! This is quite seductive and can be hard to get rid of. Jul 14, 2009 at 12:56
  • This is what I agree with right here. Students jump to conclusions just when they get code to compile and run. They understand syntax errors, but easily forget logic errors.
    – Troggy
    Jul 14, 2009 at 14:46
  • 10
    hey - the compiler said '0 errors' who am I to argue? Jul 16, 2009 at 3:04
41

That if their code doesn't compile or work, it is because of a bug in the compiler.

4
  • 3
    @Neil, Yes! Seen Jeff's post on this topic? codinghorror.com/blog/archives/001079.html
    – Rob Wells
    Jul 14, 2009 at 12:18
  • 1
    @Rob No, this is the synthesis of my own experience as an instructor.
    – anon
    Jul 14, 2009 at 12:19
  • 9
    @Neil: I vehemently disagree. Hardware errors are much more common.
    – Andrew G
    Jul 14, 2009 at 12:23
  • 1
    @Andrew Back in CP/M days (two 5.25" floppies, no hard disk) hardware problems WERE much more common - the disk drives were always failing. I remember the happy day I took delivery of my first hard disk. It was from DEC, 8Mb capacity, and came in packaging suitable for a small washing machine. Bliss!
    – anon
    Jul 14, 2009 at 12:56
40

Maybe not the most harmful, but they usually can't estimate how long stuff will take to be done, they think it can be done much faster than it really must(including me).

As for harmful stuff, good companies usually keep beginners away from where they can do much harm. They are usually encouraged to work by someone more experienced, so they can learn better.

8
  • 2
    plz one more upvote, so I can get a comma =) Jul 14, 2009 at 12:16
  • 6
    The question says beginners :) Jul 14, 2009 at 12:17
  • @samuelcarrijo I regularly upvote anyone who has 990+ rep, except if they said something really silly :) Jul 14, 2009 at 12:18
  • @daniel I know even experienced guys still makes lots of mistakes on estimating, but at least in my case, I'd think things could be done two to four times faster than it really took... Old times... (now I usually make mistakes around 60% =P) Jul 14, 2009 at 12:26
  • 3
    I think my estimates would usually be pretty good if all factors were under my control, but they're not... Inevitably, I hit some major stumbling block. Very often, it's a bug or limitation I didn't realize in some library (usually in-house library) that we're using. Also, the compiler has cost me tons of time due to bugs and non-compliance (MSVC6). Does that make me a bad estimator? I still run over my estimates even when I add in a factor of 3 or so of what I think it would take me working with reasonable technology...
    – rmeador
    Jul 14, 2009 at 15:30
35

That if their program works on their own computer, then it will work on everybody else's computer too.

"But it works on my machine!"

6
  • Assuming you aren't doing 3d games or kernel hacking, it usually will run on most other computers too.
    – Zifre
    Jul 14, 2009 at 12:56
  • 2
    @Zifre: I vehemently disagree. Even number-crunching programs sometimes have problems on other machines, e.g. some system resource runs out where you didn't check for it and bang! Jul 14, 2009 at 13:21
  • 1
    Learning the difference between works and works well. I see this especially on database driven apps. No, 1000 rows in your test db is no "a lot" of data. Also, no, a 1MB javascript file is not a good idea just because it's fast on a LAN.
    – AngerClown
    Jul 14, 2009 at 13:27
  • +1: this is one of the most frustrating things to hear from a developer when QA logs a defect.
    – bedwyr
    Jul 16, 2009 at 1:54
  • 8
    We're not shipping your machine!
    – oɔɯǝɹ
    Jul 16, 2009 at 20:38
28

That programming is all about the syntax. Turns out it is all about problem solving.

3
  • Agreed. I was guilty of this when I started out. A course in algorithms will quickly cure a beginner of that!
    – Yohnny
    Jul 14, 2009 at 14:12
  • 1
    Sometimes using the syntax is the problem solving... but in general agreed.
    – mavnn
    Jul 16, 2009 at 15:22
  • I had a college intern tell me this a few weeks ago. I don't know how well I was able to convince them otherwise.
    – cmcginty
    Jul 16, 2009 at 20:14
26

That the user is a programmer.

4
  • 15
    No that's more from experienced programmers.
    – Zifre
    Jul 14, 2009 at 12:56
  • @Zifre No. The more experience you get, the more you learn about users culture. IMHO
    – Ahmed
    Jul 14, 2009 at 13:53
  • I'm sort of in the camp that a beginner programmer involves to an experienced one when they learn to think about their users. Jul 16, 2009 at 18:16
  • That's actually true for me, as I'm the only one who uses my programs. I get sent data, I run my programs, and send my boss the results of my analysis. Aug 11, 2009 at 2:21
26

Thinking if it doesn't look horribly complicated it must be wrong or "bad" code.

I must admit years ago in school I was guilty of thinking my programs didn't look complicated enough! These days I want to cry if something doesn't turn out as simple as:

//start

if(something)
{
    do_stuff();
}

//go home

:P

22
  • Programming is easy: Programming is a lot of fun but don't ever think of it as being easy. It takes a lot of experience, learning, and failure to get better at it and be humble about it.
  • Tools do it for me so I don't need to learn what happens underneath the covers: Tools make things a lot easier and allow you to get things done quicker. However, you still need to know and get familiar with what's happening underneath the covers because sooner or later you will need to pop open the hood.
  • Lack of curiosity
  • It's all about the newest and the coolest technologies: Not necessarily. It is about what's right for the customer and the problem you're trying to solve.
2
  • Or, alternately, that "I don't need any stupid tools". Jul 14, 2009 at 14:05
  • I somewhat disagree with your answer to the last point; programming need not involve a "customer" in the business sense. I'd rephrase that as "it's about what gets the job done"
    – hasen
    Jul 16, 2009 at 12:58
19

"The problem is not in my program, it's a bug in the library / OS / language."

"It worked on my machine! What is wrong with yours?"

"Everything is a pattern, you just have to find them."

"I don't need to test because I only made a one line change."

"Source control is a waste of time for this project."

3
  • You don't hear these quotes from beginning programmers, you get them from Code Monkeys (see: codewright.blogspot.com/2005/12/codewright-and-code-monkey.html). Jul 14, 2009 at 13:25
  • 1
    How about "I don't need to post a code review because I only made a one line change." Experienced and competent person (me), and that turned out to be a really bad idea. (There was only one way to test it, and that turned out to be expensive.) Jul 14, 2009 at 14:07
  • 1
    It's funny how quickly the last one is unlearned though. Jul 21, 2009 at 19:18
14

The real problem I've seen with programming tyros is "programming is magic", meaning not truly groking that the computer will operate exactly logically, and will do exactly the same thing every time given the exact same input.

They write something that they think should sort of does what they want, and then when it doesn't work, rather than try to approach the problem logically, they start changing things semi-randomly, hoping, apparently to appease the gods of computer magic by their sheer tenacity or willingness to abase themselves upon the altar of whimsy. They feel that the computer is capricious, and changes things randomly, and the best they can hope for is to get things to a vague approximation of working, and hope the stars stay aligned for long periods.

Of course, even to experienced programmers, it can feel that way sometimes, but there is an inherent knowledge that what is happening is happening for a specific reason, and you just have to dig down to get to that reason.

3
  • 1
    Hmm... There is a bit of semi-randomness, when it comes to doing things concurrently. Just because a multithreaded program run with the correct results once doesn't mean that the right thread will win a race condition every time. It seems to be very difficult for beginners to realize when they have created a race, or realizing that inconsistent behavior is because of such a logic bug in their own code. Jul 16, 2009 at 18:24
  • 1
    I thought about getting into that, but decided to avoid it: even then, it's not random! It's just that you don't have direct control over the inputs. The race condition, if you break it down far enough, will resolve one way or the other because of the exact situation...but because we can't directly control those factors, we speak of it as though it were random. But I thought that getting into that in detail would dilute the point of my answer.
    – Beska
    Jul 16, 2009 at 20:17
  • Ah, the joys of shotgun debugging! This was especially fun with some people (ahem) who thought that using version control was a boring and unnecessary chore. "Well, can you revert this to the previous revision?" "What previous revision? I don't keep any...can I create the previous revision now and then revert to it?" Aug 20, 2010 at 11:08
13
  1. That their program will work.
  2. If the previous hurdle is overcome miraculously, that their program will work as expected by the end user
  3. If the previous hurdle is again overcome miraculously, that their program will stand the test of time, i.e that it will be maintainable
  4. If all of the previous hurdles are again overcome miraculously, that their second system will be as good or better
11

That you have to have design patterns in your code.

1
  • Even worse, "that you have to use every pattern from The Book" (whichever book it is at the moment). Aug 20, 2010 at 11:11
11

That their solution is the One and Only True Way To Solve The Problem, and everyone else is just dumb and wrong.

11

most harmful misconception (financial version):

"That a college education is required to know or have understanding about how to write software."

2
  • 2
    I'd say "That a college education is enough to know or have understanding about how to write software."
    – Zano
    Jul 13, 2010 at 13:17
  • And that's usually only when they pass -- and still won't guarantee a developer let alone a sw-engineer. Back in the day I knew a second-year attendee @ACC in cmp-sci and his weekly tests would center around DOS-env cmds... I had to pity him -- He couldn't pass math at all and simple DOS commands were killing him. I've known numerous college graduates even recently who didn't grock object fundamentals, let alone deeper applications like reflection. They often end up at 35~45K / yr jobs doing menial work, but not real sw-engineering. I've still no degree and usually pull 100k give or take.
    – Hardryv
    Aug 30, 2011 at 16:58
10

"I am going to make a ton of money by playing with computers!"

Edit: Another one that drives me nuts:

"The other guy's code isn't calling mine correctly, so it's not my fault the system doesn't work." -- with no proactive investigation, diagnosis, suggested patch, nothing. As a manager or a team leader, this really gets under my skin.

3
  • 1
    Actually the first one is quite true for me. Maybe if you've never had a "real" job (only IT jobs) you can't really appreciate how pleasant our work is and how well paid it is, relatively speaking.
    – MGOwen
    Jul 16, 2009 at 1:50
  • That was mostly referring to people in freshmen computer science classes who know nothing about programming, math, computer science, computer hardware, anything. Sort of like people who watched Matlock or Perry Mason and decided to become lawyers. Jul 16, 2009 at 2:49
  • OK, I see what you mean... I had that too when I started my CS degree in '98: people who had never even owned a computer but had heard that IT was where the easy money was. Thankfully many of them left after the first 2 CS1 lectures, and I think most of those people are choosing some other major since the dot-com bubble burst (accounting? I can't think of any other reason someone says "hey I really want to be an accountant!").
    – MGOwen
    Jul 23, 2009 at 23:57
9

The worse misconception I've encountered, and the hardest to be rid of, is that programming is writing code, and not reading it.

9

That you have to use every feature of the language you are learning, inheritance above all.

Updated: be obsessive about assembly inline code in C

1
  • Inheritance is incredibly overused and abused. Apr 18, 2011 at 14:56
8

That cool == usable.

3
  • Sometimes Cool != usable at all, however.
    – barfoon
    Jul 15, 2009 at 19:18
  • Surely if it's not usable, it's can't be cool? Jul 31, 2009 at 13:44
  • I don't agree. I've seen "cool" websites that weren't particularly usable. Many marketing related sites can lay claim to being 'cool' but not be particularly usable. I can't think of specific references at the moment but I know I've stumbled on product websites that were full of flash and video and cute effects and fancy fonts and professional imagery and definitely looked "cool", but which failed to make it easy for me to actually get at the information I was seeking. Jul 31, 2009 at 15:08
8

Disabusing them of the notion that "perfect but very late" is better than "acceptable and on time".

No one is going to care if some weekly report runs in 5 seconds rather than 8 if it is two months late.

1
  • 3
    what about "acceptable and late"?
    – Assembler
    Jul 16, 2009 at 3:06
8

The most harmful misconception is: You are done when you get the code to work.

7

It has something to do with computers.

2
  • I think he means it isn't really about computers but about logic and sets and algorithms and such (universal concepts that can be separated from the computer hardware they usually run on). Ebo, maybe if you re-worded a bit...?
    – MGOwen
    Jul 16, 2009 at 1:48
  • By this statement you're implying that programming has nothing to do with computers? Perhaps you mean "Programming is only about computers."
    – Josiah
    Jul 16, 2009 at 7:55
7

That their code doesn't need to be documented. They're the only ones who will ever look at it, right?

1
  • Sometimes they only document the obvious, leaving the maintainers with twisty passages, all alike. Apr 6, 2012 at 13:08
6

The most common misconception is that you can write an application by starting your favorite IDE/editor and then write code immediately.

Yes, it will create an application. Yes, it's probably cr@p too when you're finished...

You start developing software by first creating a design. Preferably with pen and paper or with some useful tools on your computer. Writing the actual code just happens to be a small part of the whole process. (If not, you're doing something wrong!)

5

The most harmful misconception is to assume that people in software industry know what they're doing. Beginners tend to trust everything written in product's documentation, they trust error messages and exception descriptions. They even trust stuff posted on blogs.

4

That all there is to it is building cool new stuff everyday. Maintenance IS a part of programming!

4

That the hard part is typing in the code. The farther up you go, the more that comes to be the easy part.

4

Early on:

  • But isn't all the world an x86?
  • I have to pass a size with that buffer?
  • Error checking? Why?
  • The STL is too complicated. I'd rather implement everything myself.
    • (Use std::swap()! std::swap()! Start there, then branch out to more...)
  • Not knowing that you cannot treat binary buffers as strings without first null terminating them. (Think: read(), recv(), etc.)

Later on:

Wrongly thinking that...

  • That there are 8 bits in a byte.
  • That garbage collection will save you from resource management.

  • Endianness? Padding? I can't just write(), send(), etc. the whole struct?

  • Threads and deadlocks and race conditions oh my.
  • i18n? (2009, and we're still learning that the earth is round!)
  • I could have written this better. Time to rewrite. (Hint: refactor.)
  • Time related, wrongly thinking that:
    • That within a calendar year, DST starts before it ends.
    • That all time timeszones are + or - whole hours.
    • That the max UTC offset is + or - 12 hours.
    • That there are 60 seconds in a minute.
    • That 1900 is a leap year.

Wrongly thinking that:

  • 16-bit is enough to hold a Unicode code point.
  • I can ignore FOSS libraries that will do 90% of the work for me.
  • That C, C++, Python, Lisp, C#, .NET, Java, VB6, Ruby, PHP, Bash, assembler is the perfect language for every task!
2
  • There are 60 seconds in a minute right, What's the catch? Jul 16, 2009 at 23:32
  • 2
    Leap seconds add the possibility of a 61th second in UTC, ie: 23:59:59 UTC ... 23:59:60 UTC ... 00:00:00 UTC
    – Thanatos
    Jul 18, 2009 at 2:43
3

That the program has to be correct the first time.

Fail fast, early, and often. It's the only way to get better.

3

That they will "break" something!

Or, to define "newcomers" as those that don't do it, "It'll be easy to change! It's software!"

cheers,

Not the answer you're looking for? Browse other questions tagged or ask your own question.