MatthewSchenker Posted November 29, 2012 Share Posted November 29, 2012 Greetings, I'm curious about how those of us go back a ways have some very old built-in habits, tendencies, practices, etc., and how this affects you when coding. Brief Personal History: I learned "programming" on TRS-80s in 1980, when my forward-thinking 8th-grade science teacher obtained a bunch of them for our class. He also ran an after-school workshop on learning computer programming (BASIC), which I attended with great excitement. I also did my first programming in the early to mid-1980s using Apple IIs for my uncle, an accountant who wanted what we'd today call "apps" to automate calculations. That same uncle bought me a Timex Sinclair for Christmas in 1982, which I still own. I'm happy I was introduced to coding so early in life. But sometimes, I find that the ideas from those days stick, perhaps too much. Just one example... When I learned BASIC (don't laugh), a bit of code with conditionals looked something like this: ... 30 IF Y$ = "Y" OR Y$ = "y" THEN GOTO 115 ... 115 PRINT "Thanks man!" But today, in PHP, to test for a condition, it works like this: if($page->images) { /* Do something here that would be true if there are images in the "images" field */ } else /* Do something here that would be true if there are no images in the "images" field */ } In the above example, a lot of the PHP conditional statement is assumed. In the old days, we had to spell it out and send someone to a particular spot in the code. Obviously, no one in his/her right mind would want to go back to the old days! But because of ingrained ideas, I find myself mentally expecting the "then" in the initial conditional statement when it's not necessary. It's a simple thing, but it causes moments of pause. There are lots of other examples beyond simple conditionals. Just wondering, does anyone else here with a similar history feel the same effects? Thanks, Matthew 2 Link to comment Share on other sites More sharing options...
ryan Posted November 30, 2012 Share Posted November 30, 2012 Now that you mention it, I think that I did have a similar experience a while back. My first exposure to coding was also in BASIC, I think back on old Apple ][e computers. Actually it seemed like we used some language called LOGO back in 2nd grade, where the whole purpose is to make a turtle move around the screen, but can't remember exactly. Even BASIC has come a long way since then (with VB). To me the "GOTO 115" type statements also seem reminiscent of Assembler or COBOL. 1 Link to comment Share on other sites More sharing options...
Adam Kiss Posted November 30, 2012 Share Posted November 30, 2012 LOGO ROCKED, MAN! REPEAT 4 [FD 10 RT 90] 1 Link to comment Share on other sites More sharing options...
teppo Posted November 30, 2012 Share Posted November 30, 2012 Slightly off-topic, but did you guys know that PHP, since 5.3.0, also includes goto? Comeback of BASIC programming style! --- Seriously speaking, that xkcd comic at the bottom of manual page linked above pretty much summarizes how I really feel about this.. Link to comment Share on other sites More sharing options...
DaveP Posted November 30, 2012 Share Posted November 30, 2012 To me the "GOTO 115" type statements also seem reminiscent of Assembler or COBOL. You can still use goto in PHP - http://php.net/manua...ctures.goto.php Darn, teppo beat me to it. Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 1, 2012 Share Posted December 1, 2012 LOGO ROCKED, MAN! REPEAT 4 [FD 10 RT 90] Its like turtle module in python today (which we have to use in school). Link to comment Share on other sites More sharing options...
Adam Kiss Posted December 1, 2012 Share Posted December 1, 2012 Its like turtle module in python today (which we have to use in school). I'm pretty sure that that Python module in fact is LOGO. Oh man, brings back memories. Link to comment Share on other sites More sharing options...
DaveP Posted December 2, 2012 Share Posted December 2, 2012 GFA BASIC That is all. 1 Link to comment Share on other sites More sharing options...
MatthewSchenker Posted December 2, 2012 Author Share Posted December 2, 2012 Hello, To DaveP: Wow, that brings back memories! In college in the mid-1980s, I had an Amiga and a dot-matrix printer in my dorm room. In those days, you could still really impress a professor simply by handing in a paper neatly laid out, with headers and footers, and no White-Out corrections! I had a little business typing papers for students (I had one of the few computers on campus). Looking back on it, that Amiga was certainly ahead of its time. And yes, we also had a computer class where we moved that Logo Turtle around. Thanks, Matthew Link to comment Share on other sites More sharing options...
Joss Posted December 2, 2012 Share Posted December 2, 2012 My first experience of programming (I am old enough that it wasn't called coding back then) was with a large Prime mainframe owned by Ed Ross of Quantime. (and the incredible statistical analysis program called Quantum) I was only in my teens and my brother was working there in sales. Now, I would love to tell you how what I did related to what I do now, but since it was all on punchcard and there is rather a large gap in the middle, I haven't the foggiest!! By 1977, things had leapt on in, well, leaps, and I remember going into the company to play the brand new game they had just been sent - Zork! Never did solve it though ... I have a copy somewhere, perhaps I should try again! Joss 1 Link to comment Share on other sites More sharing options...
Joss Posted December 2, 2012 Share Posted December 2, 2012 Matthew, One thing I do have trouble with is my brains natural want to make the sentence make sense. So, with if (something) { echo something; } I really want it to say: if (something) then { echo something } The missing "then" really upsets my writers brain .... Link to comment Share on other sites More sharing options...
MatthewSchenker Posted December 2, 2012 Author Share Posted December 2, 2012 Greetings, I have to say, it's satisfying to know that there are others here of my generation. Often, it feels like Web development is utterly dominated by the brilliant and capable under-25 set. To Joss: yes, your point about the conditionals is precisely what I was talking about! Maybe it's also because we are writers, and any time we say "If..." we eventually also have a "Then..." We also have "Unless" and "However," which might be neat additions to PHP! This touches on a bigger subject for me: in recent years I've become fascinated by the whole idea of coding as a "language." Of course, we use the words "language," "syntax," "verbose," etc., all the time in this world, but I'm talking about a more fluid interpretation. What we do, more and more, becomes a way to communicate subtle and complex ideas. And the fact that it is international makes it like some kind of universal poetry. Anyway, I'm just posting some thoughts that are on my mind a lot these days. Thanks, Matthew 1 Link to comment Share on other sites More sharing options...
DaveP Posted December 2, 2012 Share Posted December 2, 2012 The missing "then" really upsets my writers brain .... You need to look at INTERCAL. From the page - Programs which are insufficiently polite to the compiler may be rejected with the error message PROGRAMMER IS INSUFFICIENTLY POLITE 1 Link to comment Share on other sites More sharing options...
Joss Posted December 5, 2012 Share Posted December 5, 2012 Hi Dave This reminds me a bit of playing Zork (or programming with Inform7, perhaps). I like the fact that in zork you can say "open box" and it will come back with "there is no box here." Or "open cat" and it replies, "you cannot do that to a cat." But in either case, the actual program is still running - you get to have another go or you can go somewhere else. I warm to the idea that even without instructing a programme with ifs and maybes, if what you ask does not make sense it produces what it can and then prints out a neat little message saying "I tried, I really did, but I could not do that thing you wanted on line 6. Here is everything else though " Mind you, I would be a little upset if I got it really wrong and all I got was a white page displaying strong, very final text: "Your site has been eaten by a Grue." Link to comment Share on other sites More sharing options...
MatthewSchenker Posted December 5, 2012 Author Share Posted December 5, 2012 Hello, Wow, I totally forgot about those old games until Joss reminded me about that bit of gaming dialogue! Obviously, on the whole, coding has moved ahead leaps and bounds. But sometimes, I wonder... Are there any points where coding "of old" did things better or easier than coding now? Probably, this is completely crazy. And while we're doing fantasy coding, maybe there's room for an "unless" statement in PHP... if($page->intro_image) { <img src="<?php $page->intro_image->url"; ?> alt="intro image" /> } else { echo "You forgot to add an intro image! Please edit the page now."; } unless($page->no_images_checkbox="1") { echo "You chose not to add an image to this page!"; } Thanks, Matthew 1 Link to comment Share on other sites More sharing options...
JeffS Posted February 5, 2013 Share Posted February 5, 2013 I officially started my computer career on what was purported to be the second computer photo typesetting machine in California. Punch tape output. Paper all over the floor. Edits involved tape and scissors, feed the paper back into the machines reader. Sure beat lead and possibly catching your hand in an offset press. Got me hooked anyway. 2 Link to comment Share on other sites More sharing options...
Recommended Posts