Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "php psr-2"
-
so the PHP Standards Recommendations part two (PSR-2) says
"Code MUST use 4 spaces for indenting, not tabs."
and i feel devastated1 -
Ok, so I know that in PHP, psr2-4 are good for making sure your code meets a good standard, but I'm somebody who did most of that rules with minor differences without thinking 10 years before they were created and when somebody points out that my code isnt psr compliant because i wrote
if($something === 0){…}
Instead of
if ($something === 0) {…}
I get fucking angry....2 -
I'm really tired of all the hype that Python lately gets, mostly by begginers or at most mediors.
I get that a lot of people like it's syntax, but it has just a few use cases where it really shines (like CI scripting or ML). In other cases it always has a much better and much more mature alternative.
As a web developer I would always pick PHP over Python. It has really mature frameworks like Symfony or Laravel which are using PSR standards, well documented and implemented common patterns, option for strict typing and probably most importantly tons of libraries for pretty much everything. For example I could find implementation of payment gate for even the smallest banks in our country, thus saving several days of implementing it myself. And PHP will always humiliate Python in performance. Yet, pretty much every comparison article of those two will state Python as better option for webdev, mostly because it is evident that the person who wrote the article never even tried to do a proper atleast midsized project in PHP, but has ton of experience in Django.
And what exactly is my point? There are two in fact:
1) You should always use the right tools for the job.
2) Even if you could do something doesn't mean you should do it.
In the end of the day I shouldn't really be bothered by people hyping Python, but those fanatics really made me hate the language, even if I would normally consider looking into it.8 -
Question PHP folks. Is it a standard to write:
public function hair()?
Writing only:
function hair() is just the same thing to the above. It will default to "public" hair right? 🤔 maybe just a PSR-2 standard or for readability? Thanks!3 -
So I made a pull request on a PHP public repo fixing line lengths and adding some spacing for readability. All in the hopes of improving it to follow PSR-2 standards which they specifically say they follow.
Pull request got rejected, reason: "No thanks, the code is good enough."
Lol! 😐Time to move on to others who appreciate help. -
Am I the only person pissed off with PHP PSR-2? Maybe I like coding with snake_case instead of camelCase. I don't care what other devs use so why do I have a gang of controlling ass-hats telling me how to write my own code!?! >:(4