Raised This Month: $32 Target: $400
 8% 

#define variable variable2


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-07-2013 , 17:26   Re: #define variable variable2
Reply With Quote #11

I would agree with fysiks & connor. From what I see, you overthink on something which enlightens your actual problem : you don't use properly an IDE. Unless you're using a simple text editor like the old notepad, you have generally a drop-down list showing the variables used, you just need to type the first letters. Also, what you want to do is really a very bad practice making the code less readable. A code should be simple & easy to understand. If you start to insert random macro to have just one letter, it will be harder to maintain code and you will waste more time you think you could gain. Focus on the quality of the code instead.
__________________
Arkshine is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-07-2013 , 17:28   Re: Re: #define variable variable2
Reply With Quote #12

Quote:
Originally Posted by .Dare Devil. View Post
Well, yes you see many stupid things posted by me but its stupid because you dont understand me and i cant explain well.
And also my logic is weird for ohter peoples.

edit: also sometimes, i just dont understand what they say to me.
Its not because i have very bad english, I did not focused enough.


uhhh, all i want to do is use variables named in function like a,b,c,f etc...
if the global variable name is long and your function code is long then you lose time by writing every time that long variable name.
for example ( new g_flashlightcolor[33][3] )
there is possible to change global variable to shorter name but the thing is, i dont understand later what this is or what can happen is that 2 variables have the same name.
I try to avoid that.

If you know how to zp work then you see that the creator of it did 9 or more plugins for one mod.
What i do is that my mod will be just 1 sma but with parts ( many .inc-s )
Also each .inc code have different variable tag.


This is just an idea.
Are you talking about it being difficult to write descriptive variables ? That's like programmers 101. Lol you write a bauble to be as descriptive ad possible so you and other people know what your talking about. As for globals.

They may be defined outside of a function to be used as a global other wise it is a local variable available inside of that function only. Both are good and can be just as long. Shop not sure what your problem is.
Doc-Holiday is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-07-2013 , 17:35   Re: #define variable variable2
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
I would agree with fysiks & connor. From what I see, you overthink on something which enlightens your actual problem : you don't use properly an IDE. Unless you're using a simple text editor like the old notepad, you have generally a drop-down list showing the variables used, you just need to type the first letters. Also, what you want to do is really a very bad practice making the code less readable. A code should be simple & easy to understand. If you start to insert random macro to have just one letter, it will be harder to maintain code and you will waste more time you think you could gain. Focus on the quality of the code instead.
This gave me alot to think about...
But thanks.
.Dare Devil. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-07-2013 , 18:15   Re: #define variable variable2
Reply With Quote #14

Quote:
Originally Posted by .Dare Devil. View Post
If you know how to zp work then you see that the creator of it did 9 or more plugins for one mod.
What i do is that my mod will be just 1 sma
.
You won't gain in performances, you would have better to try to improve those 9 plugins codes.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-07-2013 , 18:45   Re: Re: #define variable variable2
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
You won't gain in performances, you would have better to try to improve those 9 plugins codes.
Breaking up code can be easier to read though.
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-08-2013 , 01:54   Re: #define variable variable2
Reply With Quote #16

Quote:
Originally Posted by Arkshine View Post
I would agree with fysiks & connor. From what I see, you overthink on something which enlightens your actual problem : you don't use properly an IDE. Unless you're using a simple text editor like the old notepad, you have generally a drop-down list showing the variables used, you just need to type the first letters. Also, what you want to do is really a very bad practice making the code less readable.
I never use any fancy things like this drop-down that you speak of. If the variable is descriptive (accurately) it's much easier to remember them and type them quickly.

Quote:
Originally Posted by Arkshine View Post
A code should be simple & easy to understand. If you start to insert random macro to have just one letter, it will be harder to maintain code and you will waste more time you think you could gain. Focus on the quality of the code instead.
Very well said.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode