|
What you have done here is what I used to call "brute-force" programming, since it was easier for me to begin with a "hard map" of repetitive data that I could use to hammer out working code, however inelegant. Later, I would identify the patterns, and commit the raw data statements to configurable loops which I would then integrate with the rest of my spaghetti.
It took YEARS for me to learn to plan ahead, and when I least expected it, here comes OOP, Abstraction, Polymorphism, Inheritance, and all that that implies...So back to square one, and I found myself forced to embrace the Evil that is Microsoft.
Your little program is FAR ahead of what I was doing at your age, because the tools you are using simply didn't exist back then. Graphics? We didn't need no stinkin' graphics!!! We had 6x9 hardware-generated character sets, all upper case, 40 columns, and two damn lines, if we were lucky. Ever tried to play Donky Kong on a line-printer?
So forgive the harsh criticism doled out by some of these coders, keeping in mind that these forums host some of the best and most experienced software engineers on the planet, and that as a general rule engineers are not commonly known for their tact, social skills, or personal hygiene.
Add to that the fact that many of these people make their living undoing the nightmares passed down to them from, shall we say, "less than marginally competent" programmers, and you can understand why some of them might seem unkind.
Just listen to them, and avoid doing things that will get you banned, and before you know it your programming skills will increase exponentially, earning you a coveted spot where you can expect to receive unkind criticism for even the most brilliant code.
They are, at least, responding with suggestions; in my opinion it is far worse to have your posts go entirely ignored. As long as you keep learning, refusing to be discouraged, and are capable of grasping the abstractions involved in advanced coding, while being able to tell the difference between unexpected behavior caused by your code vs. unexpected behavior induced by Microsoft bugs, YOUR generation will construct the applications that MY generation NEVER dreamed possible.
|
|
|
|
|
Seen some code that looks like:
[RangeValidator(min:-128,max:128)]
public sbyte AdditionalData{get;set;}
I see at least two problems with this
|
|
|
|
|
What's wrong with my code??
|
|
|
|
|
andyharglesis wrote: What's wrong with my code??
It thinks it looks good without a shirt on. Oh, wait...
|
|
|
|
|
You know, admitting that I write the code in the hall of shame is in my "top 100 things not to do" list
A hidden needle is way more effective than an unsheathed sword.
|
|
|
|
|
Is everything O.K. If not validate it........Just Kidding
|
|
|
|
|
Well 128 is not valid for a signed byte... What would be the second problem ?
Philippe Mori
|
|
|
|
|
Is it OK to post "Which language should I use"? It is going to be a topic will amusement and answers, etc.
|
|
|
|
|
I wouldn't ask which language you should use in this particular forum. Try asking that question in the Q&A section[^] instead, and be specific about what you're trying to accomplish.
For each particular topic of discussion, you should open a new thread in the appropriate forum. Much like a bug report, right? You'd want the issues all separated into discrete tickets.
Of course, if you were asking which language you should post horror stories from, you should post ALL of them to maximize the sympathetic groaning potential
|
|
|
|
|
Thanks... I posted it in the wrong place anyway. The proper place is apparently the lounge.
|
|
|
|
|
The lounge is a perfect choice for .... damn! I can't remember...
I never finish anyth...
|
|
|
|
|
Code from one of my junior ----
this is Page-A.aspx
protected void Page_Load(object sender, EventArgs e)
{
Response.Redirect("Page-A.aspx");
}
Above piece of code when load, it keeps browser busy to keep loading the same page....
|
|
|
|
|
What was an intention?
Greetings - Jacek
|
|
|
|
|
Want to send to the login page and has a login user conrol on the same page. He is redirecting on the same...
|
|
|
|
|
Doubt it, just endless loops are usually errors.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hehe, nice one.
Although I thought Response.Redirect sent a HTTP 303 and the browser was clever enough not to re-request the same page in that case.
And yes, it would be interesting to know what he meant to do with that.
|
|
|
|
|
Want to send to the login page and has a login user conrol on the same page. He is redirecting on the same...
|
|
|
|
|
Naaah, that's not a coding horror - it's a typo! Shoulda been caught in the code review that his senior performed before check-in...
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
Reminds me of a place I worked at that had the application maintain a trace log. Procedure calls and errors were logged to a disk file.
So when the disk was full and generated an error...
Only to be matched by their desire not to have a cursor displayed (pre-Windows version) during start up that they moved the cursor off the screen and then wondered why a start up error message was not being displayed...
I told them to just turn the cursor off. I was told you couldn't do that, see the Peter Norton book...and then any other book and find them using the same sentence. I pulled out my 6845 CRTC controller spec sheet and turned the cursor off with it still on the screen space. Error messages became visible.
My Former Bitch Supervisor From HellTM declared I was arrogant for thinking I was smarter than Peter Norton (a claim I never made).
Psychosis at 10
Film at 11
|
|
|
|
|
Wait, your supervisor had declared that this task was impossible (according to Peter Norton's book) and then you tried it successfully, which proved that you were arrogant rather than... smart and determined?
Real nice. Perhaps she should be working behind a library service desk somewhere
|
|
|
|
|
It would have been nice, but in her eyes, I showed her up. Being an insecure control freak she was always afraid I was after her job. She never accepted the idea that I had no interest in her job, I had my own career path I was interested in.
But don't get me started. I and my colleagues who had the misfortune of working under her have HOURS of stories about her.
Psychosis at 10
Film at 11
|
|
|
|
|
rahultandon1000 wrote: Code from one of my junior :-> ---- this is
Page-A.aspx
<SPAN class=code-keyword>protected</SPAN> <SPAN class=code-keyword>void</SPAN> Page_Load(<SPAN class=code-keyword>object</SPAN> sender, EventArgs e)
{
Response.Redirect(<SPAN class=code-string>"</SPAN><SPAN class=code-string>Page-A.aspx"</SPAN>);
}
for (int i = 0; i < 101; i++) Blackboard.WriteLine("I must not use unterminated recursion.");
|
|
|
|
|
Surely you mean
for (int i = 100; i >= 0; i++) Blackboard.WriteLine("I must not use unterminated recursion.");
|
|
|
|
|
Or even...
void F() {
Blackboard.WriteLine("I must not use unterminated recursion");
F();
}
(Your version was unterminated iteration)
|
|
|
|
|
rahultandon1000 wrote: it keeps browser busy to keep loading the same page
Finally someone who knows how to get the fullest from the newest i7 uber-core computers with really very fast internet connections!
It's an OO world.
|
|
|
|