[DEBATE] Hawk552 vs SnoW
You should never assign a variable for zero when creating it:
PHP Code:
PHP Code:
|
Re: Blocking Buy Commands (Basic)
Quote:
|
Re: Blocking Buy Commands (Basic)
Quote:
PHP Code:
|
Re: Blocking Buy Commands (Basic)
When do you ever use a vector when you first create it?
There is always some assignment that is done before it is used. Also, the boolean variable can be declared as false for the same reason as an integer can be declared as 0. |
Re: Blocking Buy Commands (Basic)
There isn't always an assigment, even the origin was a bad example. It could be in a hud game my worm's origin which I'd generate in a smiliar loop in what you used the size. What ever it doesn't matter.
Obviously there's no difference between false and zero, just that assigning a var to false seems in a code even worse practice. |
Re: Blocking Buy Commands (Basic)
Quote:
Quote:
Quote:
|
Re: Blocking Buy Commands (Basic)
If you assign the var, other people don't get any readability, but they can actually get confused that the assigning isn't only possible but must be done.
There's no real problem here or either a solution to this, it's all about opinions. When using semicolons the code isn't only much more clear and readable, but also the horrible thing that you are somehow limited to invisible lines is gone. When you see in chars where the statements end and the code can be even in one line I can't do anything but use semicolons. |
Re: Blocking Buy Commands (Basic)
Quote:
Quote:
Quote:
Quote:
The fact that you can't deny is that using semicolons creates extra work for you. I'm arguing that the work you do is pointless and is a result of the "archaic" Java/C style that you're, ironically, advocating staying away from. |
Re: Blocking Buy Commands (Basic)
Quote:
Quote:
Quote:
PHP Code:
Quote:
|
Re: Blocking Buy Commands (Basic)
Quote:
PHP Code:
PHP Code:
Quote:
As for the initialization, I already explained that it can be more readable (although I don't do it) since it's clearly stating what a variable will contain without implying it and without costing any extra resources or introducing backwards compatibility problems. Quote:
I mean, we can detag floats like this to use them as integers: PHP Code:
Quote:
|
All times are GMT -4. The time now is 13:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.