Grappen met code

Gestart doorRik89 reacties330 weergaven

90 berichten · pagina 2 van 6

Rik

Lid · Topicstarter

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Nielsie schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$Jokes[/COLOR][COLOR= #007700]->[/COLOR]GetNext[COLOR= #007700]();[/COLOR]
?>
-1 voor geen camelcase met de eerste letter lowercase
0
Berichten
3.225
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if($you == "Understand")
{
echo "Get a life";
}
?>
0
Rik

Lid · Topicstarter

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Dan vind ik:

if(you.understand(this))
{
    print "get a life";
}


beter
0
Berichten
22.444
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Streedie schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Understand"[/COLOR][COLOR= #007700])
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Get a life"[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Ga PHP leren."[/COLOR][COLOR= #007700];
}[/COLOR]
?>
biggrin
0
Rik

Lid · Topicstarter

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Maar dat is onlogisch. Nu ga je kijken of jij een instantie bent van een string met de waarde van "understand". Mijn code is veel logischer omdat je een methode aanroep van jezelf (de methode understand = begrijp) en vraagt je in de functie af of je "this" (referreert naar de hele code) begrijpt.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robindesign schreef:
Eerdere citaten tonen
Streedie schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Understand"[/COLOR][COLOR= #007700])
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Get a life"[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Ga PHP leren."[/COLOR][COLOR= #007700];
}[/COLOR]
?>
biggrin
That indentation cry
0
Rik

Lid · Topicstarter

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Kladblok indentation cry
0
Berichten
3.425
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<h1>Hoi</h1>
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Riick schreef:
<h1>Hoi</h1>
schaterschaterschaterschaterschaterschaterschater nee.
0
Berichten
3.425
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wouterr schreef:
Eerdere citaten tonen
Riick schreef:
<h1>Hoi</h1>
schaterschaterschaterschaterschaterschaterschater nee.

<div id="noob">
    <h1>Wouter</h1>

        <div id="excuses">
            <i>Maar ik hou wel van je</i>
        </div>
</div>


Grapje hoor wouter. xd
0
Stef

Lid

Berichten
10.150
Reputatie
2
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/If"]If[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$dittopic[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"closed"[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]"ohyeah!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Wacht... Er klopt geen flikkah van confused
0
Berichten
3.225
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700])
{[/COLOR]
     [COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?[/COLOR]php

[URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{
    ...[/COLOR]
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR]

        [COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR]

        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaugh[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700];

        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]);

        }

    }
    ...
}[/COLOR]

[COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL
0
Rik

Lid · Topicstarter

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Streedie schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700])
{[/COLOR]
     [COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
Puntkomma vergeten, een "==" proberen te gebruiken om een waarde aan iets te geven (wat dus niet kan), en wederom $you vergelijken met een string die een waarde heeft.

-1 voor deze lutsercode.
Rogier schreef:
[COLOR= #0000BB]<?[/COLOR]php

[URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{
    ...[/COLOR]
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR]

        [COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR]

        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaught[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700];

        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]);

        }

    }
    ...
}[/COLOR]

[COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL
Kijk, dat is nog eens code. worshippy
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Rik schreef:
Eerdere citaten tonen
Streedie schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700])
{[/COLOR]
     [COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
Puntkomma vergeten, een "==" proberen te gebruiken om een waarde aan iets te geven (wat dus niet kan), en wederom $you vergelijken met een string die een waarde heeft.

-1 voor deze lutsercode.
Rogier schreef:
[COLOR= #0000BB]<?[/COLOR]php

[URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{
    ...[/COLOR]
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR]

        [COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR]

        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaught[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700];

        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

            [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]);

        }

    }
    ...
}[/COLOR]

[COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL
Kijk, dat is nog eens code. worshippy
Php niet afgesloten redface! ?

toevoeging op 28 februari 2013, 23:33:40:emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren