Live data from Hacker News

Silent Teacher – A game to learn how to code

silentteacher.toxicode.fr

31–40 of 56 posts

Re: Silent Teacher – A game to learn how to code

#31
post #25

I don't mean to be mean but some of these answers depend on what language you use. For example var a = '3'; var b = '4'; a + b; Depending on the language may give you 7 or maybe give you 34.

What's an example of a language that, when adding two strings/chars, parses them as integers first?

How about TCL?

    % expr "3" + "4"
    7
    % expr "3" + 4
    7
    % expr 3 + 4
    7

Re: Silent Teacher – A game to learn how to code

#32

Even if I had never tried to program before, I feel like it starts/progresses way to slowly. It gave me like a whole pages worth of questions about adding single digit integers or combining small strings. I like the look and feel of it, I just think the content should be tweaked a little bit to pick up the pace. Maybe some hints they can look at if needed. Also, multiple language support would be good.

I've been doing something like this for regex as a side project.

One of the biggest things I'm thinking about is determining the adaptive algorithm that places you on different portions of the learning experience.

My current strategy is to compose a concept map of all the basic concepts and then devise a proficiency metric on each concept, which might be some aggregate of [correct on first attempt + time to completion + learner history] or whatever else I think of. Then you progress through the content by traversing this graph (with a fair degree of stochastic nature so to keep things moving). I'm hoping collected data can then be used to devise a new concept graph - something of a dependency graph whose density might ultimately reflect an element interactivity [1].

For example, function use might be considered a singular concept, while a function which returns a function might be another concept. The latter is a bit more exotic to newcomers and you can use the metrics determined by the former to gauge a pace to give the learner, but it's a foundational concept which most concepts in functional programming depend on and it might not be fair to consider it a single concept in the learning process until the schema is well-established.

Ideally, within a few questions answered you get pushed up to a state where you're actually learning something, no matter what your proficiency.

[1] http://www.davidlewisphd.com/courses/EDD8121/readings/1998-S...

Re: Silent Teacher – A game to learn how to code

#33
I like this approach, where it does explain anything, but lets you figure it out on your own by starting with the basics.

I think the functions should be renamed. function hello (a) would look like nonsense to a beginner. Give them names like addNumbers so they can piece it together.

Re: Silent Teacher – A game to learn how to code

#34
post #25

I don't mean to be mean but some of these answers depend on what language you use. For example var a = '3'; var b = '4'; a + b; Depending on the language may give you 7 or maybe give you 34.

What's an example of a language that, when adding two strings/chars, parses them as integers first?

In addition to the answer of Perl and TCL, PHP would too, since the concatenate operator in PHP is "." - any dynamic and/or weak typing language that doesn't overload "+" for string concatenation will probably behave the same way.

Re: Silent Teacher – A game to learn how to code

#35
post #25

I don't mean to be mean but some of these answers depend on what language you use. For example var a = '3'; var b = '4'; a + b; Depending on the language may give you 7 or maybe give you 34.

What's an example of a language that, when adding two strings/chars, parses them as integers first?

> What's an example of a language that, when adding two strings/chars, parses them as integers first?

The cancerous piece of shit we know as Javascript.

Re: Silent Teacher – A game to learn how to code

#36
I hate being negative, but I have to say that I really don't think this an effective way to learn how to code for someone without some programming knowledge to begin with.

I just watched someone with no programming experience whatsoever try the problems. She's smart and well educated.

The basic arithmetic is (obviously) fine.

Basic variable assignment is fine, although the 'var' keyword doesn't really serve a purpose. It's completely meaningless to the non-programmer, and seeing as you can declare variables in the global scope in js without using it, I don't really get what it's doing here.

The first difficult problem is why

    '4' + '2'
is '42' and not '6'. The person I watched voiced a bit of frustration, then after a minute saw that 4 and '4' are different, and then breezed through the round. But she didn't learn anything at all about strings vs. integers or even variable types as a concept. She learned that, arbitrarily, when numbers are in inverted commas they should be concatenated when a '+' sign is used instead of added together. She didn't feel like she'd learned anything either. And without already knowing about types, about integers and strings, it is impossible to teach this concept intuitively because it is not intuitive. Someone taught that 4 + 2 = 6 and that '4' + '2' = '42' might very reasonably think that '42' - '2' = '4'.

Next was variable assignment order:

   var a = 0; a = 4; a + 3;
She got the "rule" of last-assignment-counts pretty quickly, but again, didn't get what the variable was actually doing. She just learned to ignore the first line and add the last two numbers together. The idea of 'a' being a variable wasn't communicated to her.

Then there's a huge jump to functions, with

    function hello (a, b) {
        return a + b;
    }
     
    hello(2, 4);
After some trial and error, she worked out how to answer these kinds of questions as well, but with no understanding at all of what the function was, what the return statement was, the idea of functions having arguments, etc. She just learned to add the two numbers at the bottom, and later to perform an operation on the two numbers at the bottom using the operator from a few lines higher. The process became "find the numbers, find the operator, ignore everything else".

Up to this point I had been completely silent and just watched, but now she began to give up, and we talked about how she'd found the experience. She didn't feel that she'd learned anything and didn't like the lack of feedback and explanation.

The next questions were about about length:

    var a = 'nudintm';
    a.length;
I really don't like this. So far, the user has only been exposed to functions, and the syntax and structure will still be unfamiliar in the best-case-scenario. From there, it's a huge leap to properties and the implied existence of objects. This problem is just so arbitrary without an understanding of what's going on. Why is there a period between 'a' and 'length'? Why does length not have '()' after it like hello() did a few problems earlier? We know the answers to these questions, the intended audience will not.

    var a = [9, 4, 'w'];
    a.length;
This is another huge leap, and it's a bit odd because it introduces arrays in a problem that doesn't really indicate anything at all about what an array is or what it's for. It's also a bad question because the user might add together the length of '9', '4' and 'w' and come up with 3, the correct answer, and then think to get the length of an array you just add the length of every element in the array.

I'll stop there. I admire the execution and the ambition of the project, but in its current form I really don't think it works well at all if the intended audience is people who don't know anything about programming. Users learn superficial patterns to get the correct answers without understanding the problems in any real way or learning anything about the structure or function of code.

Re: Silent Teacher – A game to learn how to code

#37
post #18

So I just gave this link to my non-technical wife for the ultimate test. She is actually making pretty good progress. I'll update this as she progresses.

> 52 minutes ago

No updates? :(

Cause I was interested in real-world experiences, not just programmers testing the programming learning tool.

Re: Silent Teacher – A game to learn how to code

#38
post #6

How far does it go at the moment? And how far are you planning to make it go? Very well done, congrats guys! PS. Consider translating http://www.toxicode.fr/ into English for visitors from the US. Your services are in much demand over here. And get the .com too!

> How far does it go at the moment?

Not very far, I completed it in a few minutes. I think the hardest was:

    function hello(a) {
        return a * a;
    }
    
    hello(4) + 3;

Re: Silent Teacher – A game to learn how to code

#39
post #35
post #25

Earlier quoted context omitted.

What's an example of a language that, when adding two strings/chars, parses them as integers first?

> What's an example of a language that, when adding two strings/chars, parses them as integers first? The cancerous piece of shit we know as Javascript.

No, Javascript will concatenate two strings that contain integers if you add them.

"1"+"1" //=> "11"

Post reply on HN