Re: Warp: RSS Package Manager
"Isak Savo" <[email protected]>
| Newsgroups | gmane.comp.autopackage.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, May 31, 2008 at 8:04 PM, Jan Niklas Hasse <[email protected]> wrote: > On Sat, May 31, 2008 at 7:54 PM, Neil Munro <[email protected]> wrote: >> Why is it discouraged? I'm curious. One of the reasons is what jan mentions: > Because the variable name often says what type it is. Example: > "filename". This should always be a string, shouldn't it? Also: * Modern IDEs give you this information + more when you hover the variable (or press some keyboard combination) * Variable names look ugly * It's often not enough information anyway. In your example "pSetPermission" could be anything beginning with 'p' (process, parameter, plane, plong, pling, plang) * what information should be in the mnemonic? (type?, purpose?) And how much? This makes it hard to read hungarian encoded variable names unless you've seen the actual letter combination before.. E.g. what does crszkvc30 actually mean?[1] Personally I also think it's makes the code less readable, since I have to decode a bunch of uninteresting characters before I get to the real variable name (which by itself should be good enough to give purpose and often also type). For instance, the 'b' before booleans are often completely unneccessary: while (bDataStillAvailable) { DoStuff(); } That 'b' is just noise Anyway. There are probably as many coding styles and conventions as there are programmers. My advice is that you follow the common style for the language or application your working on/with. If you're writing a patch for an existing program, then the choice is easy - just do what the other programmers on the team do. Otherwise you're patches won't be accepted :) If you're writing your own program, then I tend to follow the style of the language (if applicable) or the style of other similar apps in that language: * For c#, I always use the .NET class library as reference (there's a formal guideline on msdn too) * For C with GTK+, I use the style of the GTK+ API. -Isak [1] It means "a constant reference argument, holding the contents of a database column of type varchar(30) which is part of the table's primary key." :) --------------------------------------------------------------------- To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected] For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected]