Forums → Programming Forum → A trick?
- 5 Replies
I noticed when changing cords you don't need to add a ; at the end of every line, I'm just taking class so I don't know if you guys already knew this, Also I found out sometimes you don't need (); at the end of certain lines lol
Not really a trick...
It is in fact not needed to write a semicolon at the end of every line, but it is considered good practice to do so. This is because some PL needs semicolons at the end of every line, and also note that if you do not add semicolons, sometimes you will end up passing functions as parameters themselves, among other things.
For the (); bit, well for certain lines it is not needed. I'm not just sure what you meant by the 'certain lines'
I know how to do a coin trick. Does that count?
I was not aware that semi-colons can be optional. I thought it was mandatory, at least for languages like AS3 that use them.
I knew some compilers/languages don't require the semicolon, in which case it's good practice. For most languages however it's required, and if your preferred coding program has a decent error check it should at least warn for it.
Well, to wrap it up, I just want to say when using AS3 (some other languages too), just go and terminate every statement with a semicolon. It's good practice for a reason, (such as my example above) and it actually helps you if you're line breaks becomes lost(this actually happens, and if you don't have semicolons, it'll be outright useless, of tiring to fix it.). It is also much harder to read code without semicolons.
And for one thing, a new line DOES NOT actually end a statement, so if you don't use semicolons, a compiler can actually think your code is just one big line!
You must be logged in to post a reply!
We strive to deliver the best gaming experiences... on the internet and on your mobile phone. Play thousands of free online games for kids, get access to free mmorpg games, online rpg games, fun online flash games, and more.
We offer free flash games in many different genres: online shooting games, online puzzle games, online war games, free online car games, free online hidden object games and dozens more.
This is the best place on the web to play online games for free... play on Armor Games! No matter what game style you prefer, we've got it here.
Gaming websites, passionate bloggers, and quirky streamers are welcome to share or review our games. If you need game keys, art, trailers, screenshots or more check out our press kit website.
Game developer? Visit developers.armorgames.com to request AG developer status, find documentation on our APIs, and get access to our development environment. Let's make sweet, sweet games together.
Looking for a publishing partner that can help your app rocket to success? Contact the mobile team to learn more about how we can help!