Archived

This topic is now archived and is closed to further replies.

xropi

naming functions

Recommended Posts

In hungarian notation we have prefixes in front of our variable identifiers. That''s good. But: what if I gave prefixed names to my functions? It may be useful while I always forget the virtual status of my functions... A little "v" prefix may fix this problem for me and perhaps for others too. There is no question, it''s just an idea. Ropi

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
please, for the love of all that is good and holy, first read this article on Hungarian wartHogs: http://www.cuj.com/experts/1911/hyslop.htm

The article is a part of the incredibly useful Guru of the Week site: http://www.gotw.ca

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
please, for the love of all that is good and holy, first read this article on Hungarian wartHogs: http://www.cuj.com/experts/1911/hyslop.htm

The article is a part of the incredibly useful Guru of the Week site: http://www.gotw.ca


Ok, I''ve read that article. It was edifying, but what about reference variables for example? It''s quite not the same thing as a simple variable. If the name of that variable doesn''t descript this ''feature'' the programmer have to look for it''s declaration instead of knowing it from the name. The same goes for virtual functions too.
I can see that Hungarian notation has some trouble anyway.

Share this post


Link to post
Share on other sites
quote:
Original post by Russell
I know some people use your idea about prefixing function names with what they return. I know one former MS employee who does this.

What, IntelliSense didn''t work for him either?

A modern IDE exist to eliminate a lot of this nonsense. Can''t remember what parameters a function takes, or what its return type is? Hover the mouse over the function and voila! Unfortunately, MSVS has struggled to provide this simple functionality consistently and reliably, so people still resort to all sorts of unsightly warts. (Yes, blatant misinformation and misdirection has been a contributing factor).

I''ve now found two productivity projects: updating C++''s build process and producing a dependable IDE (both to be implemented on existing code bases). Keep your eyes peeled.

Share this post


Link to post
Share on other sites