Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Programming in everyday english language

Author
Message
Tri Alliance
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location:
Posted: 21st Jul 2008 06:24
Hi, I just thought i'd start a thread about how we use programming terms in everyday english.

My examples:
- bodily function
- Malfunction
- "What type of sandwhich would you like? "
- "Type on the computer please."
- "Wait for me!"
- "We might go to Cape Cod this summer, but that's a big if."
- "For my next birthday, I want a car."
- "If you eat your dinner, then you can have dessert."

If anyone has any more to add to my list, please do post them here.
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 21st Jul 2008 06:29
Wow, what an interesting discussion, i'll be sure to watch where this post is heading..

Your signature has not been erased by a mod... yet...
Little Bill
16
Years of Service
User Offline
Joined: 18th Jun 2008
Location: UK
Posted: 21st Jul 2008 09:12
Subway Worker: Hello, which bread would you like?

Me: [VarBread = (+(Int((4 * Rnd()) + 1)))] I'll have [VarBread]

Subway Worker: Ok. 6inch or Foot long?

Me:
[if VarHungry =>500 then
VarFootLong = true
else
VarFootLong = false
end if]
Foot Long please.

I could go on but I'm bored

El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 21st Jul 2008 09:29 Edited at: 21st Jul 2008 09:30
Quote: "- "We might go to Cape Cod this summer, but that's a big if.""


- "We might goto Cape Cod this summer, but that's a big if."

http://notmybase.com
All my base are not belong to anyone.
Matt Rock
19
Years of Service
User Offline
Joined: 5th Mar 2005
Location: Binghamton NY USA
Posted: 21st Jul 2008 09:41
I came here thinking you'd found some awesome programming language modeled on normal conversational English (more than BASIC already is). I want my money back .

Dazzag
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 21st Jul 2008 10:02
Quote: "I came here thinking you'd found some awesome programming language modeled on normal conversational English"
I did my final year project in HyperCard (old Mac language). The syntax was amazing. Spaces in variable names was one big thing, but sometimes it was so English that even when you couldn't find an answer in the book (I was pushing it a bit for what it was really meant to do) I would just think how I would want to do and just write it down in a sentence. And it would work a lot of the time. Bloody brilliant. Shame it was such a pain in the arse just to get it to work properly for what I wanted though.

Cheers

I am 99% probably lying in bed right now... so don't blame me for crappy typing
Current fave quote : "She was like a candle in the wind.... unreliable...."
Alucard94
17
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 21st Jul 2008 13:18
Quote: "Subway Worker: Hello, which bread would you like?

Me: [VarBread = (+(Int((4 * Rnd()) + 1)))] I'll have [VarBread]

Subway Worker: Ok. 6inch or Foot long?

Me:
[if VarHungry =>500 then
VarFootLong = true
else
VarFootLong = false
end if] Foot Long please.

I could go on but I'm bored
"

This is too hilarious!


Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 21st Jul 2008 15:53 Edited at: 21st Jul 2008 15:54
I wonder how you'd say that out loud.

If I had a programmer's mind, I'd have spaghetti code full of gotos to be instensely cruel to any other programmers.

Once I dropped the word 'goto' in to a conversation with a programmer at Uni, I never thought it could actually start a rant.

So:



"Experience never provides its judgments with true or strict universality; but only (through induction) with assumed and comparative universality." - Immanuel Kant
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 21st Jul 2008 15:57



I fail at life. No, really.
Tri Alliance
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location:
Posted: 21st Jul 2008 16:32
This is great everyone!

Mmmm...spaghetti code...just joking!
SunnyKatt
18
Years of Service
User Offline
Joined: 16th Sep 2006
Location: USA
Posted: 21st Jul 2008 19:26
"The sky is a lovely 35,180,255 today."

Favorite Quote: Dramatized code? Code Drama!

NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 21st Jul 2008 19:32
I wish, as ever here in Britain it's 160,160,160.


I fail at life. No, really.
Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 21st Jul 2008 19:51
If England.rain = true then English.complain = true
If England.hot = true then English.complain = true
if England.hot_with_cool_breeze = true then English.complain = true
if England.mild = true then English.complain = true

compiling...please wait...1 succeeded, 0 failed

If england.fine_weather = true then English.complain = false

compiling...please wait...
SYNTAX ERROR!

"Experience never provides its judgments with true or strict universality; but only (through induction) with assumed and comparative universality." - Immanuel Kant
Alucard94
17
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 21st Jul 2008 20:15
This thread is so funny =D


Little Bill
16
Years of Service
User Offline
Joined: 18th Jun 2008
Location: UK
Posted: 21st Jul 2008 20:23
if FostersPrice.tesco => 1.25 then
if fostersPrice.asda => 1.25 then
Me = Go.home
else
Me.Buy = Asda.Fosters
end if
else
Me.Buy = tesco.Fosters
end if

Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 21st Jul 2008 20:43
Nice one, Sep.

For the next break, I will inc my abs.

Then I will end you. Or maybe just remove limb.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 22nd Jul 2008 00:21
$boredofthread="VERY";
if ($boredofthread!="no")
{
echo "I AM ".$bored." BORED OF THIS THREAD";
ChangeLocation("vacation");
echo "BYE";
}

3.11 We do not tolerate posts made for the purpose of putting down another forum member, group of members, religion, our company, our staff or any of our moderators, past or present.
Tri Alliance
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location:
Posted: 22nd Jul 2008 00:47 Edited at: 22nd Jul 2008 00:54
Sorry, i'm just momentarily switching the topic.
Objects with math symbols:

### (wooden fence)
>))>(fish bones)
* * * *
* * * (snow)
(..)
- -( . )- - (snowman)
( . )

Anyone got some more of these to share? (get as creative as you want with these.)

Hey, I don't think I placed that winking smiley in the fish bones.
What happened here? I don't want that smiley in there. Also, when I posted this, my snoman started looking like his body was melting, and the snow wasn't lined up the way I had it when I made this post.
Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 22nd Jul 2008 01:55
For week = 1 to 200
tesco.price = tesco.price *0.2
tesco.food.quality /1.5
if week > 4 then seppuku.mood = "&^*^%"
if week = 8 then print "Screw this I'm off to Sainsburys"
next week

"Experience never provides its judgments with true or strict universality; but only (through induction) with assumed and comparative universality." - Immanuel Kant
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 22nd Jul 2008 08:12
haha:
gas.price=gas.price+0.10
if customer.pay=true
goto haha
else
goto haha
endif

_____________________
Windows Vista: Just say no.
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 22nd Jul 2008 09:23 Edited at: 22nd Jul 2008 09:30
start:

Do
Inc tax,10
economy=economy+1
food=food+tax
oil=oil+(tax*10)
income_tax=tax^12
gas_prices=oil*tax
house_prices=house_prices+tax
Debt=Debt^(tax*100)

If tax>0 then gosub blame_global_warming
If tax>1000000000000000 then goto recession

Loop

blame_global_warming:
for x=0 to tax
print "bulls**t
next x

return


recession:
do
economy=economy-12
crime=crime+45
unemployment=unemployment+1000
Prob=Rnd(50)

if prob=25 then goto Civil_War
loop

Civil_war:
unemployment=-900000
delete file "parliament.crp"
if object exist(1)=0 then make object "ideal_government.x",1
if image exist(1)=0 then load image "flowers.png",1,1
texture object 1,1
tax=10
economy=0
Goto start

Invincibob 8
16
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 22nd Jul 2008 10:05 Edited at: 22nd Jul 2008 10:07






Your signature has been erased by a mod because with the text it is larger than 600x120
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 23rd Jul 2008 03:30
Quick note about GOTOs:
THEY ARE FASTER THAN FUNCTIONS.

GOTO code in pseudo programming language:

EXPORTED TO ASM:


Where as if _done was a function the pseudo programming language code would look like this:


Now, the output code would be basically the same, but with CALL instead of jump. In addition, if done() took parameters, then data would have to be pushed onto the stack. Besides, keywords such as IF/THEN/ELSE/SWITCH/CASE/etc.. basically make GOTOs in the exported ASM code anyways.

GOTO is FASTER than a function call, and takes less space.


if ranting > 1000 then finish_post = 1 : add_sig = "Cheers,\n\n -naota\n"

Cheers,

-naota

I'm not a dictator to those that do stuff for me by will. Only those who don't.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Jul 2008 06:20 Edited at: 23rd Jul 2008 06:24
Quote: "Quick note about GOTOs:
THEY ARE FASTER THAN FUNCTIONS."


By the way your two code examples would not execute in the same way, as it would jump back to the if statement after the function completed.

With your example the code doesn't need to flow back to the GOTO statement, so it wouldn't make sense to put a function there anyway.

If I were the programmer I would have structured it like this:

EDIT: Redone in C

Quote: "
x = 1 | 2;
if x & 2
{
endProcess(getProcess());
}
else
{
printf("omg, where's my two?");
}
"


or

Quote: "
x = 1 | 2;
if (!x & 2)
{
printf("omg, where's my two?");
}
else
{
endProcess(getProcess());
}
"



ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 23rd Jul 2008 09:37
Quote: "Quick note about GOTOs: THEY ARE FASTER THAN FUNCTIONS."


The 70's called, they want their terrible programming style back!

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Jul 2008 14:16 Edited at: 23rd Jul 2008 14:20
while val(mid$(get time$(), 1) + mid$(get time$(), 2)) < 10
sleep 1
endwhile

Edit: Aw, didn't see NeX had allready beaten me to it

"I kören hörs de brummande busarna Björnligan och Gondolen"
Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 23rd Jul 2008 15:34 Edited at: 23rd Jul 2008 15:46
Quote: "Quick note about GOTOs:
THEY ARE FASTER THAN FUNCTIONS."


The only good thing about them is if you're lazy like me they're good and they're a great practical joke, but so many have stressed how awkward they can be - and they are, it made it impossible to find a bug in something I programmed for the TAC so I can see why they call it spaghetti code.

"Experience never provides its judgments with true or strict universality; but only (through induction) with assumed and comparative universality." - Immanuel Kant
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 24th Jul 2008 01:02
Quote: "but so many have stressed how awkward they can be - and they are"


You should try assembly. Goto's (or rather jumps) are how you loop.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 24th Jul 2008 07:28
Quote: "Quick note about GOTOs:
THEY ARE FASTER THAN FUNCTIONS."


I'll have to test functions, but for loops at least, they aren't any faster at all. A while loop is just as fast. I'm about to test functions.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 24th Jul 2008 07:46
You know what? I'm not even going to try and prove that goto's are faster for functions. It's too damn difficult to code in C++. Either way, forget about goto's. They're never necessary.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Dazzag
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 24th Jul 2008 09:21 Edited at: 24th Jul 2008 09:24
Quote: "I'll have to test functions, but for loops at least, they aren't any faster at all"
It depends on the language, but normally GOTOs are faster. Think about it, a function has to keep a memory of where it was before and then return to it when finished. So slightly higher overhead. It isn't much but in a tight loop where FPS is king, then it can make a difference when it comes to the wire. Hell, I remember years ago when to get the last possible speed available on speccy machines they would avoid arrays in tight loops just to get it to go that little bit faster. ie. they would use multiple variable names with multiple lines of identical (apart from the variable names) code. Nice.

When I started my job I was knocked back that the programming standards document they had included GOTOs. Heavily. As can be seen in above comments the practice of drumming in GOTOs are bad and you are a moron coder for using them are still going on happily. But our system deals in massive amounts of data, and they found early on that a tight loop using WHILE or REPEAT (or whatever) would take at least 10% longer. No problem on small jobs, but on massive ones (many GB of data) that made a 6 hour run take 7 hours. Thats quite important when you have 50 similar overnight runs on only a 16 processor machine. Plus RAD and the support was quicker. We still had strict procedures, and as long as you aren't a complete moron, then you can easily avoid spaghetti code. If anything you would get new grads trying to code WHILE and REPEAT type loops (which would fail our QA even if perfect, and were mainly written because they hadn't read the standards document) and end up breaking stacks and the like because they goofed up somewhere.

And saying all that, nope, I try to avoid GOTOs like the plague in DBP and VB (my main other language). You do get drummed in like hell about avoiding GOTOs, and it's hard to get out of your mind. Something about a lovely designed and laid out code.

Cheers

I am 99% probably lying in bed right now... so don't blame me for crappy typing
Current fave quote : "She was like a candle in the wind.... unreliable...."
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 24th Jul 2008 19:20
I'm not sure what language you're using, but in C++, while's aren't any faster than goto equivalents (especially with optimizations). Here's the disassembly for both in C++.



And the goto equivalent:



Though, you may have meant a different usage of goto's. If so, please speak up so I can check it. I'm curious.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 26th Jul 2008 10:18
Quote: "but normally GOTOs are faster. Think about it, a function has to keep a memory of where it was before and then return to it when finished. So slightly higher overhead."


As far as I can tell there would be a memory overhead, not a speed overhead. When optimizing code you usually give either speed or memory a priority, and then make changes accordingly. Most of the time it's impossible to achieve both simultaneously.

I have seen GOTOs in modern software as there can be a slight optimization savings, but it's rare and one of those things that are considered bad coding in 99.9% of situations.


Login to post a reply

Server time is: 2024-11-20 10:40:49
Your offset time is: 2024-11-20 10:40:49