Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
variable arguments question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nick Keighley, post: 3974128"] this is of course Mr.Seebach's opionion. It may be better than most opinions on C but it is still an opinion. I can live with camel case. Actually I have to, as source bases I deal with in both C and C++ are CamelCased. For reasons I'm not too sure about camelCase seems much more prevelent in the C++ than the C world. You can reprogram yourself to be equally happy in either. Type prefixs on the other hand are Pure Evil. Search for Hungarian Notation on the internet. unless the rest of project team is using them. Or you're using an API that uses them heavily (eg. Win32). I tend to hide Win32's programming conventions away from the rest of my code as much as possible. And only partly becasue they're ugly? do you have figures? I've seen a fair amount that doesn't follow your conventions! not always... oh agreed. stupid-stupid-stupid might be nearer the mark He should if he writes decent code. The variable you need to know the type of should be either local or a parameter (and hence local again) about 95% of the time. Which means it should only be about 20 lines away at most (you do write functions that fit on a screen, yes?). Ok, you may have some static stuff at the head of the file, but *that* isn't far away either. I know structs mess up this idealised world, but good naming naming conventions and modularisation practices clean this all up. And you do have a decent sourec code browser don't you? Consider this URL that discusses a common Hungarian Type in Microsoft's Windows API blogs.msdn.com/oldnewthing/archive/2003/11/25/55850.aspx **************** What do the letters W and L stand for in WPARAM and LPARAM? Once upon a time, Windows was 16-bit. Each message could carry with it two pieces of data, called WPARAM and LPARAM. The first one was a 16- bit value ("word"), so it was called W. The second one was a 32-bit value ("long"), so it was called L. You used the W parameter to pass things like handles and integers. You used the L parameter to pass pointers. When Windows was converted to 32-bit, the WPARAM parameter grew to a 32-bit value as well. So even though the "W" stands for "word", it isn't a word any more. (And in 64-bit Windows, both parameters are 64- bit values!) It is helpful to understand the origin of the terms. If you look at the design of window messages, you will see that if the message takes a pointer, the pointer is usually passed in the LPARAM, whereas if the message takes a handle or an integer, then it is passed in the WPARAM. (And if a message takes both, the integer goes in the WPARAM and the pointer goes in the LPARAM.) Once you learn this, it makes remembering the parameters for window messages a little easier. Conversely, if a message breaks this rule, then it sort of makes your brain say, "No, that's not right." ******************* In other words the Hungarian doesn't mean what it says it means. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
variable arguments question
Top