Thursday, May 23, 2019

New comment by gremlinsinc in "Ask HN: Examples of bad open-source code to learn what to avoid?"

yeah, I'm working on one now (picking up where Indian devs left off) ... Code is laravel 5.2, every controller injects session, requests, etc into the constructor, then injects a 'manager' which is basically a loose repository structure, laravel 5.3 > somewhere makes it so using requests/sessions in constructor you generally want to wrap that in middlware...

So upgrading is a huge nightmare. This is one reason I'm not a fan of repository pattern, more classes to inject everywhere even when they're not fully needed. When just making a fatter model would suffice.

Also lots of bad php practices...everywhere else. Bad devs can work on any code base, but laravel core code is pretty beautiful, and laravel's community encourages better code, if some bad actors write shitty code the rest of us have to clean up that's on them, but woocommerce is owned by Automattic and has bad code, you'd think they'd fix it or something being a large company.

There's also tons of great packages out there that are written way more OO and with testing and best practices than there are for wordpress. Laravel is also easier to optimize, and the data structure for wordpress can get out of hand as well.

ltdr; Yes, lots of bad laravel code -- but that's on the individual dev, core laravel and lots of laravel packages use php best practices and encourage good coding. Easier to write better code in laravel than it is a wordpress plugin.



from Hacker News - New Comments: "WordPress" http://bit.ly/2VIBiF2
via IFTTT

No comments:

Post a Comment

NotebookLM hosts realizing they are AI

Article URL: https://twitter.com/omooretweets/status/1840251853327741138 Comments URL: https://news.ycombinator.com/item?id=41701037 Point...