Google Formula For Adding New Products
gpmac writes "Google executives attempted to demystify the search company's product decisions during presentations with Wall Street analysts on Wednesday.
As Google Inc. has moved beyond Web search and into product areas as diverse as e-mail, photo-organizing software and mapping tools, one of the common questions for the company is how it decides where to devote resources.
Looks like they are being a little more serious about it than their pigeon story would indicate."
Both are poor form. What's the difference between saying:
If (true){ Do something; }
and
Do something;
Nothing. They both do the same thing. They will always do the same thing. True will always be true. You're just doing a lot more typing and making the CPU process an unnecessary If statement. Now if you used a variable instead of just using "true", then that would be useful.
Now please proclaim me KING GEEK!
If used with proper commenting, it could be a placeholder for a later revision that would need to check something. You could just change the 'true' to whatever it is you want to check rather than having to add in the whole 'if' statement later.
Well, hopefully most compilers would pick up on the fact that the condition always evaluates to true and omit the branch. So, like another poster mentioned, if it adds clarity as to some future intention for the code then go ahead and keep it in there. It should be benign in terms of CPU usage.
Your courageous and selfless spelling corrections have made me a better person.
void CreateProduct(Products products)
{
Product* product = new Product;
product->setType(Product::Beta);
products.append(product);
CreateProduct(products);
}
love is just extroverted narcissism
Somewhat related to the topic of google's continued expansion into new product areas -- how does google make money?
I love the company, and I hope they continue doing what they are doing, but looking at their stock I get unpleasant flashbacks to the tech bubble of the late 90's, where companies with high coolness factor but low profits had skyrocketing stocks. Are ads and 'google appliance' sales enough to drive the $189 per-share stock price?
This is for both of you that mentioned this. Just because a compiler *should* do something, doesn't mean it will. More then likely, an if statement like that will be executed. If you need to add code that might be used later, go ahead. But comment it out so that it's not executed. And if you find you have more code commented out then actual comments, then maybe you should reconsider your design. There's no excuse for sloppy code. It's things like adding code "just in case" that introduces bugs, not to mention adding a whole load of unneeded complexity. If it doesn't do anything, it doesn't belong in the code.