Why do some api calls use unconventional syntax?

For example, WSAStartup, WSACleanup, MessageBox, etc
shouldn't the convention for function identifiers be lowercase for first word followed by uppercase for every subsequent word? like messageBox instead of MessageBox?
Everyone choose the capitalization it want. There's no general convention on this
I tend to favor CapitalNames for function names, classes, structs, lowernames for local variables, and mPrefix for member variables.

I never liked the whole lowerFirst thing, but it's just a preference.


But whatever. The whole point is to be consistent. Whatever style you choose, stick with it. It's only a problem if you have like 10 different styles in your code.
And like Disch said, consistency is nice. The Win32 functions exclusively use something named 'camel hump' notation where the first letter of every word or sylable is capitalized and the remainer small letters. So, MessageBox is correct; not messageBox. Also...

SetWindowText()
CreateWindow()
RegisterClassEx()
SetFocus()
DrawText()

etc.

Hungarian notation is a different concept, and I believe the one you are getting confused with. With that, a letter or prefix to a variable name indicates the type of variable. For example, if you have a program that helps you keep track of how many cans of worms you have, rather than naming a variable...

CansOfWorms

...you might use...

iCansOfWorms

to indicate its an int.
This is what they are using is not syntax at all. So called convention has nothing to do
with those who attempt to apply them as they are noted for commited beings only.
If a CPU instruction set compares to a sand to be mixed with other ingridients to achive consistence of the concrete then those are rather like bolts and nuts without some
kind of wrench are just a huge warehouse stockpile open to anyone around the clock to
select whatever happens to be in the head with bare hands.
It is far from a convinient store.
Topic archived. No new replies allowed.