| « Prev | Page 1 | Page 2 | Next » |
Re: The MySQL Wrapper Wrapper
2012-07-12 17:35
•
by
'Sam 'Smith
(unregistered)
|
Thi's i's 'so true! 'So many folk's 'suppo'se language i's 'simple. 'Still, if there i's 'some trivial 'syntax rule you mi's's, or ju'st don't under'stand, you end up looking 'so 'stupid! |
Re: The MySQL Wrapper Wrapper
2012-07-12 18:11
•
by
Someone, but not the other someone
(unregistered)
|
|
Uhm....(leaving aside the rest of this WTF) the last comment about the consistent misspelling of Query....
While it grates me to see qeury instead of query, one of the most important principles of readable code is consistency (more important to be consistent than correct in choosing conventions and variable names). If anything, this at least is a good thing.... |
Re: The MySQL Wrapper Wrapper
2012-07-12 18:14
•
by
Bilongda
(unregistered)
|
Er...I thought London only had two weather patterns anyway...."Raining" and "about to rain" - which one is the March or April one? |
|
Sorry I'm off-topic, but I just got this in a captcha.
|
Re: The MySQL Wrapper Wrapper
2012-07-12 18:20
•
by
phillipe
(unregistered)
|
It's funny how on auto-pilot you can make silly mistakes like that....if I'm a little distracted, I often replace A with 8 and vice-versa. Sort of illogical, given other than the sound they are nothing alike, and yet the brain seems to do that sometimes.... Maybe I gotta give up C and go PHP if my brain is failing me.... |
Re: The MySQL Wrapper Wrapper
2012-07-12 18:27
•
by
phillipe
(unregistered)
|
Oui "Damn Foreigners - can't go anywhere in the world without meeting any" - Antony Aloysius St. John Hancock. |
FTFY. |
Re: The MySQL Wrapper Wrapper
2012-07-12 23:32
•
by
Doctor_of_Ineptitude
(unregistered)
|
Qeury Farie, I like you. You are a lot more tolerable than Fake Nagesh and his sock puppets and their sock puppets. As a fake Indian I become bored of all the garbage that Nagesh has spewed. Thanks for being a being of incorrect spelling but somewhat correct grammar. Captcha:populus. I hope you are populus too. |
|
I'm clearly very very far in the minority on this, but depending on what kinds of places it's used, I'm kind of okay with the function's return value changing.
The alternative is to always return an array of arrays, and then to unwrap it after every use that expects a single row. (I can't think of many good options here, other than selecting the most recent x by ordering and limiting 1?) When you're doing that, and your query fits your expected pattern, unwrapping the single result is not the most horrible thing to do. Yes, it would be better to just have an overload like query_single that unwraps it for you, but for something you knock out quick, because you DON'T want to build an entire framework.. I don't see anything egregious about this. |
Re: The MySQL Wrapper Wrapper
2012-07-13 02:31
•
by
AndyCanfield
|
I am tired of the anti-PHP thunder. I code in PHP because it's better than the alternatives (C, C++, Java). The anti-PHP pages talk about weird syntax, but you don't need that syntax and live without it. Sure I've got wrappers; about 15,000 lines of wrappers that I've developed over ten years and re-use constantly, including DB.inc, Object.inc, and PickList.inc. (FYI I work alone, not on a team. YMMV) |
|
Mistype $qeury once; every time after that it's $q<letautocompletedotherestforme>.
|
Re: The MySQL Wrapper Wrapper
2012-07-13 04:16
•
by
qwz
(unregistered)
|
What if the first word in your select query is WITH? |
Don't know what to think of a guy that was responsible for a language that opens modal dialogs to show "compiler" errors. |
|
Waving the BS Flag on all the "kudos for recognizing the need for a PHP SQL wrapper."
I know bupkis about PHP but after 2 minutes reading this I can say convincingly "Well, everyone knows PHP needs a good SQL wrapper." This "nice try" is a true WTF because a) it is crap yet 2) he put it into production on a "paid gig" which means d) he's unprofessional, incompetent, and probably dyslexic. |
Re: The MySQL Wrapper Wrapper
2012-07-13 16:32
•
by
big picture thinker
(unregistered)
|
Yes he actually does say that if you scroll down... |
Re: The MySQL Wrapper Wrapper
2012-07-13 18:16
•
by
the irritainer
(unregistered)
|
|
Trfwtf is not that its php or that the code is that bad. Im not saying its great either but this codemonkey at least understands the basic principles on how to deal with queries. Ive seen way worse...
The real wtf is the submitter for not doing a code review during the interview. Php is a powerfull language in hands of those who know what theyre doing! Captcha: i typed this from my new tab, sorry for spelling errors |
|
Gee, he's invented everything, inclueding his own kewl turmenology.
|
Re: The MySQL Wrapper Wrapper
2012-07-14 03:55
•
by
nico
(unregistered)
|
|
You 'Sir, ju'st made my day.
|
|
TRWTF is that drupal's codebase isn't much better than that
|
|
I have wrapped your mysql lib. Pray I don't wrap it any further.
|
Re: The MySQL Wrapper Wrapper
2012-07-16 03:05
•
by
John
(unregistered)
|
|
Did you ever stop to think that maybe this was wrote before PDO or the prevalence of frameworks? There was a point in time where you pretty much had to if you wanted something sane to work with. However, if this was wrote in the last several years I'll agree with you. Even if it wasn't the developer needs to be slapped for doing such a shitty job.
|
Re: The MySQL Wrapper Wrapper
2012-07-16 17:21
•
by
iWantToKeepAnon
(unregistered)
|
|
This isn't WTF code, this is newb code. Sure it's bad, but not WTF. I've noticed almost all the code snippets recently are not WTF, just bad ... not evil bad. This list is turning into experts looking down their noses at the less advanced programmer.
Sure a lot of these bad programmer think "mine will be better", but that shows (misplaced) confidence. Sigh. |
Re: The MySQL Wrapper Wrapper
2012-07-17 11:39
•
by
noone
(unregistered)
|
|
Except he was paid for this code so the newb defense is invalid.
|
Re: The MySQL Wrapper Wrapper
2012-07-31 09:50
•
by
Thomas
(unregistered)
|
(SELECT 1 + 1) UNION (SELECT 1 - 1)
But if won't work as you'd expect with LIMIT 5,1. |
Except a wrapper already exists and is built-in to PHP. It's called PDO. |
| « Prev | Page 1 | Page 2 | Next » |