1. Re: Opinion
- Posted by Falkon 1313 <Falkon1313 at AOL.COM> Jan 26, 2000
- 367 views
In a message dated 1/26/2000 00:08:35 Eastern Standard Time, PQ <quistnet at HOTMAIL.COM> writes: > I want to comment on all you programmers who thinks that he/she doesn't = > make any mistakes. Here are some some tips you should NOT do... > - Sizable windows while there's nothing more to see when resized. Yup. And really long strings (like filenames) in listboxes or labels that can't be scrolled or resized. Here's another windows one: Setting either the text color or background color while using the system default for the other. A sure way to make a bad impression on your end-users is to give 'em yellow on white text or black on black... Always try switching your Windows color scheme to several different ones, including light on dark, and dark on light, while your program's running to see that you didn't miss anything. There's a whole lot more windows UI stuff at the Interface Hall of Shame site: http://www.iarchitect.com/mshame.htm > - Using constant-statements constantly, while a comma will suffice. Perhaps not as pretty, but easier for cut and paste/commenting and uncommenting. Saves having it keep crashing each time you change something because you forgot to move or remove the comma. > - Using only constant-statements for the famous create() function, > integer is also an option. Only if you want to modify the pointer or handle or whatever being returned. > - Using e.g. wait_key() in graphics.e, while that's the same as > machine_func(26,0). Nah, better to use wait_key(). 'machine_func(26,0)' tells you nothing when you're looking at the source. > - Adding useless spaces between nothing¬hing or something¬hing. Notaddinguselessspacesbetweensomethingandsomething. And not indenting nested statements. And not using parentheses around subexpressions to clearly show the order of evaluation. > - Placing comment without --. That'll crash it though. > I'm not perfect eather, but try to keep these things in mind. > Does someone like to add somethings to this list or remove something. Here's the most frequent (and most frustrating) error I've been making lately: Forgetting to convert a handle or pointer to the layer of code you're working with. For instance, using a VEL handle to a control when you should be using the Windows handle to it, or putting a bunch of controls in a sequence and treating the index of the control as a handle in your own routines, then forgetting to convert it to a VEL handle or Windows handle when calling a library or API function. (Did the same sorta things with Neil, that caused most of the unexplainable Causeway crashes in my experience.) Can sometimes take hours to find the source of the problem...it looks right, doesn't produce a type-check error, and the results may be totally unexpected weirdness instead of a crash.