|
I was just thinkin the same thing. Although I'm a novice, I don't like the pre-formatted version of
<li><ul> and tables offer a convenient way to format things the way I want.
|
|
|
|
|
This is a static page that's 5 years old, on a website (no other platform). The table is being used to display a list, no javascript hooks, no fancy formatting. This could have been done with a UL so much cleaner, and would have remained semantically correct.
Also, I didn't display this code but this page uses the table rows to acheive paragraph breaks.
<div style="font-size: 10pt; font-family: Arial">
<table border="0" cellpadding="1" cellspacing="0" style="width: 690px; height: 297px">
<tr>
<td colspan="2" style="font-weight: bold; font-size: 10pt; width: 753px; font-family: Arial; height: 35px;">
User Agreement
</td>
</tr>
<tr>
<td colspan="2" style="font-weight: bold; font-size: 10pt; width: 740px; font-family: Arial; height: 50px">
To use this site, please read the following statements and indicate you agree...
</td>
</tr>
<tr>
<td colspan="2" style="width: 753px; height: 73px">
I understand that this is a sample paragraph of text and I agree
</td>
</tr>
</table>
</div>
Notice how they're all colspan="2" ? That's so later when we get to the "list" the first column can be used for the bullet. Which isn't done with an image, or even • but an actual text •
There might be legitimate uses for tables, but this isn't one.
|
|
|
|
|
throw new TableOverloadException();
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended TryParse to him.
"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[ ^]
|
|
|
|
|
What's the problem? He didn't use a Magic Number!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
private long _remainder = long.parse(0.ToString());
Would have been better
|
|
|
|
|
This is correct implementation:
int tryCounter = 0;
x:
if(!long.TryParse("0", out _remainder) && (tryCounter < 100)) {
tryCounter++;
goto x;
}
else if(!long.TryParse("0", out _remainder) && (tryCounter > 100)){
_remainder = 0;
}
else{
}
"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[ ^]
|
|
|
|
|
Finally someone using TryParse correctly!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
RugbyLeague wrote: Would have been better
What do you think about this?
private long _remainder = long.parse(((long)0).ToString());
ProgramFOX
|
|
|
|
|
public void WriteCode(ICodeContext ctx)
{
throw new BrainNotFoundException();
}
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Nice!
|
|
|
|
|
I would suggest the following:
private long _remainder = (long)int.parse((0).ToString());
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I got the same kind of code a few lines earlier!
Extract from the code I'm working on[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Never underestimate the idiocy of the programmer who came before you.
Otherwise, you'll always be surprised by how stupid they can be.
|
|
|
|
|
I will not underestimate it again!! ^^
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Super Lloyd wrote: I will not underestimate it again OK, I fess up. I have been surprised by the stupid programmer before me when that programmer was me.
|
|
|
|
|
Haha.. I should be wary of that one too indeed!! ^^
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I have a singleton data cache I'm working with.
I was testing whether or not the cache items were removing correctly from a consumer of the data.
I was checking via a different object in the debugger that would pull the object in question from the cache.
The problem: This different object creates the bloody cache item if it doesn't exist, but in the debugger it just looked like it wasn't deleting. My code was fine all along... The brain fart was in the debugging... Double
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Been there! Logging/tracing would have given you insight a bit quicker.
Wout
|
|
|
|
|
I was trying to save some time in the testing as a failure would have been really obvious to spot in test.
Figure that... You'd think I would know better after how many years of doing this.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
That's what unit tests are for, surely?
Debugger based testing is fundamentally limited by the lack of repeatability intrinsic in having a human poking around during the session, whereas automated tests to do the same thing should (if designed correctly) be absolutely repeatable.
As a bonus the tests stick around long after the debug session is ancient history. If someone breaks the code several years from now, the tests will start failing to alert you to that fact.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
When I first started in a Microsoft position, I asked why they were renaming procedures that were basically doing the same thing. It was their control method, the old procedures retained old behavior, the new code expected new behavior. After the new was promoted to production, the old was removed from SQL. If the lab started squaking, they knew they missed something.
Sure missed that on a later project. About 80% of the existing tests were failing because the sprocs were massively changed and no-one bothered to maintain the tests when they re-wrote the sprocs.
|
|
|
|
|
I think that's the most stupid code I refactored today!
But barely, and there is a lot more!
public XYZ()
{
_xyz = "0 , 0 , 0";
string[] parts = _xyz.Split(',');
Double.TryParse(parts[0], out x);
Double.TryParse(parts[1], out y);
Double.TryParse(parts[2], out z);
}
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
public void WriteCode(ICodeContent ctx)
{
throw new BrainNotFoundException();
}
Super Lloyd wrote: A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
Where the work stops. Right?
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
You nailed it!
Both remarks!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|