Caine
Hardcore Member
Personally, I prefer Whitespace. It's a lot cheaper if you need to print it to paper.We all should all just program in Brainfuck h34r:
Last edited by a moderator:
Personally, I prefer Whitespace. It's a lot cheaper if you need to print it to paper.We all should all just program in Brainfuck h34r:
Personally, I prefer Whitespace. It's a lot cheaper if you need to print it to paper.We all should all just program in Brainfuck h34r:
How so? What is the message and how does he misunderstand it?That blog post of your friend is already a good example of someone who doesn't understand the message properly and starts misrepresenting the campaign with stupid, unclear and probably wrong examples.
The anti-if campaign exaggerated the evilness of the IF-statement to make a point. They do indicate that in fact they want to eliminate bad applications of if statements which are, in object oriented languages, better solved in other ways. The blog post translates this in an all-but absolute statement.How so? What is the message and how does he misunderstand it?
You're supposed to go to a course/formation to find out. This website is basically a scam to bring you to their class on high price.I still don't know what the hell is considered to be a "bad" IF, or what's a good one, or what the hell I'm supposed to do without IFs.
You're supposed to go to a course/formation to find out. This website is basically a scam to bring you to their class on high price.I still don't know what the hell is considered to be a "bad" IF, or what's a good one, or what the hell I'm supposed to do without IFs.
Is offloading the check to the db any better then performing the check beforhand?You're supposed to go to a course/formation to find out. This website is basically a scam to bring you to their class on high price.I still don't know what the hell is considered to be a "bad" IF, or what's a good one, or what the hell I'm supposed to do without IFs.
If so, then they've even failed at that. Useless!
I consider myself adept at avoiding "if", just pass all your variables into a SQL statement and use CASE WHEN. Example:
$Action = "Multiply";
$a = 1;
$b = 2;
$result = $mysql->query('SELECT CASE WHEN ?action = "Multiply" THEN ?a * ?b ELSE ?a / ?b END AS result', array( 'action'=>$action, 'a'=>$a, 'b'=$b ));
Is offloading the check to the db any better then performing the check beforhand?
I mean mysql would still have to act on some sort of expression, so your just moving the work from PHP (or alternative) to MYSQL.
Is that saving any system resources?
if( class_exists( $this->providerName ) && $this->provider = call_user_func( array( $this->providerName , 'instantiate' ) ) )
switch ( $this->providerName )
{
case 'monkey':
$this->provider = class_monkey::instantiate();
case 'pirate':
$this->provider = class_pirate::instantiate();
break;
}
Yes, it's still an if, but it's better than:
Code:switch ( $this->providerName ) { case 'monkey': $this->provider = class_monkey::instantiate(); case 'pirate': $this->provider = class_pirate::instantiate(); break; }
LOL, say goodbye to 99% of the internetHow about we launch a campaign to eliminate shitty, incoherent websites from the internet?