r/badcode • u/Wonderful-Aardvark89 • Nov 18 '20
php Intentionally Bad Code to show how Syntax errors worked
1
u/Janes_Diary Nov 19 '20
Well, for starters, you used PHP, so that is failure number one. All succeeding failures are irrelevant because PHP.
2
u/Wonderful-Aardvark89 Nov 19 '20
its mandatory curriculum lmao
2
u/Janes_Diary Nov 19 '20
What backward school uses a practically dead language to teach web development?
4
2
u/chepas_moi Nov 19 '20
Trop is te veel! This is a silly idea that puts too much importance on the IDE when at this stage you should be concentrated on the code and eventual call stacks.
2
Nov 21 '20
Since people appreciated my comment last time, here we go:
variable names in Dutch
variable names
getal1andgetal2instead of something sensiblesyntax error: variables in php are prefixed with a
$, missing from line 2 and 3assigning a string to a variable
getal. ("getal" means number)line 4
style issue: inconsistent spacing around operands and operator
the second statement is invalid, probably first
;should be removed
line 5: just HTML in a PHP block with a semicolon
missing
echoand quotesit doesn't even print
$resultaatthe message doesn't make sense, translation: "the result of these numbers is:"
better message would be "het product van deze getallen is".
8
u/Webmets Nov 18 '20
G E K O L O N I S E E R D jokes aside, not even a great way to show syntax errors, just over done bad code