Author Topic: Thinking in software and code poetry  (Read 3747 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Thinking in software and code poetry
« on: January 28, 2018, 06:53:32 pm »
I've been able to do this from a young age.  I can think in code. I'm sure it's not uncommon for people who have studied programming for a long time.

Being able to think in code leads you to rather bizarre code based descriptions of the human condition.

Obviously we can plagiarise with:

(2*b) || (!2*b)

Consider:

while( you->love(me) ){
    i->love(you);
}

It's fairly profound, but logically describes volatile love.

Another example of what I call "Code poetry".


int assessLife( int situation ) {
    if( situation == GOOD ) {
        return 0;
    } else {
        return -1;
    }
    return TRUE_HAPPINESS;
}
 

So... describe a human condition in code.... or describe you life right now in code.
« Last Edit: January 28, 2018, 07:08:05 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Thinking in software and code poetry
« Reply #1 on: January 28, 2018, 07:03:02 pm »
Genuine true love:

while( true ) {
   you->love(me->love(you));
}


Non programmers:
The profound thing is... there are no conditions on the love on either side and it's infinitely recursive.
« Last Edit: January 28, 2018, 07:05:56 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19497
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Thinking in software and code poetry
« Reply #2 on: January 28, 2018, 07:14:03 pm »
System.exit(0);
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Zbig

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: Thinking in software and code poetry
« Reply #3 on: January 28, 2018, 08:11:43 pm »
I'm a hardware guy, I can't think of anything in code, it's just a black hole at the moment...hmmm (void).
 

Online Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Thinking in software and code poetry
« Reply #4 on: January 28, 2018, 10:29:49 pm »
From the 1980s with BBC BASIC. It amused me back then { hey we didn't have for(;; )  } and I admit to similar flourishes in working code running in blue chip financial institutions since...

Code: [Select]
>L.
   10 TheCowsComeHome = FALSE
   20 REPEAT
   30 PRINT "MOO! ";
   40 UNTIL TheCowsComeHome
>
 

Offline hugo

  • Regular Contributor
  • *
  • Posts: 165
  • Country: ca
Re: Thinking in software and code poetry
« Reply #5 on: January 28, 2018, 11:20:26 pm »
Unconditional love:  ;)

Code: [Select]
for (;;) {
     I -> love (you);
}
 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: Thinking in software and code poetry
« Reply #6 on: January 30, 2018, 02:20:08 am »
Code: [Select]
public ExFiance {
...
};
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Thinking in software and code poetry
« Reply #7 on: January 30, 2018, 03:35:20 pm »
I consider myself a fairly emotional, sometimes overly sensitive person but this is just flat out embarrasingly silly and cringeworthy :palm: Please. Stop :P
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Thinking in software and code poetry
« Reply #8 on: January 30, 2018, 04:16:28 pm »
Hate
Love
SWAP
DROP

 ???
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Thinking in software and code poetry
« Reply #9 on: January 30, 2018, 05:12:33 pm »
Genuine true love:

while( true ) {
   you->love(me->love(you));
}


Non programmers:
The profound thing is... there are no conditions on the love on either side and it's infinitely recursive.
True love is unconditional.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Thinking in software and code poetry
« Reply #10 on: January 30, 2018, 05:24:04 pm »
710 77345
 

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: Thinking in software and code poetry
« Reply #11 on: January 30, 2018, 05:29:45 pm »
A coder thinking in a case sensitive language walks into the office, and:

"Capitalgee-ood morning, CapitalJay-ohn"
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Thinking in software and code poetry
« Reply #12 on: January 30, 2018, 10:12:22 pm »
Genuine true love:

while( true ) {
   you->love(me->love(you));
}


Non programmers:
The profound thing is... there are no conditions on the love on either side and it's infinitely recursive.
True love is unconditional.

Unless you change the definition of true.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Thinking in software and code poetry
« Reply #13 on: February 05, 2018, 07:10:44 pm »
Here's a slightly less mushy one:

Code: [Select]
int assessLife(int situation) {
    if(situation == GOOD){
        return 0;
    } else {
        return -1;
    }
    // True happiness
}
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: Thinking in software and code poetry
« Reply #14 on: February 05, 2018, 10:39:05 pm »
Code: [Select]
int lifetime = random(80)

while lifetime-- do
begin
  eat();
  fork();
  sleep();
end;

die();
Bob
"All you said is just a bunch of opinions."
 

Online PlainName

  • Super Contributor
  • ***
  • Posts: 6842
  • Country: va
Re: Thinking in software and code poetry
« Reply #15 on: February 06, 2018, 02:55:11 am »
That kind of implies your lifetime is predetermined. Wouldn't it  be more appropriate to have:

Code: [Select]
int lifetime = 0;
while (lifetime++ < rnd(80)) do
...

I think that reflects the actualite more closely in that things crop up and snuff on an apparent whim (think car crashes or an overdose, etc).

 

Online Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Thinking in software and code poetry
« Reply #16 on: February 07, 2018, 02:18:36 am »
That kind of implies your lifetime is predetermined. Wouldn't it  be more appropriate to have:

Code: [Select]
int lifetime = 0;
while (lifetime++ < rnd(80)) do
...

I think that reflects the actualite more closely in that things crop up and snuff on an apparent whim (think car crashes or an overdose, etc).

It happens to be my nannas 94th birthday today. This hard coded rubbish is worse than the Y2K millennial bug stuff.
 
The following users thanked this post: NivagSwerdna

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Thinking in software and code poetry
« Reply #17 on: February 07, 2018, 10:21:51 am »
Code: [Select]
while (lifetime++ < 70 + (rnd(80)-40) )
Better?   Although it does guarantee you will live to at least 30.  This is the good thing about being a software engineer, you get to be God.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Online PlainName

  • Super Contributor
  • ***
  • Posts: 6842
  • Country: va
Re: Thinking in software and code poetry
« Reply #18 on: February 07, 2018, 02:56:55 pm »
Quote
my nannas 94th birthday today

Oh dear. She seems to be running an earlier iteration of the code:

Code: [Select]
while (lifetime++ != rnd(80)) do
Just update her to the latest version and she'll be fixed.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Thinking in software and code poetry
« Reply #19 on: February 08, 2018, 05:03:37 pm »
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Thinking in software and code poetry
« Reply #20 on: February 08, 2018, 09:31:23 pm »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Thinking in software and code poetry
« Reply #21 on: February 08, 2018, 10:38:02 pm »
short road(long walk) { return wizer; }
 

Offline @rt

  • Super Contributor
  • ***
  • Posts: 1059
Re: Thinking in software and code poetry
« Reply #22 on: February 09, 2018, 02:14:49 am »
void circumstances() {
while(1){}
return;
}
 

Offline engineer_in_shorts

  • Regular Contributor
  • *
  • Posts: 122
  • Country: gb
Re: Thinking in software and code poetry
« Reply #23 on: February 09, 2018, 02:52:31 pm »
I seem to keep going round this loop at the moment:

Code: [Select]
int HourOfDay = 7;
FeelingStates currentFeeling = Grumpy;
//Typical Day
while (1) {

if (HourOfDay>7 && HourOfDay<=11) currentFeeling = Grumpy;
if (HourOfDay>11 && HourOfDay<=18) currentFeeling = Depressed;
if (HourOfDay > 18 && HourOfDay < 23) {
KeepDrinking();
currentFeeling = Happy;
}
HourOfDay = GetHourOfDay();
}
 

Offline @rt

  • Super Contributor
  • ***
  • Posts: 1059
Re: Thinking in software and code poetry
« Reply #24 on: February 09, 2018, 04:30:39 pm »
Here, now you have more time in your day :D

Code: [Select]

 int HourOfDay = 7;
 FeelingStates currentFeeling = Grumpy;

 while (1) { //Typical Day
// default goes here
  if (HourOfDay > 7) {
  if (HourOfDay < 23) {currentFeeling = Happy; KeepDrinking();}
  if (HourOfDay <= 18) currentFeeling = Depressed;
  if (HourOfDay <= 11) currentFeeling = Grumpy;
 }
  HourOfDay = GetHourOfDay();
 }
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf