Hacker News new | ask | show | jobs
by ojnabieoot 1926 days ago
> But is C going to be too hard for young kids to play with?

Speaking from personal experience, I “learned C” alongside actually learning BASIC when I was 10-12. When I say “learned C” I actually mean I “learned basic imperative programming with C-style syntax”: simple single-file programs inside of a main block. Arrays (probably all statically allocated), but few (if any) pointers of scalar quantities, no structs, and I doubt I ever even used headers or macros. By contrast, I understood the BASIC runtime and overall language much better than I did C.

But I was able to be reasonably effective for a kid: writing simple ASCII games, interfacing with some educational robotics toy with a C library, physics simulations, and so on. So I don’t think C is too difficult for kids, or even necessarily more difficult than any other language. The complete specification for C is obviously too complicated for most kids, as are the details of safe and performant native code, but you can quite effectively create small programs with a minimal subset of C.

That said, it is probably harder to find reference material for kids learning C in 2021. And the nice thing about Python is that kids can much more easily do more complex tasks, plus it has a bespoke interpreter for learning the basics. Kids are also more able to create their own complete applications in Python than C. Of course learning basic imperative programming with C is a very enriching experience for a child. But doing the same with Python-style syntax seems like a perfectly fine replacment.

In my view C is ok for kids - it might even be the best choice if you’re focusing on hardware - and that the important thing is getting started with something. But I would caution against using C unless the specific code you have in mind is relatively simple. Complex memory management considerations or data manipulation that’s very close to the metal is probably inappropriate for first-time young learners.

1 comments

Thanks, I learned programming on my own by writing macros in Excel/Access as a kid.

It seems Python would be a better choice. Gdscript is like Python and seems like Python can be used in Robotics. Let me do more research here.