Depends on if you generate documentation through annotations in which case comments are good and very much needed, not the single line ones but phpdoc.
If you give examples of code I'd try and adhere to general standards which include not starting a file with <? But <?php. For beginners it's pretty crucial to not let them assume it's good to start with short tags 👍
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
I choose <? instead of <?php because language is accidental.
I don't want to be tied to a particular language, could have been Js, Java etc.
I don't want articles targeted to php community. That's why I don't suggest php doc.
I don't think documentation is useful if you are declarative enough
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Depends on if you generate documentation through annotations in which case comments are good and very much needed, not the single line ones but phpdoc.
If you give examples of code I'd try and adhere to general standards which include not starting a file with <? But <?php. For beginners it's pretty crucial to not let them assume it's good to start with short tags 👍
Other than that nice tip
Thank you very much for your comments
I choose <? instead of <?php because language is accidental.
I don't want to be tied to a particular language, could have been Js, Java etc.
I don't want articles targeted to php community. That's why I don't suggest php doc.
I don't think documentation is useful if you are declarative enough
Everything in this post points to PHP.
I heavily disagree with no documentation. Just because you know what's going on doesn't mean someone that comes to a project later on.
That's why you need to write declarative methods, classes and attributes.
Methods are alive. They are maintained . They run with the tests.
Nobody maintains documentation. And nobody reads them
That's why tests are for.
They are alive, they are maintained and they don't lie