Turkey code, what was I smoking?

Joined
Sep 20, 2022
Messages
338
Reaction score
42
Have any code you're not proud of? Let's have a laugh.

Read a word from a file, words are delimited by any amount of whitespace. Comments (counted as whitespace) begin with a semicolon and end at the next newline.
Code:
A = empty string
WHILE true
   IF EOF
      EXIT
   B = read a byte
   IF B == semicolon
      WHILE B != newline
         IF EOF
            EXIT
         B = read a byte
      B = space
   IF B is whitespace
      IF A != ""
         EXIT
   ELSE
      append B to A
This is just plain lazy, I should lose the 3 exits and think up better conditions on my loops.
 
Joined
Sep 20, 2022
Messages
338
Reaction score
42
I was writing a program, and it used formulas from an engineering standard (unified inch screw threads).

I wanted the program's functions to resemble the standard's formulas as closely as possible.

Unfortunately the standard used 1 or 2 letter variable names, primes, subscripts, and a mixture of english and greek letters.

This is the naming convention turkey I came up with...
Code:
prefixes:
 A english uppercase normal
 B english lowercase normal
 F english uppercase subscript
 G english lowercase subscript
 C greek uppercase normal
 D greek lowercase normal
 H greek uppercase subscript
 I greek lowercase subscript
Primes are encoded as a digit:
' is 1
'' is 2
Greek letters are encoded as the first 2 letters of their english names:
omega is OM
(omicron will have to be something else)

Behold the turkeyness!
x = BX
theta' = DTH1
phi with subscript 2 = DPHF2
LE with subscript pi = ALAEIPI

Such a bad idea.
 
Joined
Sep 20, 2022
Messages
338
Reaction score
42
I can't think of many turkey applications, because a bad idea rarely gets off the drawing board, but there was this one time...

I was thinking about volume and surface area, and the monte carlo method.

The program selected a random point, and decided whether it was inside the shape or not.

On screen was 3 views: plan, elevation, and side

As more and more points were plotted, the shape began to form and the volume calculation got more and more accurate.

The surface area idea never happened, and I never used the program with any shape more complicated than a wedge.
 
Joined
Sep 20, 2022
Messages
338
Reaction score
42
I was trying to come up with an interesting new idea.

My reasoning went along these lines...

Complicated math theorems are proven by showing a path from the complicated statement back to the fundamentals, using many small steps of simpler theorems.

Turkey conclusion: New ideas are just sequences of old ideas.

A mousetrap is a bit of wood, a spring, and some wire.

Turkey conclusion: New ideas are just combinations of old ideas.

So I downloaded a dictionary file, from the resource page of a Python book. I wrote a program to select 5 words at random and display them.

I ran the program a few times every day and pondered the 5-word combinations.

I came up with exactly zero useful ideas, because this program was a turkey.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top