|
tef posted:See, where you might use "result" I would use bln_flg_tst_cnd_args_x.
|
# ¿ Mar 22, 2008 06:16 |
|
|
# ¿ Apr 28, 2024 19:11 |
|
code:
|
# ¿ Mar 26, 2008 18:47 |
|
_aaron posted:Hahaha, that's pretty awesome. But correct me if I'm wrong here: most of that stuff is .Net 3.5 stuff, right? We are still using vs2005 (but will be upgrading soon), so that doesn't apply to our stuff. When we do make the switch, I will certainly keep this in mind.
|
# ¿ Mar 26, 2008 21:06 |
|
Notice how the signature between what I posted differs from what you posted. Moreover, mine works on IEnumerable<string> and is an extension method. Here's the definition:code:
|
# ¿ Mar 27, 2008 10:03 |
|
I'm all for a few intelligent conventions like what you've just posted (I'm not sure if the actual ones you posted are good or not). Consistency is really the important thing, within any given code base. And don't make it drastically different from other code bases you're going to be working on. Give the brain fewer differences so that the differences it does process are the relevant ones.
|
# ¿ Mar 29, 2008 08:06 |
|
nebby, what if the programmers with whom you work just suck at giving proper context? Also, you repeatedly forget to note that this is much more important for dynamic languages, as things are less clear there. Have you looked into coding for the military, using ADA? It gets fairly close to your approach, but has compiler-enforced type safety. You can only get speed if you divide distance by time (or integrate acceleration by time, etc.). Maybe I missed it, but I do not remember you ever explaining why your desire for Hungarian whatever is in the distinct minority of programmers. Does your approach really allow you to code more quickly and more accurately than other people, on average? (Take into account learning curve here!) To what extent are the problems you encounter, unique to your problem domain, or at least a very, very small fraction of programming? The more I think about this, the more you must address the above if you want to stop digging/get out of the hole you've dug. Right now, you're some weird freak in most of our minds. I'm cutting you more slack than most, because I have very little respect for experience and track record, if I cannot understand the why behind the experience and track record. However, most people do, and you, my friend, have demonstrated zero.
|
# ¿ Mar 30, 2008 18:58 |
|
I don't think we should stop at making programmers manage their own type systems in symbol names. I think they should have to code in assembly. Screw that: ones and zeros. Actually, what would happen if we made programmers code mechanically, maybe via some sort of punch card system that is about as reliable as the punch cards used in the Florida election? Surely, in that case, the bug count would go way down.
|
# ¿ Mar 31, 2008 16:22 |
|
rotor posted:We're gonna need bigger keyboards.
|
# ¿ Mar 31, 2008 17:36 |
|
yaoi prophet posted:Is there a das keyboard version?
|
# ¿ Mar 31, 2008 18:30 |
|
Clearly, return is a function.
|
# ¿ Apr 2, 2008 00:41 |
|
dustgun posted:I should mention, just for the sake of mentioning, that this was written by a coworker of a friend of mine. I changed the method and variable names, but, it's real live code somewhere.
|
# ¿ Apr 2, 2008 05:59 |
|
I dunno man, insert some underscores into the obfuscated version and it starts looking like Hungarian...
|
# ¿ Apr 2, 2008 06:24 |
|
Clearly the input should be s and the output should be ret.
|
# ¿ Apr 2, 2008 16:34 |
|
I reserve r for Regex instances.
|
# ¿ Apr 2, 2008 18:33 |
|
TRex EaterofCars posted:Boo! That Turkey Story posted:he said that he was using the parenthesis not because he thought it was a function but because he wasn't sure of the order of operations. quote:(though honestly who really cares, some extra parenthesis never hurt anyone).
|
# ¿ Apr 3, 2008 23:18 |
|
I general, I'd keep away from stuff like s.IsNullOrEmpty(), but I think I would make an except for that specific case. Especially since the name itself acknowledges that null is a valid "argument".
|
# ¿ Apr 7, 2008 20:12 |
|
floWenoL posted:What happens when s is null? code:
|
# ¿ Apr 8, 2008 14:10 |
|
Gotta protect against FILE_NOT_FOUND!
|
# ¿ Apr 10, 2008 22:53 |
|
You mean, a programming forum.
|
# ¿ May 13, 2008 20:20 |
|
It's best to have boolean variable names that sound boolean, like hidden (or even isHidden). I prefix nonpublic class fields with _ -- it's simple and to the point. With respect to calling a method inside a class, I'm a bit conflicted: if there's no this., the method invoked has to be one belonging to the enclosing type, at least in C#.
|
# ¿ May 15, 2008 16:47 |
|
I think this looks best:code:
|
# ¿ May 16, 2008 00:31 |
|
We should just rename DISTINCT to FIX.
|
# ¿ Jun 2, 2008 19:33 |
|
dwazegek posted:If the key doesn't exist the dictionary will throw an exception, it won't return null. NameValueCollection.Item Property posted:This property returns a null reference (Nothing in Visual Basic) in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is a null reference (Nothing in Visual Basic). This property does not distinguish between the two cases.
|
# ¿ Jun 25, 2008 13:47 |
|
Unless a throw was omitted from the catch{} statement above, then adding the catch{} changes the semantics to the exception being handled. Not good!
|
# ¿ Jul 8, 2008 22:29 |
|
Bonus posted:
|
# ¿ Jul 10, 2008 17:30 |
|
HappyHippo posted:Hmm
|
# ¿ Sep 8, 2008 15:36 |
|
BigRedDot posted:Seriously, what is attempting to iterate past the end of a sequence, if not an exceptional circumstance? Victor fucked around with this message at 22:03 on Nov 8, 2008 |
# ¿ Nov 8, 2008 20:28 |
|
The real WTF is in several online tutorials that teach you to use a StringBuilder for instances such as the above, instead of letting the compiler automatically combine all the string constants into one. It's pretty sad.
|
# ¿ Nov 19, 2008 20:12 |
|
The real WTF is that Java doesn't provide single, simple methods to read/write all text/lines, like .NET does. Hmmmm, maybe just wanting to get a file's contents without caring about how is a common enough operation to provide a shortcut in the standard library? P.S. Another problem with calling readLine in two places is that continue will screw you over.
|
# ¿ Nov 21, 2008 02:57 |
|
tef posted:What if b[] is being modified in a different thread?
|
# ¿ Nov 21, 2008 03:30 |
|
ashgromnies posted:who the gently caress in the history of computing thought, "ah, yes, xml is a decent markup language for organizing data... let's make code out of it"
|
# ¿ Nov 28, 2008 03:11 |
|
Not to mention reentrancy issues...
|
# ¿ Dec 4, 2008 20:30 |
|
For those of you with SQL2005, NEWSEQUENTIALID() was created for you:MSDN posted:Creates a GUID that is greater than any GUID previously generated by this function on a specified computer.
|
# ¿ Dec 5, 2008 03:57 |
|
O(1) for very large values of 1.
|
# ¿ Dec 5, 2008 06:03 |
|
Ledneh posted:Spent the last hour reading this thread and now I'm extraordinarily worried I'm going to end up in here some day. There were so many in here that I didn't understand without explanatory posts * or hiiiilarious
|
# ¿ Dec 6, 2008 03:51 |
|
Haha, there's more WTFage -- if the getter is called without a properly cased string, not only will the property fail to be set, but it won't complain, as it has no default: section. WTF indeed!
|
# ¿ Dec 16, 2008 18:25 |
|
The WTF here is probably writing a logging framework instead of using one -- or did you really need to write your own?
|
# ¿ Dec 16, 2008 18:40 |
|
twodot posted:This is kind of bizarre in my opinion. With a sufficiently strong type system you can claim any information is part of the typing. There are trade offs involved with deciding what information you put into a typedef and what information you put into a variable name. Personally, I think it can be useful to put information like whether a variable counts characters or bytes into the variable name rather than as a comment in the variable declaration or as a named type. Jumping between usages and definitions has costs especially in more object oriented code where definitions are non-local.
|
# ¿ Dec 30, 2008 19:03 |
|
Ryouga Inverse posted:I challenge you to prove to me that mysql_real_escape_string() takes care of absolutely every possible SQL injection attack, including ones that may be discovered later. I was just visiting this insults page and teapot's quote really resonated with me: teapot posted:No, it merely poisons minds, making programmers incapable of writing high-quality software and developing new ideas. It cripples their model of thinking by pushing them toward the optimal way of programming for severely mis-designed Microsoft products. Destruction of human minds' ability to improve is something that I don't take lightly. Victor fucked around with this message at 07:58 on Jan 8, 2009 |
# ¿ Jan 8, 2009 07:28 |
|
|
# ¿ Apr 28, 2024 19:11 |
|
I guess it's just hard for old people to be truly offensive other than, you know, being old and crufty and smelly with bad breath and only knowing ancient languages that stunt brand new minds. Since that's the kind of person who probably wrote up that site, well, you're not special enough to make it in.
|
# ¿ Jan 8, 2009 08:36 |