Earlier quoted context omitted.
It’s because it makes no effort to prevent people doing insanely insecure things. Rails has a lot of safeguards for insecure things like using user input to update a record. PHP won’t even fix bugs due to backwards compatibility. They worked out their sql string escape function didn’t escape properly but instead of fixing it and telling everyone to check their code, they duplicated the function and prefixed the name…
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”.
Nobody cares about your clean code
81–90 of 177 posts
Re: Nobody cares about your clean code
#82"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…
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.
Have you ever had that moment when you say: "Oh damn, now I got it! I should do it entirely differently!" — and then you code up a different approach, the approach that works well enough.
If you had this moment, it was the moment of throwing away the prototype.
Re: Nobody cares about your clean code
#83This is very true. END USERS in particular do not give a rats about clean code or the number of code reviews that have been done. They only care that it works. Technical debt, refactoring, reuse? Nobody cares except developers. The paying customer is all that matters.
Re: Nobody cares about your clean code
#84Earlier quoted context omitted.
> 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. When I'm at the prototyping stage, I don't yet know how to solve the problem. That means I need to iterate quickly, which affects my choice of language (Python) and the amount of time I'm willing to spend keeping code clean (very little, because I could hit a dead-end at any point). But once I have a wor…
Is this stealth promotion for Go?
Re: Nobody cares about your clean code
#851) never shipped
2) does not make money
Re: Nobody cares about your clean code
#86If you don't care about clean code, you don't care about collaboration. Projects that don't care about collaboration don't scale.
Projects (and companies) that never ship or ship too late also don't scale. In my experience, it's much easier to overbuild than it is to underbuild. I definitely agree that collaboration is essential though!
Re: Nobody cares about your clean code
#87"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…
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.
To me, "I write my first line of code as if it's going to be on production forever" means setting up a testing infrastructure, a reproducible build that can be automated, a CI that runs my tests. An auto-commit system where I can create a PR and submit it to the CI and if it passes it will automatically get merged to main, etc...
Instead of my lamp project taking 1-3 hrs it would have been a week of setting all this up before I was ready to write my first line of actual code.
Are you saying you'd actually take that week? Would you therefore never write something on shadertoy because it's missing all that infrastructure and you can't write code as if it's going to be in production forever?
Re: Nobody cares about your clean code
#88Re: Nobody cares about your clean code
#89John F. Woods (who I actually knew IRL briefly - nicer guy than his online reputation suggests) said it best. "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." I'll just add that the psychopath in question might be your own future self.
Oh boy... I believe I'm this kind of psycho, when I see my name in a git blame after tracing a bug that I didn't foresee... I feel awful, disgusted, then I fix it and think "You sure are dumbass, now try to be a lesser one".
Re: Nobody cares about your clean code
#90I think it's ironic that the author claims that clean code is....... Package your code down into small, atomic and reusable units Follow the single responsibility principle Use frameworks and libraries to avoid reinventing the wheel Whatever language you pick, don’t pick PHP These are best practices. It is possible to follow every one of those rules and still have a pile of broken, insecure, garbage code. Likewise yo…
That's partly the reason why the term "best practice" has become a bit controversial in some communities --- it's seen as mindless dogmatic cargo-culting. I've heard the saying "best practices are best not practiced" from the opposition. There is nothing more frustrating than working on a codebase that puts 12 lines of code in each file and then spreads that code into 1,000 files. In other words, "Enterprise" code, w…