Linked by Thom Holwerda on Wed 27th Mar 2013 10:45 UTC
General Development "Programming is hard. Don't ever feel bad because you aren't as good at 'just googling it' as the person next to you. Don't ever let hackathon snobs talk you out of creating the next Twitter for cats or Yelp for public washrooms. Even the dumbest ideas (like trying to make animated polygons disappear and reappear) will help you improve as a programmer. Learning to program is largely about learning to learn - and the best way to learn is to do." For some reason, I love this short story.
Thread beginning with comment 556832
To read all comments associated with this story, please click here.
How I invented GoSub
by joshv on Wed 27th Mar 2013 13:41 UTC
joshv
Member since:
2006-03-18

On my 12th Christmas I was given a TI99/4A. My parents barely knew what it was, or what it did, but I was geek'd. Luckily they didn't have any money to buy games, otherwise I might have spent all my time playing rather than coding and ended up in an entirely different career.

The 99/4A had TI-Basic, a rather competent implementation (for the time), which had a GOSUB. I of course had no idea what the documentation was talking about. GOTO made sense, but GOSUB?

I went about coding with my GOTOs and IFs and quickly found that there were portions of my code that were doing the same thing. Wouldn't it be nice if I could only write that code once instead of having the same lines of code all over the place?

So I put the code in one place at a particular line number, set up some variables for it to work on, and then issues a GOTO to that line number. But then I had another problem, how the heck did I get back to where I came from?

Being a clever lad, I also set a flag before I issued my GOTO, the flag indicated the calling block of code. Then at the end of the block of re-usable code, I interrogated the flag using some IF statements, and issued the GOTO required to return to that calling block.

I rolled my own very fragile subroutines. When I later figured out GOSUB I kicked myself, long and hard.

Reply Score: 12

RE: How I invented GoSub
by AndyB on Wed 27th Mar 2013 13:56 in reply to "How I invented GoSub"
AndyB Member since:
2013-03-22

It's sometimes these mistakes which make you learn! With the limited commands available in those days it was easy to think you have to do all the hard work yourself. Life is much easier now with resources like the internet to reference to see if the answer is already there, there must have been millions of 're-inventing the wheel' cases back in the 80's.

Reply Parent Score: 2

RE: How I invented GoSub
by Laurence on Wed 27th Mar 2013 15:54 in reply to "How I invented GoSub"
Laurence Member since:
2007-03-26

That's not far off my first few years of programming as well.

I do miss those days. I mean, it was harder to write programs, you had fewer hardware resources at your disposal and the web wasn't around to cross-reference stuff when code failed, but programming back then was like stepping through the looking glass into a weird and magical world of infinite possibilities. However these days it's just a hundreds of different interpretations of social networking and rehashes of games but with slightly better graphics.

To be fair though, I'm just jaded because of age. I've seen the evolution of the PC, been a part of the cyclic evolution of workstations (dumb terminals connected to mainframes; through to powerful desktop workstations and now back to terminals hooked up to powerful centralised servers (except this time it's web-based cloud services instead of TSS served over telnet)).

One side of IT does still excite me though, and that's AR and hidden computing (or whatever the term is). The idea of technology adapting to humans - seamlessly integrating into our everyday lives (eg Google Glasses, home automation systems, etc) rather than us adapting our lives to suit the way technology works. These days that's the side of IT that most of my code is written for.

Reply Parent Score: 3

RE[2]: How I invented GoSub
by Tuishimi on Wed 27th Mar 2013 19:33 in reply to "RE: How I invented GoSub"
Tuishimi Member since:
2005-07-06

To be fair though, I'm just jaded because of age. I've seen the evolution of the PC, been a part of the cyclic evolution of workstations (dumb terminals connected to mainframes; through to powerful desktop workstations and now back to terminals hooked up to powerful centralised servers (except this time it's web-based cloud services instead of TSS served over telnet)).


I know it, right!!!!!! Same here. Started back in the early 80's with DEC and have seen a lot of changes in the business. Education-wise as well... CS majors have changed a lot since I went to school.

Reply Parent Score: 2

RE: How I invented GoSub
by looncraz on Wed 27th Mar 2013 19:30 in reply to "How I invented GoSub"
looncraz Member since:
2005-07-24

Wow... EXACTLY what I did!!

Reply Parent Score: 2

RE: How I invented GoSub
by ssokolow on Wed 27th Mar 2013 21:33 in reply to "How I invented GoSub"
ssokolow Member since:
2010-01-21

On my 12th Christmas I was given a TI99/4A. My parents barely knew what it was, or what it did, but I was geek'd. Luckily they didn't have any money to buy games, otherwise I might have spent all my time playing rather than coding and ended up in an entirely different career.

The 99/4A had TI-Basic, a rather competent implementation (for the time), which had a GOSUB. I of course had no idea what the documentation was talking about. GOTO made sense, but GOSUB?

I went about coding with my GOTOs and IFs and quickly found that there were portions of my code that were doing the same thing. Wouldn't it be nice if I could only write that code once instead of having the same lines of code all over the place?

So I put the code in one place at a particular line number, set up some variables for it to work on, and then issues a GOTO to that line number. But then I had another problem, how the heck did I get back to where I came from?

Being a clever lad, I also set a flag before I issued my GOTO, the flag indicated the calling block of code. Then at the end of the block of re-usable code, I interrogated the flag using some IF statements, and issued the GOTO required to return to that calling block.

I rolled my own very fragile subroutines. When I later figured out GOSUB I kicked myself, long and hard.


Sounds like what I did in the interval between age 8 and age 12.

However, given how little learning material I had lying around and how much other time was spent getting a deep understanding of DOS and batch files, reading free promotional materials requested from companies like 3com via 1-800 numbers and fantasizing about what I could build if I were rich, and playing shareware games like Commander Keen 4, I gained access to other languages before I discovered the purpose of QBasic's GOSUB.

Of course, I learned subroutines in a flash when I got a Perl book with companion CD at age 12. That lasted a couple of years, then I discovered Python and never looked back. (Aside from a little Visual Basic 6.0 in my Grade 10 computers course, but 11 and 12 switched to Java and C++)

(Perhaps ironically, I'd encountered Python earlier, but had a bad impression of it because it was "that multi-megabyte thing that various idiots required for their SourceForge projects, penalizing us poor people who couldn't go to the office and borrow an ISDN PRI, T1, or T3 connection... or the mythical OC-3." This was when broadband was just coming out, it was expensive, and our budget didn't already include cable TV.)

Edited 2013-03-27 21:37 UTC

Reply Parent Score: 2