Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Curiosity... (https://forums.graalonline.com/forums/showthread.php?t=81118)

Crow 08-08-2008 07:40 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1412594)
Besides, there are no excuses. Using with() is all about personal preference. Same about lining up equal signs.

Heh, through I guess :)

Kristi 08-08-2008 07:43 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1412594)
Same about lining up equal signs.

Preference or not, it is what is generally taught as standard coding practices in computer science.

LoneAngelIbesu 08-08-2008 07:46 PM

Quote:

Originally Posted by Kristi (Post 1412597)
Preference or not, it is what is generally taught as standard coding practices in computer science.

I have never taken a computer science class in my life. I'm self-taught. ^^

Kristi 08-08-2008 07:47 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1412598)
I have never taken a computer science class in my life. I'm self-taught. ^^

And it shows in your TERRIBLE coding preferences

LoneAngelIbesu 08-08-2008 07:49 PM

Quote:

Originally Posted by Kristi (Post 1412599)
And it shows in your TERRIBLE coding preferences

I like to think of myself as a revolutionist. I got my style from Inverness, no matter how many times he denies it.

DrakilorP2P 08-08-2008 08:34 PM

Quote:

Originally Posted by Kristi (Post 1412599)
And it shows in your TERRIBLE coding preferences

I wish I had taken computer science courses so that I could be cool like you and line up my equal signs.

Dan 08-08-2008 11:20 PM

Quote:

Originally Posted by Kristi (Post 1412599)
And it shows in your TERRIBLE coding preferences

You're so great :cool:

Inverness 08-09-2008 12:15 AM

I don't line up my equal signs either, if you don't like it, sucks to be you.
Quote:

Originally Posted by LoneAngelIbesu (Post 1412601)
I like to think of myself as a revolutionist. I got my style from Inverness, no matter how many times he denies it.

You're not something that bothers me enough to deny. :D

Tigairius 08-09-2008 12:15 AM

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.

cbk1994 08-09-2008 12:20 AM

Quote:

Originally Posted by Tigairius (Post 1412674)
Some functions on GK don't even work properly unless you use with()

GK's functions. :\

Inverness 08-09-2008 12:23 AM

Using with() on serverside is how you change the calling player.

xXziroXx 08-09-2008 12:31 AM

Quote:

Originally Posted by Tigairius (Post 1412674)
it depends how many values I'm editing at once.

Agreed.

Admins 08-09-2008 12:48 AM

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).

Cloven 08-10-2008 12:18 PM

Quote:

Originally Posted by Stefan (Post 1412692)
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).

In my opinion, the first (and possibly best thing) people can do in general is use practical, logical names for their variables and/or functions as they apply to the npc they're being used in. This makes it 10x easier on any future scripter who may have to edit/debug your work if they can relate easily to the code in front of them.

WhiteDragon 08-10-2008 09:54 PM

Quote:

Originally Posted by Kristi (Post 1412597)
Preference or not, it is what is generally taught as standard coding practices in computer science.

Never been taught to me before... and even if you have been taught that it may only be that fact that you had some cracked old professor.


All times are GMT +2. The time now is 04:42 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.