r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

2

u/[deleted] Apr 29 '14

Only skimmed the article but I'll add my two cents...

My big problem with the way sw devel appears to work is that people invest too much energy in the wrong part of the work schedule.

For me I'd rather spend more time laying out directories and setting up makefiles, and templating header files (to build an API from) than simply hitting the ground writing compiliable code. Even then I'd rather get to testing/documentation long before a complete project is ready to ship.

It seems to me though most would rather hit the ground running and deal with those pesky issues like documentation or QA when it suits them. The end result are projects that are a problem to test and hard to scale [with new developers].

31

u/quangdog Apr 29 '14

Testing? QA? That's what end users are for.

6

u/[deleted] Apr 29 '14

Ya seriously. It bothers me though that the idea of automated testing is seen as a "luxury" to many testers... they work with computers for fucks sake.

9

u/aladyjewel Apr 29 '14 edited Apr 29 '14

Yes, and running automated tests requires configuration (and knowledge on how to do that), both for your testing tools and the product you're testing. Voila, welcome back to the "there will always be darkness" block from OP.

It's a shitty excuse, but it's still valid.

11

u/[deleted] Apr 29 '14

The problem is two fold

  • Testing/documentation is hella boring
  • Sales/management don't care. They want shippable code as soon as possible. Spending weeks on automating a test suite is seen as a waste of money.

4

u/SHv2 Apr 29 '14

Non-value add is what I hear thrown around. :/

4

u/[deleted] Apr 29 '14

It's competing sides of the same coin.

  • Managers want to look as if stuff is flowing out the door
  • Developers want to be seen as not taking too much time and making the code hard to work on means that scaling becomes harder. Original developers become the focal point of all new work meaning they're "important."

Any good project should within reason scale and survive the bus test [re: your lead developer is hit by a bus, how fucked are you?].

The problem is scalability is often a problem for future you. But present you doesn't care about that.

4

u/UsingYourWifi Apr 29 '14

When explaining the benefits of automated testing to skeptical developers, the concept that seems to get the most traction is that tests are "features" written for the developers. It's creating a magic button that will tell them whether or not the code they've just written will result in them being woken up at 4 am to fix a live site issue.

3

u/[deleted] Apr 29 '14

I avoid the latter issue by not being employed by companies that require that.

2

u/Stormflux Apr 30 '14 edited Apr 30 '14

My biggest barrier to automated testing is that 90% of my code is either interacting with a database or passing views / json to a web browser.

At the Controller level, it's kind of pointless to test that "return View("Index")" returns a view called Index. We already know that's going to work, but now we have the added overhead that if we ever change it to "return View("Home"), the test is going to complain.

And at the Database level, the part that's going to go wrong (the SQL / Entity Framework statements) is abstracted away by Mocks and Fakes. So... what am I supposed to do?

3

u/UsingYourWifi Apr 30 '14

So... what would you say your code does here?

Is there any behavior that can be tested?

2

u/Stormflux Apr 30 '14

It talks to the database to the controller doesn't have to. It has people skills!!

2

u/dnew Apr 30 '14

The right way to do mocks is to test two levels down from what you're doing.

The JS tests that invoke the web server don't mock out the web server; they mock out the database.

The server tests don't mock out the database; they mock out the underlying file system.

If you're mocking what's directly underneath you, you're not going to get any benefit.

3

u/Omikron Apr 30 '14

The problem in my experience has always been a lack of 1. time and 2. give a shit by the people prioritizing tasks. Sure if I ran my own business and had no deadlines ever I could write perfect code with perfect automated tests and doves would fly out of my ass.

Instead I've got 5 different department heads all asking for 5 different features to be added to 5 different apps and they want it done 5 times faster than it would take to do it perfectly correct.

2

u/[deleted] Apr 30 '14

Ya that's why explaining the concept of scalability is important.

3

u/dnew Apr 30 '14

Remember the good old days? When "alpha" was the term for software you haven't shown to customers yet, let alone sold to them as an "early access" perk?

2

u/NormallyNorman Apr 29 '14

UAT where I work. It's management by firefighting committee.

15

u/chalks777 Apr 29 '14

I once believed the same thing.

Then I got onto a project with deadlines set by people who weren't actually developing.

6

u/[deleted] Apr 29 '14

It's called push back and credibility.

The only thing worse though then trying to convince management about spending time on QA is dealing with co-workers who lie about the need to do it in the first place.

3

u/chalks777 Apr 29 '14

I'm exaggerating a tiny bit for humor's sake. In reality, we have a core set of devs who really believe in testing and we've pushed back a LOT. Our boss is super understanding and does help out quite a bit on those sorts of issues. Unfortunately our client is government and when they write a check, you do whatever it takes to keep that money because it's BIG money.

Testing, QA, documentation... all are super useful and keep things running smoothly. It's really hard to do it right though when there are extremely sensitive deadlines.

5

u/[deleted] Apr 29 '14

In most cases an up front investment before things get dodgy prevents costs from scaling poorly.

For instance, an automated hit "go" to test an SDK suite from day-1 means as you hire new developers they can add to the project without fear of breaking everything. Whereas if you make testing cumbersome and problematic they will just not do it.

You actually save money/time/tears if you spend time at the start of a project lining shit up instead of hacking shit as quick as possible. The problem is management doesn't care (because they don't think that far ahead) and developers want to be seen as providing instant solutions.

edit: Also for developers it's job security.

13

u/rowboat__cop Apr 29 '14

Only skimmed the article but I'll add my two cents...

Just go back and read it all, it’s worth it.

7

u/lieronet Apr 29 '14

Skimming that article does it a disservice.