Live data from Hacker News

Nobody cares about your clean code

felipecsl.com

121–130 of 177 posts

Re: Nobody cares about your clean code

#121

Earlier quoted context omitted.

Rails is not a language. PHP maintainers do fix bugs. I don't use PHP right now, it's not my favorite language, but I hate when people are trying to excuse their own laziness and incompetence by saying “it’s all because of tool X”.

Rails and ActiveSupport are a huge extension to Ruby and are bigger than the non Rails Ruby usage. If you read the average PHP tutorial, it starts you out connecting to a db, running raw sql and rendering templates in the same file. An absolutely horrible idea. If you start on the default rails tutorial, you gets set up with a decently safe configuration.

> An absolutely horrible idea

It's not a horrible idea, it's the simplest and easiest way to solve simple problems. Bringing in rails and all it's abstractions for something you can do in a single php (or ruby BTW) file is insane.

Re: Nobody cares about your clean code

#122

"Users couldn't care less about the programming language you used", and yet the author is so protective of his work that I can't copy paste this phrase. Unhappy user right here. We code for ourselves. We deliver value to the costumer. Two different things.

> Unhappy user right here.

I'm more pissed off that my user agent (firefox) even allows this sort of control by third parties.

Re: Nobody cares about your clean code

#123

"throw the first one away" When I'm prototyping or hacking something together, I don't write tests, I don't comment/document much, I use lots of shitty variable/type names, lots of commented out code, debugging printfs, not much organization of files (often one large file). The prototype software is write-once, read-maybe. Maybe I'll want to see what I did down the road, but more likely I'll be shortly rewriting what…

> The prototype software is write-once, read-maybe.

"aaaand, I'm going to need to pull you off of this xyzzy, and put you on this high-priority-showstopper-stop the presses project ..."

and then 10 years later you're writing this blog article where you explain where someone else shipped unfinished code and ...

Re: Nobody cares about your clean code

#124
post #97

"throw the first one away" When I'm prototyping or hacking something together, I don't write tests, I don't comment/document much, I use lots of shitty variable/type names, lots of commented out code, debugging printfs, not much organization of files (often one large file). The prototype software is write-once, read-maybe. Maybe I'll want to see what I did down the road, but more likely I'll be shortly rewriting what…

Not a good idea. That is not a good idea of you let anybody in a management role see your prototype. It will be the product. They will start selling it straight away. If there are any problems, you, my dear young and foolish friend, will be the one at fault. It is your wonderful self that will staying up all hours desperately trying to fix the problems. Otherwise peachy!

> hat is not a good idea of you let anybody in a management role see your prototype.

That also goes for your REAL goals or technical debt or other list of minor-todos you've created. They will meddle. They can't help it. Only give status/etc for clear goals.

Kind of like the driving test. Of course you don't break the speed limit pass the person weaving in the lane ahead of you. (but irl you do, and you should)

Re: Nobody cares about your clean code

#125
post #121

Earlier quoted context omitted.

Rails and ActiveSupport are a huge extension to Ruby and are bigger than the non Rails Ruby usage. If you read the average PHP tutorial, it starts you out connecting to a db, running raw sql and rendering templates in the same file. An absolutely horrible idea. If you start on the default rails tutorial, you gets set up with a decently safe configuration.

> An absolutely horrible idea It's not a horrible idea, it's the simplest and easiest way to solve simple problems. Bringing in rails and all it's abstractions for something you can do in a single php (or ruby BTW) file is insane.

The easiest and simplest way is not the most secure way. Most of the beginner PHP tutorials show you something that technically works but should never ever be attempted on a real app. The problem is they do work so they get used with real users data.

Re: Nobody cares about your clean code

#127

Earlier quoted context omitted.

When I'm prototyping or hacking something together, it eventually becomes production. I cannot relate to people who make prototypes to throw away, I've never done it, and I don't know why I'd do it. Due to that, I write my first line of code as if it's going to be on production forever, because it will.

Currently on a project initially written with throwaway code. It became a production project. The code survives to this day and we don't dare poke it too much.

This. However for the last while I’ve been using a language on the front end that let’s me prototype ideas with a slightly higher up front cost and then when it ends up in production it’s close to bulletproof and easier to refactor (not that I always get the chance, but I still feel safer knowing it probably won’t break).

Then if the code / project / product refuses to die (success!), I can come back some day and refactor without being scared to dig in again.

So even though my original code is a bit messy, I’m not scared to change it a couple years later.

Re: Nobody cares about your clean code

#129
Best analogy is coding is like writing.

Lots of people think they are good authors. They will write novel upon novel. L Ron Hubbard wrote more than anyone and it was all garbage.

You have new coders (less than the few years it takes to go down enough dead ends and see what works and what doesn't work) who think their code is good but it's just the worst. They are like novelists writing crap stories with a sex scene between a navy seal and a sexy scientist with big boobies.

The only good code is code with no ego but not so little ego that's it's dogmatic about not having an ego.

These last few years I've seen the barrier to entry be lowered for programmers resulting in even more terrible code written by people who think knowing Angular is the zenith of good code.

It's all bad. You can't tell them it's bad.

It's actually worse than millions of bad novelists because you have to use third party code which is also bad so even good programmers have to use bad code. There's just no winning. So while you bang your head against the wall for three days getting dependencies to work with your brilliant creation and it stretches your probably strong brain to its limits just remember your boss, who gets paid more than you and gets to think big picture, didn't have to learn ALLLL the stuff you did and doesn't care about how much you know as long as the end result is good enough.

Only idiots write software these days.

Re: Nobody cares about your clean code

#130

If you are a single developer , sure, knock yourself out, and stick everything in a single file. If you actually ever plan on ever having other developers contribute to and maintain your code, or god forbid multiple teams of developers, you better have things structured in a way that they can understand.

I had to dig into a niche TLS library a few months ago and was aghast at the 50000 line source files with massive God functions all over the place. I don't know how it ever was allowed to get that fubared or how they maintain it all.
Post reply on HN