Author Topic: Why Johnny Can't Code  (Read 19555 times)

0 Members and 1 Guest are viewing this topic.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Why Johnny Can't Code
« Reply #30 on: September 19, 2011, 08:01:39 pm »
I know someone who I think could be a programmer, and one who already programs comps. That's two down, 2197 to go.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Why Johnny Can't Code
« Reply #31 on: September 19, 2011, 08:05:26 pm »
Woo! That's the spirit!
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Why Johnny Can't Code
« Reply #32 on: September 19, 2011, 08:13:13 pm »
Also, there are things that can only be done with a goto, like starting a program over.
Depends on how it's structured. If you make the whole thing out of nested loops the right way, you can jump back to the being without a goto. A great example of this is tifreak's Sprite-2-Hex program. The whole thing is constructed out of nested While loops. When a menu item is selected, it runs a specific While var=value loop with that routine, then sets or resets the var as necessary to jump to the beginning, another routine or quit.
My TI Basic Homescreen Game Pack never uses a Goto.  Or a Stop or Return for that matter.
« Last Edit: September 19, 2011, 08:13:27 pm by ztrumpet »

Offline sqrt(Time)

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +4/-0
    • View Profile
Re: Why Johnny Can't Code
« Reply #33 on: September 19, 2011, 08:58:35 pm »
...I don't like BASIC.
~ducks tomatoes/rocks surely being hurled~
I just mean, in order to introduce people to programming, you don't HAVE to use it. Show them console programs, echoing, then adding, then doing Fibonacci numbers, then blackjack... it's really not any more "fancy" than Basic if you're doing it right. (Just don't do Visual Whatever - those are the worst!)

Then, you can tell them more about how each thing is working lower down - maybe just gloss over compilation with something like, "What you type gets converted from English to numbers that the computer can understand" - since, for one function programs, that's pretty much all that's involved (what's a optimizing compiler?)...
You can delve as deep as you need to, but it's important to give people something they can work with at the same time. BASIC's syntax has also become a little arcane. Start them with C/C++/Java/Python, I say.

It's not a problem with any one language, it's just a sad shift in the teaching style.

For the record, I started with Visual Basic at ~7, made a program to calculate Pi using the Leibniz formula, tried Java, couldn't get the compiler to work, dropped programming for a couple years, made a Cellular Automata program in Javascript (you give it the rule number and range, it draws it), learned Java with more vim because I wanted speed, decided to go back to my Java book to learn it well, realized I already knew it all, did a ton of USACO problems to get good, realized that I hated Visual Basic now, learned C++ (or at least the parts I wanted to i.e. manual memory management) learned Haskell (or the parts I wanted to i.e. craps of recursion/currying, now I'm learning ASM and designing a CPU with my friend for Minecraft.

So that's my bias, just FYI.


You may now proceed to to hit me. Hard.
« Last Edit: September 19, 2011, 08:59:39 pm by sqrt(Time) »

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Why Johnny Can't Code
« Reply #34 on: September 19, 2011, 10:55:53 pm »
IMO C is fine as a starting language, as long as it is just console programs at first, "visual" and GUIs in general add a level of complexity that can be daunting. I have a C book that starts out with simple exercises, such as printing out a Fahrenheit-Celsius table, and other problems similar to what you would find in a textbook. So really, it is not a problem of the language used (as long as it is line-based and non-OOP), but rather how it goes about being taught.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Why Johnny Can't Code
« Reply #35 on: September 19, 2011, 10:59:03 pm »
Yeah, my C++ class, as of yet, has not moved out of the console. The worst was the chapter where he had us use the borland graphics library. (Don't look it up, think MS paint for C++ :banghead:)

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Why Johnny Can't Code
« Reply #36 on: September 19, 2011, 11:05:19 pm »
borland is awful. I had to use it in a EHS C++ class, oh goodnesss
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Why Johnny Can't Code
« Reply #37 on: September 19, 2011, 11:06:55 pm »
Actually, I emailed the teacher about it and he said I could skip the chapter! I took the exact same class :P

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Why Johnny Can't Code
« Reply #38 on: September 19, 2011, 11:16:12 pm »
Wow... Almost everyone here is saying things I am thinking. I have tried to get my friends to learn BASIC under the guise of "Look, you can make homework helping programs!", but not much has come of it. One of my friends however, is trying to learn axe, so I guess it is a start.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Why Johnny Can't Code
« Reply #39 on: September 19, 2011, 11:18:06 pm »
hehe yeah, they're always more drawn by the games than the math help. Although, I have had one convert who made an (albeit short) choose your own adventure thing with chuck norris :P

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Why Johnny Can't Code
« Reply #40 on: September 19, 2011, 11:21:37 pm »
I have a friend who makes TI-BASIC homework helper programs, I'm trying to get him to learn Axe or C (he has an Nspire as well). Then, there's all the other people that I guide through their "block dude awakening" :P

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Why Johnny Can't Code
« Reply #41 on: September 19, 2011, 11:23:04 pm »
Actually, I emailed the teacher about it and he said I could skip the chapter! I took the exact same class :P

oh that's right, you live in utah too. forgot about that :)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Why Johnny Can't Code
« Reply #42 on: September 19, 2011, 11:23:36 pm »
The problem with C is it's hard to get them to dedicate time at home to it. Axe has the advantage there.

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Why Johnny Can't Code
« Reply #43 on: September 20, 2011, 12:01:36 am »
...I don't like BASIC.
~ducks tomatoes/rocks surely being hurled~
I just mean, in order to introduce people to programming, you don't HAVE to use it. Show them console programs, echoing, then adding, then doing Fibonacci numbers, then blackjack... it's really not any more "fancy" than Basic if you're doing it right. (Just don't do Visual Whatever - those are the worst!)

Then, you can tell them more about how each thing is working lower down - maybe just gloss over compilation with something like, "What you type gets converted from English to numbers that the computer can understand" - since, for one function programs, that's pretty much all that's involved (what's a optimizing compiler?)...
You can delve as deep as you need to, but it's important to give people something they can work with at the same time. BASIC's syntax has also become a little arcane. Start them with C/C++/Java/Python, I say.

I learned programming with GW-BASIC and later QBasic, and I have since then never seen a programming language that beats QBasic for starting out.

C and its derivatives are awful first languages IMO because of how difficult it can be to debug problems. Write past the end of an array in C and the program will usually crash in some completely unrelated place; do the same in Basic and you'll get a "Subscript out of range" error on the exact line of the problem. I was an impatient kid; if I had started out with a C family programming language I probably would have given up on programming.

A problem with starting with Java and Python is they force you to use pointers all over the place (and they don't make this fact obvious) - in Java, a "Foo x;" variable doesn't really hold a Foo object, it holds a pointer to a Foo object, and in Python, every variable holds a pointer. I constantly see new programmers having trouble because they're confusing pointers with the objects they point to - which is very understandable when the language doesn't even make it clear that you're working with pointers. Just imagine being a beginning programmer trying to explain something like this:
Code: [Select]
>>> a = [1, 1]
>>> b = [a, a]
>>> b
[[1, 1], [1, 1]]
>>> b[0][0] = 2
>>> b
[[2, 1], [2, 1]]
Basic didn't have any pointer variables (well technically, string variables held a pointer, but since it was impossible to make two string variables point to the same string, this fact didn't cause trouble for the programmer). But it did have arrays (including real multidimensional arrays, something sorely missing in Java and Python). Any structure you might think you need pointers for - linked lists, binary trees, etc - can be done almost as easily with arrays; the downside is that you're stuck with a fixed array size, but when you're starting out, you don't really care about scalability. The great thing about arrays is that they're intuitive - even a beginner can understand that "I" isn't the same thing as "A(I)", and it's possible that "A(I)=A(J)" even when "I<>J". And once you've mastered arrays, pointers are easy - they're just indexes into that giant array we call "memory".
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Why Johnny Can't Code
« Reply #44 on: September 20, 2011, 12:25:39 am »
I happen to like Qbasic too, but havent touched it in years.
There is something innocent about those older basic interpreters.
Also if someone wanted to take up assembly language they could with call absolute with Qbasic.
I wrote a Qbasic terminal program that used the 16650 UART faster speed after patching itself,
back in the old modem days.