|
Well, everybody has to begin somewhere and then find out how to do it better. I really hope I can recover some of my early masterpieces from the tapes of my old computer.
Back then I had the choice between machine language (I recently recovered one of my earliest working games, a Lunar Lander 'clone') and Tiny BASIC (because the interpreter needed a little more than 2k of my precious 4k RAM). If you look at the grammar of Tiny BASIC (http://en.wikipedia.org/wiki/Tiny_BASIC[^]), then you will see that coding horrors are as good as certain with it.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.
I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
|
|
|
|
|
aspdotnetdev wrote: IF Letter = "`" THEN
LINE (Left + 2, Top)-STEP(1, 1), PrintColor, B
LINE (Left + 3, Top + 2)-STEP(1, 0), PrintColor
END IF
Does anyone even USE that character? Seriously, man... Too much free time
|
|
|
|
|
I'm pretty sure I just typed out any characters I saw on my keyboard.
|
|
|
|
|
Ian Shlasko wrote: Does anyone even USE that character?
I have some custom HTML building routines where ` is used instead of double quotes, e.g.
s= TextTag("b,a href=`link`", _T("<Click Me!>"))
that would generate
<b><a href="link"><Click Me!></a></b>
Do I get a cookie?
|
|
|
|
|
Yes, but it's a stale cookie.
The fresh ones came from a different site, so they were blocked
|
|
|
|
|
Ian Shlasko wrote: Does anyone even USE that character?
A lot in LISP and Scheme. I'm sure other languages use it too.
|
|
|
|
|
Ian Shlasko wrote: Does anyone even USE that character? Seriously, man... Too much free time
The GCC compiler can use the ` character for parts of parameters to some of it's commands... I'm not sure which ones exactly, or even why they even decided to allow the ` character . I never bothered to figure out where the ` character could be used with it because it seems such a useless character. I don't even know what it's called... a wonky apostrophe?
Your right though, who even uses the ` character?
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
It's called the backtick, gets a few obscure uses. I think you can use it for formatting at SO though. Some text-based markup systems (possibly Markdown?) use it to denote code etc.
Just sayin'.
Don't forget to rate my post if it helped!
"He has no enemies, but is intensely disliked by his friends."
"His mother should have thrown him away, and kept the stork."
"There's nothing wrong with you that reincarnation won't cure."
"He loves nature, in spite of what it did to him."
|
|
|
|
|
Nuh uh. It's a grave accent.
|
|
|
|
|
Adnan Siddiqui always used it in place of apostrophes. But he's not been around for a few years now, I guess his bomb suit finally worked.
Cheers,
विक्रम (Got my troika of CCCs!)
After all is said and done, much is said and little is done.
|
|
|
|
|
CTRL+V is the best function ever. Once you learn that, you never need anything else... lol
|
|
|
|
|
What about Ctrl+C?
Don't forget to rate my post if it helped!
"He has no enemies, but is intensely disliked by his friends."
"His mother should have thrown him away, and kept the stork."
"There's nothing wrong with you that reincarnation won't cure."
"He loves nature, in spite of what it did to him."
|
|
|
|
|
awesome!
|
|
|
|
|
Why didn't you use a special data file where basic number data could be fed through a simple algorithm that would draw your character?
|
|
|
|
|
Because it was my first semester programming and I was an idiot (I also might not have learned how to access files yet). That's why I posted this in the Coding Horrors forum.
|
|
|
|
|
Don't beat yourself up. It's called a learning curve. FWIW, I could not look back at the code I wrote in my first two years without wanting to throw up in my mouth a little bit.
|
|
|
|
|
I'm not beating myself up. I'm beating my old self up. Which is in contrast to my current self, who is quite not idiotic. Well, until 10 years from now when I see my current self as an idiot too.
|
|
|
|
|
Straightforward Basic code and not even close to a horror in my opinion. The purpose of the routine is clear, there are no wacky algorithms, and it's easy to locate an error, if say a "j" is not being displayed correctly.
And yes, I know that "Else If" would have been preferable and a "Select ... Case" even better.
|
|
|
|
|
I bet it was fast
|
|
|
|
|
I didn't run any benchmarks, but I doubt running 60 or so IF statements for each character would be extremely performant.
|
|
|
|
|
Hey sir wi juant to iuse ur code in mexico can u ad ń support
RS
|
|
|
|
|
robertosalazar wrote: to iuse ur code
While the above terrible code is an excellent example, iUse™ is a registered trademark of Apple™. Please discontinue your use of this term.
|
|
|
|
|
Last week, I was asked to change an old tasks report, adding a parameter for the completion status of a task. As it was my first task on this feature, I have been advised by the project's analyst that the report was showing only the overdue tasks.
As I moved to find and change the hardcoded status to the one selected on the UI, I've seen a call to a static method Status TaskStatus.GetEnum() , which would translate the selected option to the corresponding value from a Status enum (ok, I know, it sounds obvious). Actually, it was already being applied to the report, but the query was ignoring the status parameter anyway.
Then I decided to look into that method, and found this:
public class TaskStatus
{
public enum Status
{
OVERDUE,
CLOSED,
ON_TIME
}
public static Status GetEnum(string name)
{
switch (name)
{
case "":
return Status.OVERDUE;
default:
return Status.OVERDUE;
}
}
}
Update: added some context.
modified on Thursday, August 26, 2010 11:38 PM
|
|
|
|
|
Looks like the programmer had the specific requirement to increase productivity of task report users
This would have been worse
switch(name)
{
case "":
return Status.ON_TIME;
default:
return Status.ON_TIME;
}
I won’t not use no double negatives.
|
|
|
|
|
There could be a seperate section for
Coding Doh's
The difference between a Coding Horror and a Coding Doh! is subtle. Both involve the desire to slap a programmer in the head.
With a Coding Doh! the programmer wants to slap themselves, with a Coding Horror another programmer feels the urge to administer the slap.
|
|
|
|