lv_, gf_ and lp_

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Am I the only one forgetting to add these prefixes when working in custom script?

Anyone else disliking this necessary prefix?

*I missed gv in title

Well, I always knew this, the instant it showed I needed it, so not really. But, the best reminder is Ctrl+F11, and look at your variables...
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Well I'm mostly remembering it now..just force of habit is kicking in the odd time. Just seems pointless for Blizzard to automatically add these prefixes to variables/functions.

I know what you mean, but it seems to be an aspect for either the game to sort things out, or for experienced developers to get a feel for the position of his/her variables... I guess.
 

overload119

New Member
Reaction score
5
Script editing in Galaxy is so much worst compared to WC3.

Luckily, a lot of stuff we could only do with triggers before, can be done in the Data Editor.

Sidenote: Anyone else getting interface lag when copying and pasting into the Custom Script box? Creating a new global variables? The editor kinda stutters for 0.1 seconds, it's generally just unpleasing.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
I honestly don't know why they need "lv_" or "gf_". The only thing really needed is "gv_". If we need to add prefixes to the other types we can do so easily. I guess the same applies for global variables but it is better for implementation and readability to differentiate between a gv/lv, and having an auto-prefix isn't that bad.
 

ZugZugZealot

New Member
Reaction score
33
It's a notation to prevent shadowing for GUI.

Say you have a global, just to count something like rounds, but you only feel like naming it "count". And somewhere down the line you need to count something besides an iterator, so you make a local "count". It will be able to distinguish the two simply because "gv_count" != "lv_count"

I'd rather see Hungarian notation though, which would be "iCount" for global and "_iCount" for local integer
 

Sevion

The DIY Ninja
Reaction score
413
That isn't the point Zug. The point is, having two auto-prefixing systems is just... redundant. Once you have auto-indexing on one, there's a very very low chance anyone is stupid enough to create a global variable (which will be auto-prefixed) named gv_var and then turn around and make a local variable (which won't be) named gv_var. Who puts "gv_" in front of their local variables?

One auto-prefixing system is enough...

Two is just a failsafe.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top