[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

is this PHP code beautiful code?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 13
Thread images: 4

File: Screenshot_2017-03-11_16-15-54.png (183KB, 1108x880px) Image search: [Google]
Screenshot_2017-03-11_16-15-54.png
183KB, 1108x880px
is this PHP code beautiful code?
>>
>>59353794
The ugliness of object oriented PHP is exactly why I don't touch it.

>that code is fucking ugly
>>
>>59353794
>php
>raw sql instead os stored procedures
>functions that return html
>>
File: 1489035965081.png (42KB, 625x626px)
1489035965081.png
42KB, 625x626px
>>
>line 5951
>hardcoding html
>no brackets in blocks of more than 1 line
>no error handling
>class doesnt know what it wants to be

Panjeet Systems (R) Certified Programer (TM)
>>
>>59353794
- $retrieve and the database connection should be parameters created by the environment.
- Are you sure the for() loop does what you want it to do?
- Don't mix html and PHP if possible. Is your class a Model or a HTML helper?
- Read about SOLID, DRY, etc..
- Do not use var.
>>
>>59353949
Stored procedures are only for special cases. If you are using a control version system just don't bother.
>>
>>59354244
>Stored procedures are only for special cases.

no they're not.
>>
>>59354795
DBMS optimizers made raw queries suck less.
>>
>>59354058
What's wrong with hard coding html
>>
>>59356879
Shit gets messy. You only need to pass back values of the vars.
>>
>>59356879
>"I want to change the way posts look"
Now you have to go and edit in 5 different functions because the post date, comment, post number etc returns the markup from all over the place.
>>
How is this? I took all of your advice and tried to apply it.
Thread posts: 13
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.