Live data from Hacker News

How terrible code gets written by sane people

chrismm.com

31–40 of 151 posts

Re: How terrible code gets written by sane people

#33

a good programmer should be able to identify bad companies to work for, which could solve many of the issues displayed in the article. it's much like choosing a good life partner - choosing a good life partner (instead of a crazy one) will save you from many troubles that you would encounter if you married the wrong person in the first place. ps: i need to tell this more to myself. i already made bad choices regardin…

I think a lot of this sentiment overlooks the fact that in most cities the number of software companies is very limited - perhaps allowing one switch in a career if there are huge problems or conflicts, but certainly not enough to allow switching due to e.g poor development practices. What's worse, in these places the poor devs tend to stick around while talented ones leave because they either accept moving or they can find remote work due to good connections or nice SO/GH profiles.

Re: How terrible code gets written by sane people

#34

a good programmer should be able to identify bad companies to work for, which could solve many of the issues displayed in the article. it's much like choosing a good life partner - choosing a good life partner (instead of a crazy one) will save you from many troubles that you would encounter if you married the wrong person in the first place. ps: i need to tell this more to myself. i already made bad choices regardin…

Given that "bad programmer" is a loaded term, I really don't think it's a good idea to expand it so much.

Re: How terrible code gets written by sane people

#35
post #21
post #17

Earlier quoted context omitted.

Code should be reviewed, preferably by a different group of people who wrote the code, metrics are only useful for people to manage themselves. Upon review there should be immediate feedback to people who wrote it and if they continue to make the same errors, then you should eventually get rid of the person who wrote it. Making up stupid systems of control to "incentivize" people as a method of management is the stup…

>is the stupidest thing rationalists ever cooked up. Oh, you don't like bonuses then? Unsolicited, forced code review doesn't have much value that I've found, unless your team is fairly junior. Senior guys know what good code looks like, even in a crunch. If you hold forced, unsolicited code reviews with senior developers, you are really just throwing away money and aggravating people. It's just another half thought…

A reviewer soon understands that senior devs are producing good code and stops investing time on reviewing their code. If they are doing their job properly. But again it comes down to internal motivation and self management on their part.

Re: How terrible code gets written by sane people

#36
post #28
post #26

Earlier quoted context omitted.

I sympathize with this, but perhaps it is really more economical to write software like this in your company's case (?)

It appears that way short term, but long term, having a bad codebase can retard a company's growth through lack of scalability and maintainability (read easily add/remove/change features). Companies spend a hell of a lot of money for growth. If they don't know how to manage software development, then the software will nullify all that cost spend on growing, because the system can't handle it. I am truly amazed at how…

> It appears that way short term, but long term, having a bad codebase can retard a company's growth through lack of scalability and maintainability

Still, it depends on the specifics. Many, many projects get redone/canceled/completely respecified after first contact with market / customer. Many are also canceled for reasons that are independent of the progress speed. For all these projects, speed-to-market has value, and long-term-maintainability has absolutely zero.

The horror arrives when, in a successful project, you realize that you are going to live with the hastily, horribly, developed project for some time to come. But these might be the exceptions - depending on how you count, some stats claim 80% of software projects get cancelled before completion (Have no idea how they define that)

It's a balancing act.

Re: How terrible code gets written by sane people

#37
post #28
post #26

Earlier quoted context omitted.

I sympathize with this, but perhaps it is really more economical to write software like this in your company's case (?)

It appears that way short term, but long term, having a bad codebase can retard a company's growth through lack of scalability and maintainability (read easily add/remove/change features). Companies spend a hell of a lot of money for growth. If they don't know how to manage software development, then the software will nullify all that cost spend on growing, because the system can't handle it. I am truly amazed at how…

> I am truly amazed at how bad many US businesses are at managing their software systems.

I'm guessing you'd be equally amazed at how many people are embracing rigorous software engineering principles, and not ever reaching the point of getting a viable business off the ground.

So, perhaps the best way to go about it is to sell "prototypes" at first, and then when the business catches on, hire some CS people to manage the mess.

Re: How terrible code gets written by sane people

#38
Honestly, I think the best developers are not the ones that write beautiful code and put quality above everything else. The best ones are the ones that can push out a solution given too little time and given a (maybe self inflicted) bad code base. Because that's real life, and not the pony farm. Money trumps everything else in capitalism. Getting money means paying your bills today. And even more so than skill, quality and code getting money requires kowtowing and overpromising to someone who currently has money.

Second comes qualifying for the money (yes, in real world you get money without having what you are selling, but that's a short-term success). That means getting to ask for money again tomorrow. That is where skill and code come into play. You promised something and now when you are lucky you can deliver 80% of that. Push hard to get there. Not everybody who tries will achieve that much.

And only then comes quality, which means qualifying for money next year becomes cheaper.

If you realize LIFE is that way, suddenly high quality isn't all that important anymore, is it? Quality is a luxury and you must have achieved A LOT to be in a position to just think about quality. And the ohter people (management, sales) are not total idiots. If you dream the high quality dream they are the people who pay your bills.

I am an engineer like you, btw. I was just in the situation already, where I had to pay my bills myself and therefore know what amount of humiliation and sweat is required to get money just for ONE person, me.

Re: How terrible code gets written by sane people

#39

a good programmer should be able to identify bad companies to work for, which could solve many of the issues displayed in the article. it's much like choosing a good life partner - choosing a good life partner (instead of a crazy one) will save you from many troubles that you would encounter if you married the wrong person in the first place. ps: i need to tell this more to myself. i already made bad choices regardin…

I think a lot of this sentiment overlooks the fact that in most cities the number of software companies is very limited - perhaps allowing one switch in a career if there are huge problems or conflicts, but certainly not enough to allow switching due to e.g poor development practices. What's worse, in these places the poor devs tend to stick around while talented ones leave because they either accept moving or they c…

you are removing a lot of personal responsibility from the guy who is looking for the job. If you are born in a 'bad' place (regardless of the reason for it being 'bad' - a violent/poor neighborhood, a city without hope for jobs, a small country-side town with no tech industry at all, etc. etc.) - you should be responsible for improving your life/moving to a better city/etc.

to analogize from soccer: Messi plays at Bercelona, but is from argentina. Ronaldo plays at Real Radrid, but is from portugal. if ronaldo stayed in portugal, which teams would he be able to play with that would even become close to matching real madrid ? same goes for messi and barcelona. he could have said something like 'i was born in argentina, and no one here plays soccer like barceolna/real madrid. therefore - i will not play soccer because i was born in the wrong place'

Re: How terrible code gets written by sane people

#40
I like the article but I found the implied solution a little humorous.

Just hire devs who are great coders, great communicators, stubborn enough to push back against upper management, good hearted enough to sacrificed their own KPIs to focus on the success of their project, and massochistic enough to stick it out at an obviously poorly run project.

Good luck

Side note, for 15 years of experience the project doesn't seem that bad by a long shot. I only have ~7 years of experience and have seen some far worse code. I was just recently on a project that has some methods that take 8 call backs(project was greenfielded in Jan 2016) before that I was on a project where the development team copy and paste the source for the last web page every time they needed a new one, but not delete the initialization code that fetched the data from.the database. So the 18th screen they worked on had 26,000 lines of code and took 5 minutes to load. And every button click triggered a reload. So, add a new widget and boom, wait 5 minutes for a screen refresh.

Post reply on HN