Hungarian Notation
#1

Why do people use Hungarian notation in Pawn? I can't help but shiver every time I see it.

Seeing as pawn only has one type of integer variable and all strings are zero-terminated, it makes even less sense using it. Then there is the redundancy: szString or iIndex are the most prominent examples that come to mind. Well you don't say! Of course I know that "string" is a string and that "index" is an integer, I don't need prefixes to tell me that! Needless to say, I do use SOME prefixes (like g for global variables) but nothing over the top. I certainly don't need this stuff in my function headers where the type of every variable can be deducted at a glance.

Then there is the issue of people copying scripts using this notation, with no clue whatsoever as to what it means. Hell, I've even seen people putting 'sz' in front of everything.
Reply
#2

they think their script will look more "professional".
personally I use it on global variables, arrays and some enumerators and on strings "sString" and not "szString", the rest I couldn't care much but I am totally agreeing with your point.
Reply
#3

I used it because I felt it was easier to read my code. I stopped using it because it just felt superfluous - using strong typing (tags starting with capital letters) is enough, imo.
It did get quite redundant, indeed, but the thing is if I named 5 variables with hungarian notation I couldn't just call one "index" - that would be inconsistent and it would slow down visually skimming code.

I'm not saying it's all bad, though, as it helped me maintain quite a large codebase. One thing, in particular, is distinguishing between "char arrays" and normal ones. I'd often screw that up.
Also, I found it was easier to quickly get started without having to dig around in the code everywhere.

Oh, yea, DraKiNs is an expert at improper hungarian notation.
Reply
#4

This thread seems legit... Its like, someone writes scripts like:

if ( something[ id ] == value )

others

if (something[id] == valie)

others

if(something[id]==value)

etc.. Its totally the same, if this way for ME looks better, and I dont want to look MY script for ME ugly, I write scripts like that.
Reply
#5

Quote:
Originally Posted by BaubaS
View Post
This thread seems legit... Its like, someone writes scripts like:

if ( something[ id ] == value )

others

if (something[id] == valie)

others

if(something[id]==value)

etc.. Its totally the same, if this way for ME looks better, and I dont want to look MY script for ME ugly, I write scripts like that.
That's spacing. The topic is about Hungarian notation.
Reply
#6

Its same.. Its like I would create a thread, and ask, why some of users space like this:

if ( something[ id ] == value )
Reply
#7

I'm using it, why do you even bother so much about it? It doesn't even effect your code at all, just makes it a lot easier, more detailed and more structured. Also, it's not all about integers, floats, arrays and stuff, you have lots of other useful prefixes you can use.

http://en.wikipedia.org/wiki/Hungarian_notation

Quote:
Originally Posted by admantis
View Post
they think their script will look more "professional".
That doesn't even make sense.
Reply
#8

It's neat.

I prefer using it because I'd sometimes be confused as to whether it's an array or a string, considering the way you create them in Pawn. The same with integers really, since I started off with PHP with no type of obvious casting to start off with at all.
Reply
#9

Everyone has their own style of scripting lol. My coding style was inherited from Slice, lol. First the spacing, now the notation (Yeah, it does look neat).
Reply
#10

I use them, only because it's easier to read the code in my opinion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)