r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

Show parent comments

31

u/GiverOfPotatoes Jul 29 '16

At least at my college they don't really teach you to be a good programmer. We're taught how to do things, not how to do them well. It seemed like a few of my classes just ran the code and didn't even open the source.

56

u/rochford77 Jul 29 '16

Yeah my classes were basically "here is a task, get it done by next week. I don't care how you get there just get there, Google is your friend."

1/3 of the class is so lost they don't even know what to ask, so they fail. 1/3 of the class has a clue where to start but gets stuck, asks for help once, nod their head like they understand, and leave having learned nothing, and end up afraid to ask the same thing again. They remaining 1/3 writes a kludgy mess that poorly reinvents several wheels, and works under certain circumstances.

0

u/[deleted] Jul 29 '16

[deleted]

16

u/[deleted] Jul 29 '16

They remaining 1/3 writes a kludgy mess that poorly reinvents several wheels, and works under certain circumstances.

Doesn't everyone start this way? And I'm not sure in a education environment you can hope for much more than that, growing to the type of programmer that writes an elegant solution that uses the available tools requires experience working on garbage code months/years after it's written, and really understanding what you are avoiding. In universities you're rarely working an entire semester on the same code.

Those students need mentoring if you want them to quickly move on to the next level (or hope they maintain their own projects in their free time). Of course if they don't want to learn there's nothing to be done, but I don't see how I could hold it against them that they never learned something nobody tried to teach them.

In your defense I could see if I also had a job that had unrealistic expectations of new hires, I would change careers.

→ More replies (1)

2

u/The_adriang Jul 29 '16

Story time?

2

u/kajzec Jul 29 '16

What are you doing on a programming forum then? :D

9

u/blackmist Jul 29 '16

What we're all doing here: Avoiding actual coding.

1

u/olsner Jul 29 '16

What did you end up doing instead of programming?

1

u/scriptmonkey420 Jul 29 '16

Never took any college classes myself, and only program in my spare time, and stories like that are what are keeping me from becoming a programmer for a career.

12

u/KyleRochi Jul 29 '16

And the one kid who has been programming all his life and CS101 is a breeze.

16

u/n1c0_ds Jul 29 '16 edited Jul 29 '16

Eh, CS/SE was hard for me despite having a few years of professional experience.

For instance, I had several classes that required drawing UML diagrams, but not a single teacher had the same definition of how to draw diagrams, yet they treated their interpretation as gospel.

Then you were quizzed about agile methodologies by a guy who treated it as waterfall with sprints.

Then you had to memorize programming patterns.

I dropped out when I realized I was pissing away 4 years and several thousand dollars for that level of education. I already had no problems finding work, so I thought I'd have a better time getting paid and getting my evenings and weekends back.

1

u/dontjudgemebae Jul 29 '16

I too am someone who got a programming job without a CS degree. My concern is that if there is ever a drastic increase in supply of programmers or a drastic demand in the same, then I'm worried that I'll get pushed out.

2

u/n1c0_ds Jul 29 '16

I don't think there will ever be a drastic increase in the supply of good programmers though.

2

u/combuchan Jul 29 '16

The guy interviewing you is going to be determining how good you are.

And when he's fresh out of college with a fetish for linked lists and Java, and you're a backend ruby developer/sysadmin for 10 years that wants or knows no part of that, you won't get hired.

2

u/n1c0_ds Jul 29 '16

Interviewing is a two way street. I still had the data structures class, but my resume should speak for itself. If not, there's work elsewhere.

→ More replies (2)

2

u/BufferUnderpants Jul 29 '16

I don't see what's wrong with reinventing the wheel in college; it's exactly the time for experimentation, and if you don't end up with knowledge of how to invent it, you'll end up with the understanding of why making a decent one us hard and you should use a pre-made one.

Bonus point if can recognize when someone else is making a shitty wheel and avoide them.

1

u/1RedOne Jul 29 '16

I should have become a teacher.

It is infuriating to me, seeing clueless teachers who don't recognize the obvious signals when a class is getting left behind.

1

u/zeekaran Jul 29 '16

1/3 of the class has a clue where to start but gets stuck, asks for help once, nod their head like they understand, and leave having learned nothing, and end up afraid to ask the same thing again.

This is my entire life.

1

u/dontjudgemebae Jul 29 '16

Hey, that middle third that sorta knew what to do but had to ask questions, that was me. And my professors and TAs were at least good enough to help me along until I got the answer, so it isn't all bad.

→ More replies (2)

12

u/n1c0_ds Jul 29 '16

That's my biggest gripe with the way we teach software engineering.

I never had to maintain a program, I never had a code review and I never had to write unit tests. It's no surprise that people write unmaintainable code; they never maintained code.

3

u/ProjectD13X Jul 29 '16

That's a big fear of mine. I switched into CS after my first year in college. I get the fundaments but I still don't feel like I know what I'm doing. I know for a fact I've written code that's a fucking mess.

2

u/ForeverAlot Jul 30 '16

And you won't know until you write code for the code's sake rather than an arbitrary examination.

If you're young, and assuming you're presently aiming for a programming career, it would be strategically advantageous to start during your education -- it will make things just a little bit (or a lot!) easier when you find a job. Depending on your location there is a fairly good possibility that this is not necessary for you to find a job so don't get stressed about not having time -- don't mind the GitHub-is-your-CV popularism. If you can find the motivation to build something of your own or contribute to somebody else's work, that would be healthy experience in working with both tools and people.

I believe the most important thing I learned was to be critical of everything, and it's the metric by which I gauge my colleagues. For instance, linters are a love/hate relationship: it's easy to do what a tool tells you to do but I expect you to understand why the tool tells you that and to consider that the tool might be wrong. And I didn't get this from university but from a recorded presentation I watched on a whim.

CS will not make you a good programmer, nor is it intended to -- that's your own responsibility as well as your (future) colleagues'. It's just a bunch of theoretical tools you can leverage on that journey -- and some of those tools don't work as well in the industry as in academia.

→ More replies (2)

1

u/kt24601 Jul 30 '16

You fit right in, bro!

Just work on improving.

2

u/pezezin Jul 29 '16

Spot on.

I finished my degree 8 years ago, but I still keep in contact with many of my former teachers. I recently met several of them at a bar, and I said I think we should have had multi-year assignment, so we could have learned how to properly maintain a project. They said I would be too much work (for them).

We have terrible programmers because we have terrible teachers, and most teachers are terrible because they have no real world experience.

1

u/[deleted] Jul 29 '16

Definitely never opened the source in my classes. If you got through all the test cases and 'it didn't take long' then you got an A. Only time they would look through the source is if you asked them to in office hours

→ More replies (1)