Netjes scripten

Gestart doorSanderc61 reacties129 weergaven

62 berichten · pagina 2 van 5

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dat mag emo
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
je herkent een scripter/programmeur aan zijn style!

de een doet:

[COLOR= #0000BB]<?php
$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #FF8000]//DERP[/COLOR]

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

[COLOR= #FF8000]//LOLSEC[/COLOR]

[COLOR= #007700]}[/COLOR]
[COLOR= #FF8000]//=====================
//=====En zon comment=====
//=====================[/COLOR]
?>


Een ander:

[COLOR= #0000BB]<?[/COLOR]php
[COLOR= #0000BB]$marjolein[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]awesome[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$marjolein[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]awesome[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #FF8000]//>.<[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//LOLZ[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
//Zon comment
0
Berichten
457
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zelf doe het zo:

[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$hoi[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]hoi[/COLOR][COLOR= #007700]){[/COLOR]
   [COLOR= #FF8000]//boe
   //boe[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
   [COLOR= #FF8000]//boe
   //boe[/COLOR]
[COLOR= #007700]}[/COLOR]

?>
0
Berichten
3.074
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Of je gebruikt gewoon een fatsoenlijke standaard:

http://framework.zend.com/manual/en/coding-standard.coding-style.htmlsmile
- Ideaal voor grote projecten
- Ideaal voor meerdere deelnemers die aan de code sleutelen
- Ideaal voor goede onderhoudbaarheid
Oh, dus mijn if / else was fout... Zal voortaan wel die van Zend gebruiken. yummie
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik doe t meestal zo:

[COLOR= #0000BB]<?php
$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #FF8000]//DERP[/COLOR]

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

[COLOR= #FF8000]//LOLSEC[/COLOR]

[COLOR= #007700]}[/COLOR]
[COLOR= #FF8000]//=====================
//=====En zon comment=====
//=====================[/COLOR]
?>


Sorry, voor t stelen Sevvlor yummie
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?
$ik[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]maarten[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ik[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]maarten[/COLOR][COLOR= #007700])
{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]OMG DIT KLOPT![/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]:s[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
104
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja idereen heeft gewoon zijn eigen style.

Wat is er overzichterlijker in jouw ogenthumbsup
ik doe zelf altijd
}else{

En soms
}
else
{
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Sevvlor schreef:
je herkent een scripter/programmeur aan zijn style!

de een doet:
[COLOR= #0000BB]<?php
$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lennard[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]koewl[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #FF8000]//DERP[/COLOR]

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

[COLOR= #FF8000]//LOLSEC[/COLOR]

[COLOR= #007700]}[/COLOR]
[COLOR= #FF8000]//=====================
//=====En zon comment=====
//=====================[/COLOR]
?>


Een ander:

[COLOR= #0000BB]<?[/COLOR]php
[COLOR= #0000BB]$marjolein[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]awesome[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$marjolein[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]awesome[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #FF8000]//>.<[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//LOLZ[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
//Zon comment


Die laatste comment is geen comment sadleyMoet dan wel binnen php..
0
Berichten
3.074
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mijn nieuwe stijl van PHP;

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/* Dit is waar je vooral naar vroeg. */[/COLOR]

[COLOR= #0000BB]$milesFromNewYork[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]20[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$length[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]20[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Boston[/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]Far, far away[/COLOR][COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]/* Dit is andere nette scripting, afgeleid van Zend. */[/COLOR]

[COLOR= #0000BB]$strong[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$strong[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]<strong>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$strong[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]</strong>[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$strong[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]Vetgedrukte tekst.[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$strong[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]];[/COLOR]

[COLOR= #0000BB]$buddy[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]buddy[/COLOR][COLOR= #007700];[/COLOR]
?>
Yeah <?=$buddy;?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/class"]class[/URL] Troep
[COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] Blah[COLOR= #007700]()
    {[/COLOR]
        [COLOR= #0000BB]$output[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Blah[/COLOR][COLOR= #007700];[/COLOR]

        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$output[/COLOR][COLOR= #007700];
    }
}[/COLOR]
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Alles volgens Zend (http://framework.zend.com/manual/en/coding-standard.coding-style.html) aangezien ik ook gewoon dat framework gebruik
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Raaoul schreef:
Alles volgens Zend (http://framework.zend.com/manual/en/coding-standard.coding-style.html) aangezien ik ook gewoon dat framework gebruik
Ik ook.

Op mijn werk moet ik alleen wel onderscheid maken in ifelse en functies.

if()
{

}

function() {

}
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Rogier schreef:
Eerdere citaten tonen
Raaoul schreef:
Alles volgens Zend (http://framework.zend.com/manual/en/coding-standard.coding-style.html) aangezien ik ook gewoon dat framework gebruik
Ik ook.

Op mijn werk moet ik alleen wel onderscheid maken in ifelse en functies.

if()
{

}

function() {

}
Hoezo dat dan?

toevoeging op 19 juni 2012, 08:45:48:
@Joey, regel 21:
Yeah

Deed ik ook vaak, alleen kreeg ik commentaar op van een heleboel mensen dat je geen shorttags moest gebruiken emo.
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Puur om er onderscheid in te maken.

object variable doen wij ook anders benoemen dan array variable.

en zo zijn er nog wel een paar kleine dingetjes.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Shorttags mag je wel gebruiken, in de nieuwe versie van PHP kun je dat namelijk niet meer uitzetten shorttags, dan staat het gewoon altijd aan
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