![]() |
Curiosity...
Am I the only person that avoids using "with" as much as possible?
Whenever I create an object of any sort, I assign it a pointer. If the object is already created, I give it a pointer. ex: temp.ani = showani(...); temp.ani.prop = value; When I have long lists of things, it seems easier to just glance at my code and see exactly what is going on, instead of tracing back with blocks. What do you do and why? Discuss! |
I never use with.
|
I use with only with findimgs
|
thiso. eww.
|
It depends on how many values of the object I am changing.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
I mean, really... which one looks better? It may be more lines, but I guess I'm a block kind of guy. :cool: PHP Code:
|
The top one looks better, and would look even better if you lined up your equal signs *tsktsk*
|
For me it kind of depends on the length of the object name, I found out (but never thought about).
Example; PHP Code:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
PHP Code:
|
Quote:
Besides, there are no excuses. Using with() is all about personal preference. Same about lining up equal signs. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
I don't line up my equal signs either, if you don't like it, sucks to be you.
Quote:
|
I use with() just about as much as I assign a pointer. Some functions on GK don't even work properly unless you use with(), and as many other people said it depends how many values I'm editing at once.
|
Quote:
|
Using with() on serverside is how you change the calling player.
|
Quote:
|
It can reduce problems with typing errors (typing the same object name over and over again), it can also make scripts look easier to understand. If you need to write very efficient code then it should probably be avoided (e.g. loops inside with() are not optimized), but that should not happen often.
Making scripts look easier to understand is often more important than you think, because code often needs to be understood by other scripters to be able to fix or improve stuff (or by yourself in the future). |
Quote:
|
Quote:
|
Quote:
:\ |
I use with when creating objects (like GUIs) to make it match with the new blocks.
Quote:
|
Quote:
|
I've yet to be taught to line up equal signs after Computer Science, AP Computer Science AB, and Computer Systems, but perhaps year 4 will be my lucky year!
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
It just means the department also include more then just programming classes. I was however, referring to the programming classes that I've taken. |
Quote:
|
All times are GMT +2. The time now is 04:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.