281
votes

I am doing some research into common errors and poor assumptions made by junior (and perhaps senior) software engineers.

What was your longest-held assumption that was eventually corrected?

For example, I misunderstood that the size of an integer is not a standard and instead depends on the language and target. A bit embarrassing to state, but there it is.

Be frank; what firm belief did you have, and roughly how long did you maintain the assumption? It can be about an algorithm, a language, a programming concept, testing, or anything else about programming, programming languages, or computer science.

1

195 Answers 195

1
2 3 4 5
7
545
votes

For a long time I assumed that everyone else had this super-mastery of all programming concepts (design patterns, the latest new language, computational complexity, lambda expressions, you name it).

Reading blogs, Stack Overflow and programming books always seemed to make me feel that I was behind the curve on the things that all programmers must just know intuitively.

I've realized over time that I'm effectively comparing my knowledge to the collective knowledge of many people, not a single individual and that is a pretty high bar for anyone. Most programmers in the real world have a cache of knowledge that is required to do their jobs and have more than a few areas that they are either weak or completely ignorant of.

18
  • 68
    So true! That's the problem of this age. Information is also discouraging. I had this revelation a few weeks ago when I felt like a complete loser in everything I did (not the first time) regarding research. Guys who get their papers published in IEEE Transactions do not necessarily have the same skills as guys who work at Google, boast in StackOverflow, ar excellent professors, or write great programming blogs. Of course, the best guys are exponentially cooler than we are, but they don't know everything you know that you don't know. So, stay cool.
    – jbasko
    May 21, 2009 at 5:19
  • 40
    It also helps to understand that those bloggers aren't writing everything off the top of their heads either. Good bloggers research their topics and learn new things while writing posts.
    – JohnFx
    May 21, 2009 at 14:35
  • 47
    I obsess daily about the stuff I don't have time to read about and learn. It leaves me with a horrendous feeling of guilt sometimes.
    – brad
    May 21, 2009 at 20:55
  • 9
    @Zilupe: Amen to that. I've published a few international conference papers and journals. In the eyes of some people, that sounded cool. Until you realized that it doesn't really take much effort to publish a paper. We're no genius. We're just like everyone else. We made mistakes, and we publish crap papers. Well, except for some minority group of real geniuses... May 25, 2009 at 3:18
  • 4
    +1 Good thing I read this. I thought I was the only one.
    – Randell
    Jul 29, 2009 at 9:57
308
votes

That people knew what they wanted.

For the longest time I thought I would talk with people, they would describe a problem or workflow and I would put it into code and automate it. Turns out every time that happens, what they thought they wanted wasn't actually what they wanted.

Edit: I agree with most of the comments. This is not a technical answer and may not be what the questioner was looking for. It doesn't apply only to programming. I'm sure it's not my longest-held assumption either, but it was the most striking thing I've learned in the 10 short years I've been doing this. I'm sure it was pure naivete on my part but the way my brain is/was wired and the teaching and experiences I had prior to entering the business world led me to believe that I would be doing what I answered; that I would be able to use code and computers to fix people's problems.

I guess this answer is similar to Robin's about non-programmers understanding/caring about what I'm talking about. It's about learning the business as an agile, iterative, interactive process. It's about learning the difference between being a programming-code-monkey and being a software developer. It's about realizing that there is a differnce between the two and that to be really good in the field, it's not just syntax and typing speed.

Edit: This answer is now community-wiki to appease people upset at this answer giving me rep.

21
  • 9
    Or change what they want after seeing what they previously wanted. People like to change their minds. I know, cuz I'm a people.
    – J. Polfer
    May 20, 2009 at 14:36
  • 13
    You were giving them what they asked for, not what they wanted. May 20, 2009 at 15:43
  • 47
    Why do boring uncontroversial no-answers get up-voted so excessively?!
    – nes1983
    May 20, 2009 at 16:50
  • 39
    Wow. Sounds like someone needs a hug.
    – bzlm
    May 20, 2009 at 20:26
  • 24
    My god @ people complaining, stackoverflow rep is not a competition. Upvote if you enjoyed the answer, don't downvote because you are jealous you didn't post it first. May 21, 2009 at 21:12
292
votes

That I know where the performance problem is without profiling

3
  • 10
    I think this is why premature optimization is so common place. May 21, 2009 at 5:21
  • 10
    +1 Wow, someone included an answer that wasn't trivial or off-topic. May 21, 2009 at 17:09
  • 3
    I've got some tablets that should help with premature optimization...
    – AndyM
    Aug 28, 2009 at 7:55
232
votes

That I should have only one exit point from a function/method.

17
  • 91
    Excellent realization; exit as often as necessary. One should bail out of a function as soon as it makes no sense to continue further into it. Doing this can reduce complexity and increase readability by, for example, avoiding deeply nested conditionals, when they are preconditions required for the method to run properly. In modern languages with memory management and resource constructs like using/finally, continuing all the way to the end of a method dogmatically makes no sense.
    – Triynko
    May 20, 2009 at 17:35
  • 24
    Who came up with this, by the way? It's like a programming urban legend.
    – brad
    May 21, 2009 at 20:54
  • 49
    People who have to debug other people's code are who came up with this.
    – gatorfax
    May 21, 2009 at 23:44
  • 23
    I think this commonly-held but wrong idea is based on a misunderstanding. When you exit a function, you should always return to the same point. That was an important rule in languages like BASIC that didn't enforce it: The rule meant, for instance, that you should use GOSUB instead of GOTO. In languages like C# or Java that call methods, it's automatic. But because it's automatic, I think it morphed from the logical "only one return-to point" to the nonsensical "only one exit point".
    – Ryan Lundy
    May 22, 2009 at 17:53
  • 35
    From languages like C where yo need to manually release ressources. Multiple exit points were a good chance for leaking ressources. IMO there's no point to it in languages with exceptions, as you often don't know your exit points anymore, or the are in the middle of a statement. -- In these languages, all that remains is "structure for readability".
    – peterchen
    May 27, 2009 at 22:16
228
votes

That nonprogrammers understand what I'm talking about.

7
  • 243
    understand/care..
    – nickf
    May 20, 2009 at 15:15
  • 8
    I still have this one at times... I thought at least my wife would have started to understand properly by now :P
    – workmad3
    May 21, 2009 at 7:35
  • 3
    Oh dear, I fear I may be yet to learn this!
    – thatismatt
    May 21, 2009 at 17:09
  • 3
    yeah, sometimes i forget my audience and end up with a bunch of people wtih blank looks on thier face stairing at me, it's nice when people show an interest though
    – Petey B
    Jun 5, 2009 at 19:41
  • 3
    This is my biggest frustration with the profession. Jun 24, 2010 at 11:03
219
votes

That bugfree software was possible.

25
  • 35
    +1, although NASA almost managed it May 20, 2009 at 14:31
  • 55
    Yes but the "almost" cost a few million of dollars :)
    – Jem
    May 20, 2009 at 15:04
  • 15
    @Triynko your "possible" and @JaredPar's "possible" are not the same. Theory and practice might be the same in theory but are very different in practice. May 22, 2009 at 2:30
  • 13
    @Joseph, part of the problem is people think Hello World programs are bug free. They're not. Most do not check for errors in printf for instance or account for other failed IO attempts.
    – JaredPar
    May 22, 2009 at 18:01
  • 9
    @RussellH, no. You've failed to specify a return value and the resulting process will return random garbage memory.
    – JaredPar
    Sep 29, 2009 at 5:37
199
votes

That private member variables were private to the instance and not the class.

23
  • 192
    I held that assumption until... just now. May 20, 2009 at 15:29
  • 9
    @ebrown I usually only find it useful when writing an equals() method
    – David Webb
    May 20, 2009 at 18:13
  • 12
    They are in Ruby. May 20, 2009 at 20:48
  • 17
    This is so normal to me that this answer didn't make sense the first few times I read it. Now I want to learn Ruby so it can confuse me the other way. :) May 21, 2009 at 15:13
  • 16
    @Kiewic If you have a private member variable called myVar inside your class you can reference other.myVar directly in your code if other is an instance of this class. I had assumed because it was "private" you had to use other.getMyVar() even inside the class.
    – David Webb
    Jun 19, 2009 at 15:43
166
votes

I thought that static typing was sitting very still at your keyboard.

3
  • 53
    Sincere or not, this made me laugh hard at the end of a long day of work. :P May 20, 2009 at 21:02
  • 5
    ++ for a good laugh. sounds like something my (non-technical) husband would come up with.
    – jess
    May 23, 2009 at 0:29
  • 11
    +1! I thought duck typing involved typing too. Or ducks. Or both.
    – SqlACID
    Jun 10, 2009 at 15:03
162
votes

That you can fully understand a problem before you start developing.

3
  • 32
    This, my friend, should be: "That you can fully understand a problem." But it is so true. And apparnetly a hard concept to understand or even accept.
    – KarlP
    May 21, 2009 at 15:12
  • 4
    You cannot understand the problem "fully", but certainly you MUST understand the problem ( at some degree ) before you start developing. bit.ly/kLXgL
    – OscarRyz
    May 21, 2009 at 17:58
  • Sometimes you have to start developing to understand the problem. And/or, the problem changes the more you develop. Jun 14, 2010 at 19:15
158
votes

Smart People are Always Smarter than Me.

I can really beat myself up when I make mistakes and often get told off for self-deprecating. I used to look up in awe at a lot of developers and often assumed that since they knew more than me on X, they knew more than me.

As I have continued to gain experience and meet more people, I have started to realise that oftentimes, while they know more than me in a particular subject, they are not necessarily smarter than me/you.

Moral of the story: Never underestimate what you can bring to the table.

6
  • Good one! I am currently working with a colleague who really knows A LOT about .NET development. Took me some time to realise that I am better at understanding what the customers needs.
    – Treb
    May 21, 2009 at 21:40
  • 58
    And on the other hand, that I know more than other people. It turns out that they just know different stuff. The other moral: Never underestimate what someone else can bring to the table. May 21, 2009 at 23:19
  • 1
    Here's that old "Do unto others" thing again... I'm coining a new phrase: Tech bulying ~ The state of feeling superior because you know some stuff, and making the mistake of letting everyone else know it. @seealso: smartass.
    – corlettk
    May 23, 2009 at 8:17
  • 1
    Excellent observation - my version is more negative "Everyone does stupid now and then". Somewhat related to "don't flip the bozo bit".
    – peterchen
    May 27, 2009 at 22:17
  • 2
    You only have to worry when stupid people, are smarter than you. Jul 29, 2009 at 21:16
131
votes

For the longest time I thought that Bad Programming was something that happened on the fringe.. that Doing Things Correctly was the norm. I'm not so naive these days.

7
  • 30
    I used to think Bad Programming was only done by other programmers, until I was done in by one of my Bad Programs. Now I Do Things Correctly! (You believe me this time, right?) May 21, 2009 at 4:26
  • 2
    Totally. I've gone from "That never happens" to "That never happens except at this job" to "Every place has bad code."
    – Ryan Lundy
    May 22, 2009 at 17:55
  • 1
    Hacking is the norm. Engineering is the purview of the truly competetent. If ever meet a software engineer I'll let you know.
    – corlettk
    May 23, 2009 at 6:30
  • 3
    @corlettk: You mean monkey-coding is the norm, no? Hacking is an art, a high-level of art mind you, that I'm far far away from achieving.
    – hasen
    May 27, 2009 at 18:33
  • 2
    @Hasen: No, hacking is an analogy to unskillfully taking an axe to a tree, chiseling off tiny pieces in a mad panic with no real plan, and creating a bloody great mess until the tree finally falls on your head. A "hack" is "one who produces banal and mediocre work in the hope of gaining commercial success". Why it was that the computer field changed "hack" to mean "skilled", I'll never know. Oct 23, 2009 at 1:23
113
votes

I thought I should move towards abstracting as much as possible. I got hit in the head major with this, because of too much intertwined little bits of functionality.

Now I try keep things as simple and decoupled as possible. Refactoring to make something abstract is much easier than predicting how I need to abstract something.

Thus I moved from developing the framework that rules them all, to snippets of functionality that get the job done. Never looked back, except when I think about the time I naively thought I would be the one developing the next big thing.

10
  • 26
    Decoupled = true Abstraction. Abstract for its own sake is... premature optimization. May 21, 2009 at 4:28
  • 1
    This goes along with what I've found doing performance tuning. There can be a lovely program with multiple layers of abstraction. Then the workload gets heavy, and guess what is costing all the time ... all the abstractions. Computers execute instructions, not abstractions. May 21, 2009 at 14:02
  • 5
    Abstraction and generalisation are powerful tools, sadly used to generalise an abstract use case with one single implementation. The funny thing is that whenever there is a need to change the implementation, the abstractions and generalisations have to change too...
    – KarlP
    May 21, 2009 at 15:08
  • I totally agree with Jared ... if you have managed to get to "simple and decoupled" you have achieved true abstraction. How can things be decoupled if you haven't abstracted things out into interfaces and factories etc...? How can it be simple unless you remove all the "if type = this then do this, or if the type is that then do something else code"? May 21, 2009 at 23:58
  • Same here. I think I learned about abstraction before making a whole lot of spaghetti code. They should've taught how to get things done even if the code is spaghetti, and then teach us about OO and abstraction.
    – hasen
    May 22, 2009 at 18:09
103
votes

That women find computer programmers sexy...

12
  • 70
    Wait a second??? May 21, 2009 at 17:18
  • 4
    he he he he.. okey, I was looking for something to keep my smile for the rest of the day. I think I've found it!!! :)
    – OscarRyz
    May 21, 2009 at 18:01
  • 17
    "Ooh, baby! Yeah, say 'if' - throw me some exceptions.. Yeah, you know how I want it" :P
    – cwap
    Jun 10, 2009 at 15:01
  • 5
    What? Programmers are rich? When did this happen? Sep 12, 2009 at 6:40
  • 3
    Some women (the right kind) are attracted to insightful intelligent guys. Which, minus the prototypical neck-beard and sausage-gut, are pretty common traits of programmers. Sprinkle on a little concern for self-image/hygiene and the occasional thrill/excitement of extreme sports and you're well on your way. Jun 14, 2010 at 19:22
100
votes

That the quality of software will lead to greater sales. Sometimes it does but not always.

6
  • 37
    Selling software? That's so 1999.
    – bzlm
    May 20, 2009 at 16:25
  • Lots of subscription based websites now adays...
    – cgp
    May 20, 2009 at 17:01
  • 11
    Microsoft sure makes a killing at it. May 21, 2009 at 13:44
  • gotta love this one, so true.
    – dr. evil
    May 21, 2009 at 14:27
  • 18
    I wish that improving the quality / performance of our software counted as a feature
    – Tom Leys
    May 21, 2009 at 21:21
81
votes

That all languages are (mostly) created equal.

For a good long while I figured that the language of choice didn't really make much of a difference in the difficulty of the development process and the potential for project success. This is definitely not true.

Choosing the right language for the job is as important/critical as any other single project decision that is made.

10
  • 13
    I feel that chosing the right libraries is what matters. It just so happens there's often a 1-to-1 correspondence between languages and libraries... May 21, 2009 at 5:07
  • 7
    But if two programming languages are both Turing complete then what's the difference? You can write any program in either language! ;) May 21, 2009 at 14:17
  • 8
    I disagree, the decision what language to use is way less important than who will actually be implementing the project. As just one example of many other more important decisions. May 22, 2009 at 13:53
  • 13
    BrainFu** is as turing complete as python is.
    – hasen
    May 27, 2009 at 18:31
  • 9
    That Turing complete languages are somehow equally applicable is a common misconception. A Turing complete language can compute everything that a Turing machine can (and often implied the other way around too). There is absolutely no implications regarding performance. An operation that takes linear time in one language could very well take exponential time on another and they could still both be Turing complete. There's a huge difference between what's theoretically computable and what is feasible in practice.
    – TrayMan
    Jun 10, 2009 at 6:34
81
votes

That a large comment/code ratio is a good thing.

It took me a while to realize that code should be self documenting. Sure, a comment here and there is helpful if the code can't be made clearer or if there's an important reason why something is being done. But, in general, it's better to spend that comment time renaming variables. It's cleaner, clearer and the comments don't get "out of sync" with the code.

3
  • 1
    I agree in the actual code... excluding javadoc comments (or equivalent).
    – corlettk
    May 23, 2009 at 5:13
  • 11
    +1, don't even get me started on the treatises I used to write for 10 line functions
    – wds
    May 27, 2009 at 8:11
  • To add to this, an assert() statement is better than documenting a precondition/postcondition. .NET 4 code contracts can automatically be turned into documentation, too! May 31, 2010 at 10:59
66
votes

That programming is impossible.

Not kidding, I always thought that programming was some impossible thing to learn, and I always stayed away from it. And when I got near code, I could never understand it.

Then one day I just sat down and read some basic beginner tutorials, and worked my way from there. And today I work as a programmer and I love every minute of it.

To add, I don't think programming is easy, it's a challenge and I love learning more and there is nothing more fun than to solve some programming problem.

11
  • 7
    Amen! But, hey, don't proclaim this view from rooftops. We don't want everyone to know programming is fun, now do we? ;) ;P May 20, 2009 at 14:30
  • 9
    MasterPeter: It would give us more fodder for us to increase our rep when they come here asking questions.
    – TheTXI
    May 20, 2009 at 14:32
  • 4
    I would say that programming is hard to do right. It is, however, possible, which seems to be your point.
    – Steve S
    May 20, 2009 at 14:33
  • 4
    @Olafur: Why would you want the question to be wiki, but not your answer?
    – gnovice
    May 20, 2009 at 14:52
  • 2
    This mirrors my experience exactly. I wish I'd started sooner now :P
    – Skilldrick
    May 20, 2009 at 14:59
65
votes

"On Error Resume Next" was some kind of error handling

11
  • 6
    I feel you...but in vbscript (esp. asp), it was the ONLY "error handling" option available, combined with judicious checking whether an error actually occurred, and a fair amount of prayer.
    – flatline
    May 20, 2009 at 15:37
  • 2
    Yeah... it is some kind... just a kind that we are glad to be getting away from May 20, 2009 at 19:41
  • 6
    Well?! but it is. You start your error-handling block with On Error Resume Next, try something, and then If (err.number<>0) then
    – jpinto3912
    May 20, 2009 at 21:22
  • Isn't this the only vbscript equivalent to a try catch?
    – James
    May 22, 2009 at 12:07
  • -1: It is a kind of error handling. It just isn't that elegant.
    – JohnFx
    May 23, 2009 at 16:11
64
votes

That programming software requires a strong foundation in higher math.

For years before I started coding I was always told that to be a good programmer you had to be good at advanced algebra, geometry, calculus, trig, etc.

Ten years later and I have only once had to do anything that an eighth grader couldn't.

15
  • 5
    Very true. In most cases you don't need to be a math expert. The only time I ever really needed to know any advanced math was when I was doing 3D programming as a hobby. In fact, it was actually the 3D programming during high school that inspired me to pay better attention in trig and pre-cal classes. Other than that though, very basic math is usually all you need. May 20, 2009 at 21:43
  • 29
    I think you were misinformed. Sure, to be a good programmer, you don't really need to use much higher level math, but to truly understand and apply certain computer science concepts, you're going to need more than just eighth grade math.
    – hbw
    May 21, 2009 at 0:43
  • 12
    I think the emphasis on math is to teach critical thinking skills and problem solving not as something that you would use in every day computer programming.
    – Zack
    May 21, 2009 at 14:54
  • 14
    The kind of abstraction you need to understand advanced mathematics is very similar to the abstraction you need to create software.
    – OscarRyz
    May 21, 2009 at 18:04
  • 6
    I think functional programming concepts is much easier to understand if you have a stronger foundation in mathematics, simply because you aren't frightened off by the syntax as much. It looks familiar. I made the mistake of using simple mathematical functions to demonstrate the functional programming concepts new to C#. Some people were immediately declaring that it was too complex. May 22, 2009 at 0:08
63
votes

That optimizing == rewriting in assembly language.

When I first really understood assembly (coming from BASIC) it seemed that the only way to make code run faster was to rewrite it in assembly. Took quite a few years to realize that compilers can be very good at optimization and especially with CPUs with branch prediction etc they can probably do a better job than a human can do in a reasonable amount of time. Also that spending time on optimizing the algorithm is likely to give you a better win than spending time converting from a high to a low level language. Also that premature optimization is the root of all evil...

5
  • 8
    Peek and Poke are your friends :) May 20, 2009 at 19:38
  • 4
    Pervert! Say that to the judge! Jul 29, 2009 at 9:09
  • 1
    This is where complexity theory comes in. Assembly is generally micro optimization. Making your algorithms time complexity smaller is where speed is gained.
    – PeteT
    Dec 17, 2009 at 13:29
  • @scraimer: Fancy seeing you here, I never would have expected it ;-) Jun 18, 2010 at 12:39
  • @ Matthew - "Peek and Poke are your friends :)": **EXTREMELY jealous I didn't write that first.
    – FastAl
    Jul 8, 2010 at 18:31
63
votes
  • That the company executives care about the quality of the code.
  • That fewer lines is better.
8
  • 2
    they DO care, but you have to combine artist-skills with worker-skills. Every piece of algoritm cant be a piece of art too. Some of it will be plumpering, so reuse the "less used". Remember the old 80/20 rule. 80% of the program is used 20% of the time. So focus 80% on 20% of the code and make that REAL PIECE OF ART! :OP May 20, 2009 at 23:12
  • 71
    fewer lines are better! part of the reason I dislike java as a language is that doing anything takes up so many lines of code. less lines of code means it is easier to change your code.
    – Claudiu
    May 21, 2009 at 5:56
  • 7
    It depends on what you're removing to get fewer lines. If the code is still readable with fewer lines then it's good. However, there are plenty of ways to reduce the number of lines of code that make the code worse.
    – Herms
    May 21, 2009 at 14:57
  • 2
    Except when people take the "fewer lines is better" mentality to far with chained method calls 7 deep so that when one of them throws a null pointer, you have no idea which it was. Or they condense so many actions into one line that it's 150 characters long and performs 4 operations. This makes it both harder to read and harder to debug, but is not any faster nor does it uses less memory during execution. May 21, 2009 at 19:24
  • 17
    If your line ends in ))))) and you're not writing Lisp, you have too-few lines.
    – user132748
    Jul 30, 2009 at 22:23
58
votes

I would say that storing the year element of a date as 2 digits was an assumption that afflicted an entire generation of developers. The money that was blown on Y2K was pretty horrific.

8
  • 1
    This is the only answer that I'll upvote, though it's a CW so it doesn't matter... May 21, 2009 at 13:32
  • 4
    IIRC some systems back in the 60's and maybe 70's only used one digit because it used less memory. I have even seen paper forms where "196_" and "197_" was preprinted.
    – some
    Jun 5, 2009 at 0:03
  • 3
    I still see forms with 200_ and presumably there are some now with 201_ printed.
    – Macha
    Apr 3, 2010 at 20:25
  • 5
    The sad part is... Unix will have their second round at this in 2038 Jun 14, 2010 at 19:32
  • 4
    @Billy Just because the machine architecture changes doesn't mean the data format will. Storing 2 digits of resolution in int format would make a byte (8bit) date format and, yet, it affected tons of 32bit hardware architecture machines in 2k. This is just one more example of why you don't let low level hardware guys specify data formats. They penny pinch bits with the knowledge that there will be a scheduled SNAFU in the distant future. Jul 12, 2010 at 16:38
57
votes

That anything other than insertion/bubble sort was quite simply dark magic.

7
  • Haha, I like this one, as it hits close to home. Sort in faster than n-squared time?? Unpossible!
    – Ross
    May 20, 2009 at 14:54
  • It's amazing how simple and obvious most sorting algorithms seem once you have a strong feel for recursion and divide&conquer. Until then, most of them feel like black magic.
    – Brian
    May 20, 2009 at 18:08
  • 74
    I am a RESEARCHER in sorting algorithms! And they STILL feel like dark magic.
    – SPWorley
    May 20, 2009 at 19:31
  • 14
    I once had a line of code in my program that was a long and complicated and I didn't feel like breaking it up or explaining it (it was some complicated lighting formula), so I put it all on one line and #define'd it to be DARK_MAGICK, and the only comment was a warning against trying to unravel the mysteries of the dark magick
    – Alex
    May 23, 2009 at 10:26
  • 2
    Bogosort is the most mysterious of them all. Jun 2, 2009 at 5:06
50
votes

That XML would be a truly interoperable and human readable data format.

5
  • 7
    XML isn't a panacea but I wouldn't like to go back to the days where I regularly saw applications trying to squeeze relational data into single csv files. May 21, 2009 at 7:43
  • 4
    its an inter-operable syntax, no doubt about that. Its just that syntax is often the least important aspect of any solution. May 21, 2009 at 14:35
  • 2
    +1, you could add small and fast to the wishlist too.
    – MarkJ
    Jun 11, 2009 at 16:30
  • 1
    True but an improvement over csv and fixed length where without the documentation you are screwed.
    – PeteT
    Dec 17, 2009 at 13:32
  • 7
    I love XML for the standardization it brought to data formats and for correctly handling character encodings. I hate what is sometimes done using XML, however. Apr 21, 2010 at 14:36
48
votes

That C++ was somehow intrinsically better than all other languages.

This I received from a friend a couple of years ahead of me in college. I kept it with me for an embarrassingly long time (I'm blushing right now). It was only after working with it for 2 years or so before I could see the cracks for what they were.

No one - and nothing - is perfect, there is always room for improvement.

7
  • 5
    "better" will bring you tons of less-than-hateful comments. But I would say it is one of the most fast-executing, flexible, free-from-hurdles one. It's also one that takes your youth to proper learn it, only to find you could do more or less the same app. (albeit requiring some extra tonne or two of electricity-generating coal) with java or C#.
    – jpinto3912
    May 20, 2009 at 21:35
  • @JP: I'm happy with my choice of words :) May 21, 2009 at 8:30
  • Productivity matters more in the world of business applications. of course, there are some niches that c++ is required, and the only option.
    – Shaw
    May 25, 2009 at 9:42
  • 7
    I've always assumed C++ is worse than straight ANSI C, simply because the kind of trouble that I've seen C++ programmers get into is so much more complicated than the kind of trouble I've seen C programmers get into.
    – Nosredna
    May 27, 2009 at 21:54
  • 1
    Actually, the language that's better than all other is Common Lisp. C++ isn't bad, though. Jun 3, 2009 at 20:49
47
votes

I believed that creating programs would be exactly like what was taught in class...you sit down with a group of people, go over a problem, come up with a solution, etc. etc. Instead, the real world is "Here is my problem, I need it solved, go" and ten minutes later you get another, leaving you no real time to plan out your solution efficiently.

3
  • 24
    I think that's called life.
    – Robin Day
    May 20, 2009 at 15:19
  • 9
    hmmm.. it's time you bail out that company. ..
    – jpinto3912
    May 20, 2009 at 21:24
  • 8
    @jpinto3912: No. Because the next company will also be a part of life (see previous comment).
    – Treb
    May 21, 2009 at 21:41
42
votes

I thought mainstream design patterns were awesome, when they were introduced in a CS class. I had programmed about 8 years as hobby before that, and I really didn't have solid understanding of how to create good abstractions.

Design patterns felt like magic; you could do really neat stuff. Later I discovered functional programming (via Mozart/Oz, OCaml, later Scala, Haskell, and Clojure), and then I understood that many of the patterns were just boilerplate, or additional complexity, because the language wasn't expressive enough.

Of course there are almost always some kind of patterns, but they are in a higher level in expressive languages. Now I've been doing some professional coding in Java, and I really feel the pain when I have to use a convention such as visitor or command pattern, instead of pattern matching and higher order functions.

2
  • "many of the patterns were just boilerplate, or additional complexity, because the language wasn't expressive enough." Expressiveness is simply boilerplate code hardwired into the language.
    – Unknown
    May 21, 2009 at 9:51
  • 4
    Not true, how is it boilerplate to have first class stuff instead of limiting the capabilities of a programmer, like in the case of higher order functions. Lisps are beautiful example of this.
    – egaga
    May 21, 2009 at 10:01
38
votes

For the first few years I was programming I didn't catch on that 1 Kbyte is technically 1024 bytes, not 1000. I was always a little perplexed by the fact that the sizes of my data files seemed slightly off from what I expected them to be.

14
  • 114
    Hard drive manufacturers still haven't caught on...
    – Michael Myers
    May 20, 2009 at 14:31
  • 10
    @mmyers I think you mean hard drive marketers right? Or are the drives actually built like that? May 20, 2009 at 14:38
  • 16
    Hey, stop the kibi hating. MeBi and KiBi are at least unbambiguobus.
    – bzlm
    May 20, 2009 at 16:30
  • 21
    Kilo means 1000, Mega means 1000000, Giga means 1000000000. It's the RAM and OS makers that got it wrong, not the drive makers. May 20, 2009 at 17:26
  • 39
    No one's going to do it? Seriously? Okay, I'll do it... xkcd.com/394 May 20, 2009 at 19:15
36
votes

That condition checks like:

if (condition1 && condition2 && condition3)

are performed in an unspecified order...

15
  • 15
    In what language? Languages like C/C++, Java, and Python guarantee that the conditions are evaluated left to right and that evaluation stops at the first condition that returns false. It's part of the langauge spec. I assume that most other languages make the same guarantee. May 20, 2009 at 15:49
  • 44
    @Clint: Yeah, hence "that turned out to be incorrect".
    – bzlm
    May 20, 2009 at 16:22
  • yeah, this one is cool. it makes wrint stuff like if(myList!=null && myList.Count >= 0) {do stuff();} a lot easier
    – Zack
    May 20, 2009 at 19:49
  • 4
    actually, this one depends on the language, and & will evaluate all conditions (not shortcut). And I've seen many people use And (&) in VB instead of AndAlso (&&)
    – Lucas
    May 20, 2009 at 20:44
  • 2
    . . . Actually it will crash in VB.net too unless you use AndAlso re Lucas' comment May 21, 2009 at 8:28
35
votes

That my programming would be faster and better if I performed it alone.

2
  • But it cant get as ugly as Pair- Programming :-) except for maybe your code
    – Egg
    May 22, 2009 at 18:59
  • 33
    That all depends on the other person. =)
    – JohnFx
    May 23, 2009 at 16:14
1
2 3 4 5
7

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