Rewrite in order.
This sounds strange but,
The vanilla code is crap.
Because:
The vanilla code is crap.
Because:
- LongFunctionClassAndVaribleNamesAreBadChangeThem
- useCamelCaseInVariblesNot LikeThis but likeThis
- NEVER use " apart from \n. it slows down the parser. use '. and if you need to add a varible use like 'Hello, ' . $world . ' today!'. for newlines do like 'Hi there!' . "\n" - that's the only time you should use "
0
This discussion has been closed.
Comments
The vanilla code is crap.
Thank you!
LongFunctionClassAndVaribleNamesAreBadChangeThem
I coded it the way I like it. In my mind, a little bloat in exchange for clarity is a fair trade.
useCamelCaseInVariblesNot LikeThis but likeThis
This is just a personal preference.
NEVER use " apart from \n. it slows down the parser. use '. and if you need to add a varible use like 'Hello, ' . $world . ' today!'. for newlines do like 'Hi there!' . "\n" - that's the only time you should use "
I don't know if there is any truth to this, but I will certainly do some tests and find out.
NEVER use " apart from \n. it slows down the parser. use '. and if you need to add a varible use like 'Hello, ' . $world . ' today!'. for newlines do like 'Hi there!' . "\n" - that's the only time you should use "
was written more clearly so I could have read it faster, but that doesn't mean I have to say it's crap.
Also for the record, I noticed a speed increase of appx 0.01 seconds. Not much, but whatever.
Also, it's less work for you. Escaping variables/quotes/etc takes longer and makes things look plain ugly.
2: Classes should not have their first char uppercase because they're not variables. For languages that don't use a symbol to indicate variables that's very important for readability. ([[MyWindow alloc] init] vs [window titleName: @Title] for Cocoa for example) For PHP it's not that imporant, but it's generally still a good idea. I agree on camelCase for functions and variables though.
3: It's not that much difference. Remember that PHP code is never compiled anyway (unless you use an optimizer). I use single quotes personally because webcode contain a lot of double quotes. But then again I like to use templates with placeholders ([[pageTitle]] for example)
variableName
functionName
ClassName