4 ms·
Right. Even a "slimmed down" version of JS would be suitable for beginners.
by sdegutis 10y ago
Right. Even a "slimmed down" version of JS would be suitable for beginners.
- int_19h 10y agoI was thinking more along the lines of Lua and Python. JS would need to be significantly reworked to be a good beginner language, IMO. C-style syntax is not the most readable option, and then there's all the weirdness around types and implicit conversions, strange and non-intuitive design of built-in data structures (object vs array similarities and differences, for example), and weird variable scoping rules. Lua has pretty much everything that JS has that is worthwhile, but done better (e.g. the only data structure is an associative array, but they all behave the same unless and until you start to customize them). Syntax is more natural and easier to explain, too. Python is nice in that basic programs are as short as they need to be (i.e. you don't need to import packages or define classes to print "Hello, world"), but it does have the concepts that mainstream "grown up" languages have - the aforementioned packages and classes, for example - and they can be gradually introduced and explored one at a time without distractions. Also, turtle graphics out of the box - still the best way to explain things like recursion, IMO. So, you get a great teaching language, and it doubles as a great general-purpose programming language for serious stuff once the teaching is over.
- pjmlp 10y agoBasic at least has compilers to native code, while being beginner friendly.
- int_19h 10y agoFor beginner tasks, it usually doesn't matter - even a dumb AST interpreter will do. For more advanced stuff, BASIC compilers usually don't generate particularly impressive code, because the language allows so many inefficiencies. Code generation is better if you're strict about your types and explicit about your conversions, but then you might as well just write in C or Pascal.