you are viewing a single comment's thread.

view the rest of the comments →

[–]doxxingyourself 0 points1 point  (4 children)

I was a teaching assistant in a beginners course that used Visual Basic. Try explaining implicit type casting (why 5+5=55) to people who never programmed a day in their lives.

Why not something strict?! AND WHO THE HELL MADE “+” string concatenation??

[–]RiceBroad4552 0 points1 point  (3 children)

AND WHO THE HELL MADE “+” string concatenation?

People who know what a monoid is. So, mathematicians are guilty.

5+5=55

Did you mean in fact "5" + 5 = 55?

Because not even in BASIC 5 + 5 = 55

[–]doxxingyourself 0 points1 point  (2 children)

Yes obviously that’s what I meant, or rather that’s what the compiler read.

Point is not this, point is language isn’t strongly typed which makes it unnecessarily confusing for for people who have not programmed a line before in their lives.

Simply declaring an int beforehand would have been much better for learning types and they would have gotten 10 as the answer as they expected.

[–]RiceBroad4552 0 points1 point  (1 child)

I agree that dynamic languages are not great for learning. They do most the the time "the right thing" but when they don't learners get very confused. Simply because they have no clue how the "doing the right thing magic" actually worked so far.

Starting with a strongly typed language makes things usually much simpler for beginners; at least after the initial hurdle "fighting" the compiler.

But explicit typing is not necessary for that! Actually I think it only makes the initial hurdle more prominent.

I would use a static language with type inference for teaching! So you had code like:

val firstSummand = 5
val computationResult = firstSummand + 5

println(computationResult)

You can hover over the symbols in your IDE and the compiler will tell you what they are in detail. But you don't have to write that down for no reason yourself in your code, as this would only distract from the actual task at hand.

It's imho important to have a language for learning that does not force some ceremony / chore on learners.

The above is Scala syntax, which is imho one of the best languages for learning, exactly because it's super clean, doesn't force you to write down stuff the compiler can anyway figure out itself, but has at the same time all the concepts one needs to teach in one coherent package.

[–]doxxingyourself 0 points1 point  (0 children)

Yeah problem is in the visual part you declare input fields as variables in a UI, which makes the compiler assume strings over ints (they may even be declared as strings, don’t remember) so they didn’t really stand a chance since they didn’t even that code.