12

Assembly
Right off the bat
No beating around the bush like a pansy
Actually knowing the CPU operations (which in essence are very limited and simple) will help him/her understand EVERYTHING: its limits and its capabilities.

Comments
  • 4
    I disagree, as we're going from the term "Child" here.
    I doubt there are very many children, that will be able to properly understand CPU architecture and instruction set immediately and how they make a PC tick.

    Though there might be exceptions.
  • 1
    @Ranchu Love that you actually considered my proposal 😂
    I was secretely a genie and you have 3 wishes available as a reward for your gentleness. Ask away!
  • 0
    I'd say it greatly depends on the age of the kid, a 7 year old might not get it. On the contrary a 12-14 year old probably will
  • 0
    @matt-jd True but also a 7 year old is probably more intrested in painting the pixels on a screen rather than learning the abstract concepts of method calls including libraries and OOP.
    Normally you need to imports tons of things to get to the point where you can paint the screen and show textures or triangles in any language (expect probably python).
    Meanwhile, in real mode with assembly you write INT XX and then writing numbers in the video memory area paints the pixels however you want! No restrictions. No weird compilation errors. Though please do not use that PC for anything else or you may wipe the disk without knowing it lol.
  • 1
    @OneOfSimpleMind you do have a point although I'd say basic is also a pretty good choice. I started out with visual studio and vb.net easy to grasp and build something using windows forms
  • 3
    @Ranchu Do not underestimate people because of their age.
    Only a couple of decades ago a kind of Assembly was the starting language of everyone. And there were a lot of children that played around with their computers. BASIC, C and Pascal were new languages. Until the 90s Assembly was the most common language (especially in games (children love games), because of their performance needs) used for most computers (the Amiga was very popular under children and teenagers), until DOS/Windows and the Macintosh really hit on the personal use market.
  • 1
    @Benedikt I actually learned QBasic as a child in the mid-90s. I think it was just about right for a first programming language. The learning curve isn't very steep and it's easy to get started quickly, but you can still build some pretty cool stuff later on. I think my first game was a simple "guess the number" game (where someone else would input the number and it would clear the screen after, since I didn't know how to do random number generation at the time). I went from that to Hangman and a few other games and ended up making a "Space Invaders" clone later on.

    I still think Assembly would be overkill and would only work if the kid was already extremely interested in exactly how computers work, but something from the BASIC family of languages strikes a good middle ground.
  • 3
    I would agree, as long as one thing is kept in mind: x86 is too complex for a child. Hell, it's too complex to be fully utilized by grown-ass people; for fucks sake, MOV alone is turing-complete...

    I learned GBz80 machine code. Would recommend: a simplified Z80 instruction set with good emulators and popular games that can immediately be modded (this can also help teach cybersecurity, in the case of Gen 1 Pokemon games and possibly others, because for fucks sake Gen 1 is a fucking mess of buffer overflows, stack smashing and error blindness, and serves as an amazing what-not-to-do with Assembly and/or machine code) to help learn and understand. Plus, a lot of the syntax is similar ("LD" and "MOV" are the same instruction, just named differently on each architecture.)
  • 1
    I learned Z80 @ 14, 68000 @ 20 ( Started with just a book for 6 months, as I couldn't afford a 68000 computer ! ) but I'd recommend the ARM CPU, the instruction set is beautiful, and you can get cheap ARM machines these days. ( Raspberry Pi is one such example.. )

    Related link:

    https://en.wikipedia.org/wiki/...
  • 1
    @Parzi

    I can't say I'm keen on the idea of learning x86 myself !

    I think I'll just stick with C++ for now, and maybe ARM assembler at some point and skip the whole x86 line alltogether. :-)

    I hear its nearly as bad as an Inmos Transputer..

    Related link:

    https://en.wikipedia.org/wiki/...

    I'm reminded I once had an A88K CPU to play with, but never got as far as getting the machine it was in, to actually work. :-(

    ( I couldn't afford the cost of the spare parts.. )

    Related link:

    https://landley.net/history/mirror/...
  • 1
    @Nanos Again, i'd recommend something simple to fuck with first, like, again, GBz80. A lot of the stuff you learn with older CPUs still transfers up, and you can learn OS bullshit later on when, like, studying DOS malware or something (i'm projecting a bit there but y'know)
  • 2
    @Benedikt Gotta admit, that makes me wish I was born earlier, would've probably learnt more about computing then.
  • 1
    @OneOfSimpleMind
    1. 10 kilograms of nitroglycerin
    2. Trump gotta be replaced
    3. Good life for everyone.

    Gotcha?
  • 1
    Does this really have to be done as a kid's first intro to programming? It's sort of irrelevant as it is, because assembly isn't how the cpu actually functions, it's a convenient abstraction made for you by modern superscalar speculative out of order processors.

    I don't think raising the barrier to entry helps (but sure, *recommending* that they check out assembly is a cool thing). Plenty of people I know picked up assembly programming much later on having started from a much higher language, they're doing just fine as systems programmers. Programming is about logic and order, assembly is just one way to do it.
  • 1
    @Ranchu Granted! Click here to claim your prize! -> https://bitly.com/98K8eH
  • 1
    @Parzi I half agree. The first or second language I learned was Z80 Assembly and that got me going. But still it was sad to know I had no way to use it in your normal everyday machine. Much later I got into X86 and went crazy with power for a while suddenly illuminated as to how OSs boot and old games with VGA using DOS calls. It felt great writing a bootloader program and running it on literally any machine I came across at work, home, and with friends. It lets you show off easily, which is HELLA motivational for kids (and anyone really). I recognize that x86 intruction set is gargantuan, but a simple subset of them can be used just as well. You just extract the Z80 equivalents for 16 bits in real mode and tell them to work with that and if they reeeally want to try, you give them the link to the whole instruction set.
  • 0
    @RememberMe See, I don't think that's really "raising the barrier". Assembly is essentially easy to use. It's just blocks of instructions one after the other using registers and memory. Moving, Adding, Jumping and Comparing. It's beautifully straightforward. Obviusly depending on the Assembly you teach you have more and more actions the CPU can understand. But you can ignore them all if you want! And with just those four instructions (and Interruptions to interact with the BIOS in x86 machines) you can do ANYTHING.
  • 1
    @OneOfSimpleMind You, my friend, shall be sentenced to commit non living.
  • 0
    @OneOfSimpleMind that's pretty much my point too. There's nothing special about assembly, it's just another way of expressing a computation graph which also happens to give you lower level control. You program in assembly just like you would in any other language, it's just a lot more tedious.

    If anyone's interested in going deeper or going professional, then by all means, stick them with comp arch and systems (how processors actually execute instructions is fascinating and important to know), but when you're starting out and you just want to feel cool or make cool stuff or edit something you found, I don't really see the point. If you happen to get interested in hardware/low level stuff then sure, assemble away.

    Having said that I do think professional programmers should know how stuff works inside, but that should not be a thing for hobbyists and people who program for other reasons than being pro devs.
  • 0
    I'm reminded the hours of hard work it took me to just draw a straight line in assembler.
  • 1
    @Nanos You think drawing a straight line in opengl is easier?
  • 0
    I still believe low level languages are hopeless as a first language. Learn Java or JavaScript first, then C, then Rust/C++
  • 1
    @12bitfloat Why java man. Why.
  • 0
    @OneOfSimpleMind Because it's dead simple and teaches abstraction and conceptualization of a proper architecture

    Pyhton and to a lesser extend JavaScript teach quick-and-dirty spaghetti code. Assembly is way too low level. C teaches data-oriented procedural coding (which is a good skill to have but not for a beginner who doesn't understand code architecture). C++ is too complex. C# is just Java with more features (thus more complicated)

    What else is there?
  • 0
    @12bitfloat Nicely laid defense.
    Still, Java is way less eye-candy-er than C# (subjective opinion?).
    And C# can be used without knowing all its capabilities same as it is done with Java and Java actually being "less complex" ended up with, for example, weird cluttered code full of classes for every single place a clean simple lambda (C#) or a function pointer (C/C++) would've been enough.
    So Java.functionality < C#.functionality and Java.eyecandy < C#.eyecandy
    Or replace eyecandy with visualSimplicity or whatever.
    Both C# and Java are awkward to use and totally obscure everything and make you use IDEs or JVMs. All which happens behind them is black magic and while it is practical for the industry, if taught to a child head first, it will leave him/her thinking all is magic and only works if I know the right set of commands. All is detached in black boxes and will crumble down at the first exception they don't know where it came from, copypasting more magic from stackover to fix it.
Add Comment