logoalt Hacker News

lexojyesterday at 4:03 PM3 repliesview on HN

I don’t do laravel but which bad practices are you referring to?


Replies

ceejayozyesterday at 4:11 PM

50/50 chance it's a complaint about Facades, heh.

bakugoyesterday at 6:48 PM

The prime example I'll always reach for is the fact that it makes use of PHP classes to represent database entities, but not really - the """classes""" don't actually declare any of their properties, it's all dynamically injected at runtime from the database columns. You need a Laravel-specific IDE plugin just to get basic code completion and static analysis.

And yeah, there's also facades.

bojanyesterday at 7:33 PM

In addition to what /u/bakugo already said, they also have custom global magic functions all over the place.

The code discipline and patterns they encourage are so bad that they had to wrap PhpUnit into their own version of the unit test framework named Pest, because PhpUnit intentionally discourages those patterns natively.

show 1 reply