R
R
Romi2021-10-29 18:02:04
PHP
Romi, 2021-10-29 18:02:04

Is there a PHP textbook that describes a programming style close to the standard?

I have a problem: I can write working code, and there are no problems with this, but if this code gets into a more or less picky review, it is often smashed to smithereens))

At the same time, the reviewer often refers to some unknown to me standards and rules, which, they say, "everyone already knows" :-)

So I thought:

- Is there a textbook somewhere with such rules, following which you can write such code that no one reproach?

No, I understand perfectly well that you can find fault with any code ))))))) Why in a helmet? Why no helmet? Why in brackets? Why no brackets? ))

But nevertheless. Is there such a book on PHP, and what is it called?

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-10-29
@romicohen

At the same time, the reviewer often refers to some standards and rules unknown to me, which, they say, "everyone already knows" :-)

This is a bad review, and any standards and norms should be referred to.
- Is there somewhere a book-textbook with such rules, following which you can write such code, which certainly no one will find fault with?

No, there is no standard.
There are general rules about architecture and OOP: clean architecture, ports and adapters, MVC, CQRS, SOLID, GRASP
There are general rules about code design: clean code, perfect code (they contradict each other a little), KISS, DRY, YAGNI.
And to make it less nit-picking for reviews:
1. Implement the codestyle and control it using all sorts of automatic tools
2. Describe the architecture in some internal documents in the project (you can shove it right into your turnip), and rely on these documents when implementing features.
3. Give normal variable names, and avoid any code smells and anti-patterns
4. Write tests

S
Siverius, 2021-10-29
@Siverius

Can you give an example of such references to unknown standards or an example of code that has not been reviewed? If it's not a PSR

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question