It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
This is a bit off-topic, but I’m not on any programming/computer forums so I thought I’d ask this here and see if anyone can help me out.

First off, I know almost nothing about programming and computers. However, my son (11 years old) has started learning Python programming and he’s really into it. He’s already learned enough that he can easily write short python programs from scratch (eg he recently made a “Hangman” game on his own).

I’ve heard vaguely about Raspberry Pi and how it was originally designed to help kids learn and program with Python (although it’s taken off to many different areas since). So that got me thinking that perhaps he might be interested in getting one.

He is currently doing all his Python programming on a MacBook Pro. What would be the specific challenges and advantages of using Raspberry Pi instead? Why would he want a Raspberry Pi? What could he do with a Raspberry Pi that he couldn’t do with his laptop? I’ve tried doing some google searches, but maybe the information is simply going over my head because I don’t get it. I know it’s got to have appeal, so that's what I'm trying to find out here :).
Not all parents can afford to give their children a CAD2000 laptop so the Raspberry Pi is a cheap, and weak, alternative.

I understand it is often used as a controller in things, like home built robots.
To put it simply it's just a small and weak computer that does not need much power. What gives it more potential is presence of ports that specialized hardware can be connected to. This hardware can be quite expensive depending on what you want but you can create all kinds of self-invented gadgets with it.

Very basic example is smart mirror that is controlled by raspberry pi - https://www.raspberrypi.org/blog/magic-mirror/.

I guess that making small gadgets that actually work may seem like attractive task for a child but most of those are not that fast and easy to make, most kids may lose interest before they achieve anything.
OK, I see. It sounds like Raspberry Pi is mostly useful as a controlling computer to drive other hardware? In that case he would probably not be very interested at this time as he's more into programming games and other apps rather than robotics or things of that type.

(My son's laptop is technically owned by his online school, but he has exclusive use of it.)
What other small computers like that are they and what else can they do?

Also the Pi is ran by people that are too political and anti customer as a result.
avatar
01kipper: He is currently doing all his Python programming on a MacBook Pro. What would be the specific challenges and advantages of using Raspberry Pi instead? Why would he want a Raspberry Pi? What could he do with a Raspberry Pi that he couldn’t do with his laptop? I’ve tried doing some google searches, but maybe the information is simply going over my head because I don’t get it. I know it’s got to have appeal, so that's what I'm trying to find out here :).
One of the main points of the Raspberry Pi is the low cost to open up computing to those who might not otherwise be able to afford it, something that probably doesn't matter too much if they have access to a MacBook Pro. :P

The other useful/interesting thing about the Raspberry Pi is the direct access to the GPIO pins. If your son is interested in interfacing his programming with some basic electronics then that could be a use for a RPi.
avatar
01kipper: I’ve heard vaguely about Raspberry Pi and how it was originally designed to help kids learn and program with Python (although it’s taken off to many different areas since). So that got me thinking that perhaps he might be interested in getting one.
And not only. It can also help kids bridge the gap between software and hardware by offering programmable I/O interfaces. For more details on what you can do with a Pi, see this link.
avatar
01kipper: In that case he would probably not be very interested at this time as he's more into programming games and other apps rather than robotics or things of that type.
He can, in theory, code his own arcade games and interface them to physical controllers (buttons, joysticks etc) and a screen by using a Pi, if he so wishes.
Post edited December 11, 2018 by WinterSnowfall
avatar
Spectre: Also the Pi is ran by people that are too political and anti customer as a result.
Huh?

Anyway, to answer the original question, there are a few other reasons having a Pi might come in handy:
* It's another device to play with. One can play around with the intricacies of Linux without having to worry about messing up their main system (although Virtual Machines are also an option here). One could aso use it to learn network programming; run code on the Pi that communicates with another computer.
* The Pi might come in handy for learning ARM assembly. The thing is, a typical computer will be running an x86 processor, so any assembly programming would be done in x86 assembly language. The Pi, however, has an ARM cpu, which in turn takes ARM assembly language. (One could use emulation for this use case, but keep in mind that emulation is slow; I don't know how an emulated ARM CPU on a modern x86 computer would compare performance-wise to a Raspberry Pi running ARM code natively.) Note that this distinction doesn't matter for higher-level languages, except that a compiled program written in a compiled language like C can't be transferred between systems and expected to work. (The source code should still work in most cases.)
* The Pi, of course, can also be useful if one wants to learn how to work with embedded Linux.
The main advantage is that it's cheap.

The Pi that i have is a 800Mhz 256-512Mb machine that runs a Linux distro on a SD card. Plug in a mouse/keyboard TV and power, and you have a full fledged computer.

Maybe not the most powerful machine, but more than enough to do scripting languages (Bash, Python, Ruby) or tinker with full fledged languages (C/C++, D, etc); Though you're probably limited with what the GCC (GNU Compiler Collection) supports, or packages via apt-get.

It will be low power so it probably uses less power than a laptop. (then again it doesn't include it's own screen, so that power savings sorta goes away when you plug a TV into it).

The architecture is ARM which is very popular for simpler devices (RISC vs CISC).

Honestly, i did programming on an Atari800XL, and BASIC was a pretty bad first language to learn/use :P So a Pi i would think is an excellent toy/computer to play with for learning programming, it will be better than an Atari/Apple.

Suggestion: Get a powered USB hub (4-6 ports), plug the Pi into the hub, then plug the hub into one of the USB outputs on the Pi. That configuration will power the Pi (5v) and give you like plenty more ports vs the 2 you will have.

Also learn the basic command-line commands, as likely you'll be using the console a bit.
Post edited December 11, 2018 by rtcvb32
Raspberry's mainboard is practically a mobile phone chip, don't expect to run a file server on it because everything must get through the cpu multiple times instead of having a bus or something. It's good for prototyping.
Also python sucks because of no native asynchronicity feature, it's like php where each call blocks which is ok for a webpage backend but not for frontend applications. It's also bad for tooling (e.g. formatting in text editors) because of weird markings of scope with spaces, inability to declare variables,.... Also _everything_ throws an exception so say hello to using try catch instead of a simple if. Don't believe the python hype, javascript (nodejs or in browser) is way better.
For the record, my 13 year old past self would have killed for such a platform. I had to fuck around with a shareware assembler in 80x25 text mode and later linux graphics driver would not support my monitor.
Post edited December 12, 2018 by AlienMind
avatar
AlienMind: Also python sucks because of no native asynchronicity feature, it's like php where each call blocks which is ok for a webpage backend but not for frontend applications.
async/await says hi! (I believe you need at least Python 3.5.)

Also, Python does support threads; the only catch is that no two threads can be executing Python code at the same time due to the Global Interpreter Lock (GIL). I/O, however, will release the GIL, so if one thread is waiting for input, another thread can continue executing. There's also the option of having Python call code written in other languages, like C or Rust, which an then release the GIL if you need to do computationally intensive work (there's even a package called cython that is designed precisely for that sort of thing). Further, one could use multiple processes for this purposes; the Python standard library even has a multiprocess module that makes it easy.
avatar
rtcvb32: The architecture is ARM which is very popular for simpler devices (RISC vs CISC).
Chances are, however, that this distinction won't matter unless you decide to program in assembly language, which is a great option for learning how computers work, but rarely needed in today's world. (It used to be the case that assembly was faster than languages like C, but these days compilers are very good at optimizing; these days, the main use of assembly is to use CPU features that are not exposed by the C compiler (like switching from real mode to long mode).
Post edited December 12, 2018 by dtgreene
avatar
rtcvb32: The architecture is ARM which is very popular for simpler devices (RISC vs CISC).
avatar
dtgreene: Chances are, however, that this distinction won't matter unless you decide to program in assembly language, which is a great option for learning how computers work, but rarely needed in today's world. (It used to be the case that assembly was faster than languages like C, but these days compilers are very good at optimizing; these days, the main use of assembly is to use CPU features that are not exposed by the C compiler (like switching from real mode to long mode).
Assembly is still faster. Quite a few C/C++ implementations will save the different registers, and access data passed through the stack. Not bad, but often in older times you set things in registers and called a function, which has a FAR lower overhead/framework, but you need to be aware of what registers are used for what, and what you can throw away and what you can keep.

If you have few enough passing variables that you can just use registers, you can have speedups as memory access can slow down work a lot; But the largest speedups today (for games) are via GPU's which are hundreds of simple math processors, working and not needing security so their architecture is simpler.
avatar
dtgreene: Anyway, to answer the original question, there are a few other reasons having a Pi might come in handy:
* It's another device to play with. One can play around with the intricacies of Linux without having to worry about messing up their main system (although Virtual Machines are also an option here). One could aso use it to learn network programming; run code on the Pi that communicates with another computer.
* The Pi might come in handy for learning ARM assembly. The thing is, a typical computer will be running an x86 processor, so any assembly programming would be done in x86 assembly language. The Pi, however, has an ARM cpu, which in turn takes ARM assembly language. (One could use emulation for this use case, but keep in mind that emulation is slow; I don't know how an emulated ARM CPU on a modern x86 computer would compare performance-wise to a Raspberry Pi running ARM code natively.) Note that this distinction doesn't matter for higher-level languages, except that a compiled program written in a compiled language like C can't be transferred between systems and expected to work. (The source code should still work in most cases.)
* The Pi, of course, can also be useful if one wants to learn how to work with embedded Linux.
He's not yet at the level where he's interested in Linux, network programming, or assembly language either, but I'll bear this in mind in case his interests do turn to those areas.
avatar
AlienMind: Also python sucks because of no native asynchronicity feature, it's like php where each call blocks which is ok for a webpage backend but not for frontend applications.
avatar
dtgreene: async/await says hi! (I believe you need at least Python 3.5.)
i am aware, i said native, also this library feels like handling multithreading instead of having one with simple asynchronicity which makes it awkward to use in fact most of the other libraries don't use it which makes this whole thing one prime example of the ugly mess of dependencies and imcompatibilities python in general is too. inside joke: A: "this python program throws a weird exception" B: "you probably just need the right version of python". A: "which one?" B: "read the source".
python can go fuck right off it improves nothing over perl which it defacto replaces in linux today. oh wait.. one thing: there isn't multiple syntax keywords for the same thing.
Post edited December 12, 2018 by AlienMind