• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
mhagain

Hungarian Notation taken too far

9 posts in this topic

Good old Variants.. you never know what they really are. Delphi had those too (along with the more standard data types) but they are just confusing to use.

0

Share this post


Link to post
Share on other sites
That's not far enough! All code that uses vntBlah should be contained in a string that's eval'ed, so the prefix can be replaced with the appropriate type whenever it's used!!!

For serious though: I always have the urge to point out that this isnt real Hungarian notation; it's microsoft's pervertion, 'systems Hungarian'.
1

Share this post


Link to post
Share on other sites

Good old Variants.. you never know what they really are. Delphi had those too (along with the more standard data types) but they are just confusing to use.

 

I guess a question can be asked here:

is a language with both static types and variants:

A, a statically typed language with variants as a sub-type;

B, a dynamically typed language with optional explicit type-specialization.

 

or, does it depend more on what magic goes on within the implementation?... (more values as tagged or untagged?...)

or, on the declaration syntax?... ("var x; var y:int;" vs "var x; int y;").

or, edge-case behavior (say, "long" only able to directly encode +-(2^61) and having to sometimes escape-code values outside this range, or very large/small doubles sometimes losing several bits of precision?... as a result of internal conversions to/from variant).

 

(in my case, this is one of those unanswered questions regarding whether to classify my script-language as statically or dynamically typed... then again, compared with other similar languages, it would probably be classified as statically typed, despite the frequent use of dynamic types in many places...).

 

 

I guess this sort of fits in with whether one indicates the type of a variant in a variable name:

is a variant the absence of type, or instead its own type within a collection of other types?...

 

(well, along with the whole matter of whether objects or variants are the conceptual root-type for the type-system, ...).

Edited by cr88192
0

Share this post


Link to post
Share on other sites

Considering you're normally supposed to use non-Variant types, I'd say it falls under A.

 

Also ugh, I completely hate Hungarian notation, and that it's misused doesn't help. If you're going to use it then at least use it properly! (it's supposed to indicate what kind of data is stored (e.g. pxWidth would mean width in pixels), not what type of variable is it).

1

Share this post


Link to post
Share on other sites

Considering you're normally supposed to use non-Variant types, I'd say it falls under A.

 

Also ugh, I completely hate Hungarian notation, and that it's misused doesn't help. If you're going to use it then at least use it properly! (it's supposed to indicate what kind of data is stored (e.g. pxWidth would mean width in pixels), not what type of variable is it).

 

yeah, makes sense.

 

at least in my case (with my scripting language) using explicitly declared types can help significantly WRT things like performance, and also makes the compiler/interpreter better able to give useful errors and warnings, so this itself may be reason to use it, and likely puts things more in the statically-typed camp.

 

this is even if internally, tagged references are still often used, knowing the types often allows much cheaper logic to be used (allowing doing things directly, without all the type-checking and dynamic-dispatch and similar getting in the way).

 

...

 

so, you saying you don't like things like "LPCSTR szaStr;" or "DWORD dwSz;"?...

0

Share this post


Link to post
Share on other sites


Also ugh, I completely hate Hungarian notation, and that it's misused doesn't help. If you're going to use it then at least use it properly! (it's supposed to indicate what kind of data is stored (e.g. pxWidth would mean width in pixels), not what type of variable is it).

so, you saying you don't like things like "LPCSTR szaStr;" or "DWORD dwSz;"?...
Yes, that's not actually Hungarian notation. That's some perversion created by someone at Microsoft who misunderstood the original idea. Within Microsoft they call this incorrect version "systems Hungarian" and the correct usage "apps Hungarian".
In the former you prefix with primitive/data-structure types, in the latter you prefix with semantic types (this length is in meters, this string uses HTML encoded characters, this 'count' is how many columns there are, etc).
2

Share this post


Link to post
Share on other sites

Yep, pretty much. Generally I'd prefer if the name of the variable and the context by itself would be enough (if it isn't then you may want to rethink the design to make things clear enough). I guess Hungarian notation makes sense with complex projects handling all sorts of data (though in those cases I'd opt for more explicit variable names instead), but fake Hungarian notation is just a complete annoyance (if you can't tell the type by what the variable is supposed to do you have more serious issues), especially now that IDEs can help you look up the types of variables (so you don't need to do it in the source code at all).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0