What I want to talk about is the use of variables to hold non-repeated literal strings.
mrprogguy
@mrprogguy
Best posts made by mrprogguy
-
RE: The importance of variable names.
-
RE: Overheard in the next cube
Without knowing the language involved, it's hard to tell, but if the OP is doing a head-slap, then I'm thinking this isn't Java. In C or C++, a boolean is either true or false. It might be true because it wasn't initialized and is exporting bit junk (and it might also be false, but not as often), but it'll still be either true or false.
Debug builds might initialize it, even. (To false, I expect, because underneath it's probably an int.)
-
RE: Security by ignoring RFCs
@realmerlyn said:
I've been fighting this battle for years now... people writing "validation" regex for "email" addresses who haven't seen RFC[2]822, and ignoring the standard ways of doing this. Of course, we have other people who copy those people, so it's really becoming this bad virus of what "email" addresses are. Most of the time, these regex would reject my test address <fred&barney@stonehenge.com>, which has been in place for about a dozen years now. (Go ahead, try it... it's an autoresponder.) There is no inherent insecurity in accepting '822. It just means you coded bad somewhere else. Never let an email address near an unescaped SQL parameter or shell command line! It's not hard, people!
Having written a C++ class for determining valid '822 addresses (and having had to make it configurable at runtime so that the company using it could eliminate complaint characters they couldn't handle!), I can attest to how weak a validation strategy regex is for this. It reminds me of a sort of koan about regex:
Suppose a programmer has a problem to solve.
Suppose she chooses regex as a solution to the problem.
Now she has two problems.The C++ code for it wasn't exactly a picnic, either. I could tell because the ants didn't show up.
-
RE: Korean PMP developers need to learn American jargon
@belgariontheking said:
@Iago said:
I too am a gadget-hungry geek, but the first thing that pops into my mind when I see "S9 O2 L3" is science, not acronyms.
.. and I thought of Scrabble, though IIRC an S isn't worth 9 points.Now, can we please let this thread die?
Not until I point out that there is no element with the symbol "L."
Latest posts made by mrprogguy
-
RE: If the language developers cannot get it right...
Fascinating. The link goes to a 404 now.
-
RE: Bad Java code
Hrm. I've been out of Java awhile. When did Java add operator overloading?
But it cannot be if you are [i]using a custom type,[/i] and the fact that your program will end up working on a copy could be a trap for the unwary.
Google isn't serving up useful info, and I'm kind of in "lazy Sunday" mode.
-
RE: Crazy or Savior: You decide
Any heavy metal ingestion is tough on the liver and kidneys. In general, you'd want to avoid that sort of thing.
-
RE: Since when do CompSci people code like THAT?
Again, I am forced to ponder the thought processes of people who equate SQL and DB management with computer science. These things have as much to do with computer science as Guitar Hero has to do with guitar playing.
So, to answer the question: no, CS graduates would not do that; IS graduates certainly might.
-
RE: Apple display hardware support: Supported or not?
But you want serious performance with Java OpenGL?
-
RE: The importance of variable names.
What I want to talk about is the use of variables to hold non-repeated literal strings.
-
RE: BBC Website WTF
What's with the oil, indeed. Every pancake batter recipe I've ever read or used has either butter or oil in it. It helps keep the pancake from sticking, it makes for a better texture, and helps the flavor. In fact, you can cut down on the amount of egg by using butter or oil. If you're not putting in oil or butter, you're not making very good pancakes (or you're getting too much cholesterol from the eggs, or you like chiffon pancakes [whipped egg whites,etc.]).
Putting water in pancake batter helps when you're using buckwheat flour or some other sort of flour that wants a little more moisture; you could add extra milk, but that adds extra fat and lactose that you might not want in the finished product.
-
RE: ClusterWTF
The real WTF is, of course...wait for it, wait for it...VISUAL BASIC.
-
RE: Calculating VAT is always hard
I for one think it's strange to see how subtracting and then adding the VAT can result in a different price then the original!
Here's an exercise. Deduct 7% from 100. Then add 7% of the result back to the result. You get 99,51. 7% of 93 is a smaller value than 7% of 100.