|
|
Well there is the problem,
The last line says "Break" so it did
|
|
|
|
|
wouldn't those be warnings? are is "warnings as errors" turned on?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
TheGreatAndPowerfulOz wrote: wouldn't those be warnings? are is "warnings as errors" turned on?
They are warnings. I hate warnings. Warnings should be fixed, even if their not treated as errors by the IDE.
Marc
|
|
|
|
|
agreed
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
Amen to that, I use code analysis tools to and eliminate all the issues those detect.
Occassionally I have to use a pragma/code comment when I really intentionally did something, but its rare, and worth it for the number of bugs I detect early.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
When I started programming, structured programming was all the rage, and one of its fundamental principles was "single entry, single exit" for every block of code. While structured programming in no longer a primary development paradigm, it's principles are still valid.
Putting a return inside a case is the Devil's work.
Software Zen: delete this;
|
|
|
|
|
I fundamentally disagree, but it does depend on the language.
In C++ and many other languages I use RAII instead to ensure nothing is ever missed.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
A customer called last week reporting a problem with a screen not updating properly. The screen in question uses a 3rd party grid control. I pulled out the laptop and start debugging. I found only one possible problem related to user input, that eventually will be fixed, but wanted to get her back working with an easy workaround. So, I called, thinking that it could all be resolved quickly with a remote. So I get connected, verify that everything is up to date, go to the problem screen, try a quick update to demonstrate that it works, and...it doesn't work!
I pull up the code on my desktop and it misbehaves. I traced the problem back to one of the grid's events not firing. The code and executable work perfectly on the laptop and on at least one other test computer I have checked. There has to be a logical explanation for why this one component is behaving differently on different clients. I checked the grid's libraries on all three workstations and they are identical. It's probably going to be some obscure windows utility library that has been recently updated. Move to damage control mode and find another event that is reliable. Longer term, it's time to look for another component.
It's not often that I am able to replicate these kind of customer issues, and tracking this down without an environment that exhibited the oddity would have been extremely difficult.
Edit: Tried it again (code) on the desktop and it worked fine. The executable however fails to fire the event. I gave up trying to understand and identified a half-dozen places where I was using the faulty event and moved the code to another event that worked. Progress!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Just went through (and am still going through) a perfectly fine application bombing after a thin client OS was updated.
I rebuilt it on my system (in the thin-client environment) and it worked fine: put on user's system and it crashed mightily.
Considering the unique environment of a development system, there's no question why that cry is heard oft-enough: "I works on my machine".
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
But is it accurate?
As a developer you should appreciate knowing that the event will start in negative 3 hours. You should understand what that means.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
It's confusing to have a negative sign for each number place; there should be one at the beginning.
|
|
|
|
|
PIEBALDconsult wrote: It's confusing to have a negative sign for each number place Ha! So true. I hadn't even noticed it. I'm blind.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I was just watching it count down some more -- 00 doesn't have a negative sign.
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
|
|
|
|
|
This is the whole of a would-be Tip submitted today:
public class Class1
{
static void Main(string[] args)
{
Console.WriteLine("Enter a Number");
int num = int.Parse(Console.ReadLine());
for (int i = 1; i <=num ; i++)
{
if(i==2)
Console.WriteLine(2);
if (i % 2 != 0)
{
Console.WriteLine(i);
}
}
}
}
No text, no explanation - the author (I can only assume he works for Mindfire, it's about their level) clearly felt that it spoke for itself.
And boy, does it ever! This, ladies-n-gentlemen, is a Prime Number generator according to the author.
So...I tried it...
According to this code, the prime numbers under 26 are:
1
2
3
5
7
9
11
13
15
17
19
21
23
25 Now, call me old fashioned, but in my day, 9, 15 and 21 were divisible by 3, and both 15 and 25 were divisible by 5...
So which is wrong? The Code? Or the Laws of Mathematics? Only the author can tell...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: call me old fashioned, but in my day, 9, 15 and 21 were divisible by 3 Ya, but that's also back when Pluto was a planet. We live in a very different place now.
This user submitted this in QA, got closed, and resubmitted it in QA. I told him to post as a tip but apparently he didn't realize some explanation should be added. Or, the important part, THAT IT SHOULD WORK!
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
RyanDev wrote: back when Pluto was a planet.
What? You mean he wasn't always a dog?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
RyanDev wrote: but that's also back when Pluto was a planet
There was a thing on the telly recently that stated it had been voted back in as a planet.
|
|
|
|
|
True fans never gave up hope.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
That's democracy for you!
Life is like a s**t sandwich; the more bread you have, the less s**t you eat.
|
|
|
|
|
DaveAuld wrote: it had been voted back in as a planet
That is such a coincidence because I've just been voted in as a planet too.
Very cool. I hope to be voted in as a Sun one day so I can go by the name Apollo.
It's such a cool name.
Plus then all you people will have to rotate around me and I'll be the center of your Universe.
Yes, the sun is the center of the Universe.
I pre-emptively struck on your future humor that I didn't know that the sun was the center of a solar system. Wham!
|
|
|
|
|
back.....away.....from.....the.....keyboard......
|
|
|
|
|
If he's the center of the universe, then technically shouldn't the keyboard back away from him?
|
|
|
|