Substitute software engineering with any other engineering descipline with "I stopped worrying about best practices" and you will be able to see what's wrong with your approach. But then again, if it's php, your domain doesn't require too much care.
It's not being more productive, it just seems that you're getting things done faster because you're taking out a loan on the quality of your software (i.e. technical debt) with every line you write.
Management may be willing to spend that time and not be unhappy with what you perceive as time wasted because they have seen greater than expected ROI on the product already so it's not a loss to them.
1. Code you wrote you cannot understand a week later - no comments.
2. Code with no specifications.
3. Code that is shipped as soon as it runs and before it's beautiful.
4. Code with added features.
5. Code that is very very very fast and very obscure.
6. Code that is not beautiful.
7. Code you wrote without understanding the problem
I do not look down on any programming language. What I meant there was that php is often used for Web applications. Not server side performant critical or security critical components or systems programming. There's also a practical reality that some kind of coding doesn't require too much regulation on how we need to write code. I realised that bit came out wrong but I couldn't edit it.
In fact I'd say that until someone is able to quantify the revenue lost and be able to directly tie it against the choices you are making then stay the course.
- Use long expressive variable/function/class names that tell me exactly what this variable/function/class does
I have to constantly fight the urge to have code fit in the littlest amount of space possible.
I do this to some degree - I pick and choose my best practises because, quite frankly, some "best practices" are actually bad IMHO ("anti-patterns").
This is sometimes very context-dependent, but I'm now more sceptical of adopting a common practise that I personally haven't seen the benefit of.
e.g. YAGNI:
Maybe the problem isn't YAGNI, but that you keep building useless shit. Rather than assume things aren't needed in general, maybe work on why your predictions on what YGN are so poor.
Sometimes, the stuff I predict I'll need Are needed after all, and I was glad I started early. Projects can live and die on the how perceptive wrt future changes its devs are; this is just a developed skill, no maxims needed.
The point of 'really really need to' has long been passed and you didn't notice it.
(Unless you use an entry-level $200 notebook for development, which you probably don't.)
In other words, please please eat your own dogfood. Your users aren't browsing your 'amazing websites' with a development notebook.
Though I'll agree with you on two points - boring old technologies and searching Stack Overflow.
Optimizing code is something you don't need to worry about a lot of the time. Having understandable code is a lot more important in my opinion, but you don't seem to care about that.
In saying that there are plenty of jobs where code doesn't need to be maintained. Most bioinformatics research just need to produce a graph or heatmap and gets used once, so maintainability isn't so important.
Also - as long as your code is written to be easily readable and refactorable, refactoring can be done when needed. It’s dense complex code that’s too tightly coupled that’s the long-term burden.
It’s often about how the code fits together rather than the individual syntax itself.
I have not used OOP or programming patterns or whatever for years and no one got hurt. In various code bases I never used inheritance (abstract classes) or method/dependency injection or whatever someone might ask me in an interview.
The code I copied from elsewhere would just get adapted to the company (Spartan) style and that's it.
Depends on the team. If it’s a team of code ninnies that hem and haw over the “correct” way to do something while deadlines are missed, this is bad. Worse even than ugly code.
Balance. There has to be balance.
Be kind on yourself, your teammates and whoever follows in your footsteps down the line and spend some time tidying up after yourself if you're not building throwaway things as personal projects.
If it is for a team, you need to take into account if other people can understand your code. Practices like SOLID and just using the type system well don't make it slower to write code but will help maintenance down the road.
Yet, I find most of the code snippets posted to Stackoverflow to be garbage. I despair if these are being copy and pasted into production stystems :(
Found the Magento developer.
- I stopped worrying about best practices and just do it.
- I hardly refactor my code unless I'm using the same thing for the fifth time. I just copy-paste it instead.
- I never think about optimizing code until I really really need to.
- I write what gets the shit done quickly. I don't care if writing a Class would have been better than a function.
- I love old boring technologies and believe you can still make amazing websites with just PHP and jQuery.
- I don't come up with clever one-liners anymore. I write a 10 line for loop which I could easily replace with a clever one-line code golf.
- Instead of writing my own code, I usually search Stackoverflow first to see if I can do some copy-paste it instead.