This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course » View Exercise

1467 points
Picture
Submitted by
Devin Kit Crosland
over 2 years ago

Why the extra requirements?

Why do these exercises require the brackets in the if/elseif/else statements? PHP allows you to omit them when it doesn't create ambiguity - why make the exercises have different syntax requirements than the actual language?


1 vote

permalink

Because it's something for beginners to get used to programming in general

450 points
5240e713abf821aa28001257_703076796
Submitted by
Robinvb
over 2 years ago


1 vote

permalink

That's a great reason to put them in the written part of the tutorial... but I still think it should pass with acceptable PHP code either way. It's frustrating to have to go back and add in unnecessary details just to move on with the program.

1467 points
Picture
Submitted by
Devin Kit Crosland
over 2 years ago

1 Comment

5240e713abf821aa28001257_703076796 Robinvb over 2 years ago

Yeah true, it's really harsh on it's requirements


0 votes

permalink

Can someone provide here the code without these extra brackets please! I'd like to know how it will be with less code.

1146 points
55d6c265937676eae7000628_259096068?awsaccesskeyid=akiajkz7qvqfd72xnj3q&expires=1500940193&signature=h4rasrgp0%2bxjztks3df1oxsy2fu%3d
Submitted by
Boris Atanasov
almost 2 years ago