Re: [dev] Programming as a hobby - which language?

From: Lukáš Hozda <>
Date: Mon, 6 May 2019 19:38:18 +0200


I generally agree with what Laslo said, except the part about teaching
C to 7-12 year olds. C is a fantastic language, but you can't expect
kids this age to easily progress when they need to worry about things
such as memory management or pointers. Scratch is horrible and, from
my experience teaching programming to kids (Rust & Python), they don't
like it as well that much, especially the smarter ones, who notice how
many things are absolutely atrocious in Scratch.

It may sound a bit unorthodox, but I would probably suggest Nim for
several reasons:

1) it allows you to explain some concepts in a nice way. For example
it has UFCS and some magic parsing, which allows you to let the kids
make their own operators, for example:

proc `**`(a, b: int): int =
  result = a
  for i in 1..b:
    result *= a

echo(5 ** 3)

The result variable can be used to gently introduce them to the
concept of functions returning stuff, too, there are some other
helpers of this kind in Nim too. UFCS also helps.
Nim also has fairly strong yet easy to grasp macros and
meta-programming, which could allow kids to introduce and experiment
with their own constructs.

2) It is statically typed. I believe that all newcomers to programming
need to be introduced to types (static typing helps) as soon as
possible to prevent some mess further down the line. Typing in Nim is
also quite unintrusive

3) The syntax is very simple. Just Python with a few Modula/Oberon influences.

4) Case-insensitive in a great part, also ignores underscores, might
help kids to remember stuff from the standard library

5) It has first-class support of sets and operations on them. I don't
know about your country, but here the ages 12-14 are exactly the time
when children learn about sets in schools

6) Slices are useful and it, along with other declarative features may
make things easier.

7) It can compile to Javascript. Might allow kids to move on to some
light webdev without dying a painful death in Javascript.

I would go for Python->Nim, but if you wanna do gamedev... I dunno

Received on Mon May 06 2019 - 19:38:18 CEST

This archive was generated by hypermail 2.3.0 : Mon May 06 2019 - 19:48:08 CEST