Hacker News new | ask | show | jobs
by pjmlp 1358 days ago
Back when I was a TA, first year students got along just as well with Pascal, Fortran and C++, many of which lacked a programming background.

I wasn't found of minimal APIs, global usings and implicit Program.cs for C# 10, and share a similar opinion in relation to Java.

No need to try to make it look like JavaScript and Python, each language has its place.

3 comments

Anecdata - I'm self taught. Started my learning on Python.

I wanted to delve into Java. And sure enough, my very first thoughts were "wtf is public static void, why does this even matter, and why is print() so weird and long?"

Shit, I ended up finding it easier to get into F# than Java.

Then I got hired for a Java role, which is proof that the universe has a sense of humour.

And none of the listed languages enforce main to be part of a class, hence the described problem didn't exist for your students.

I've taught C to beginners after the Java class and whilst there are some related problems those students encounter, the extra confusion caused by having main in a class doesn't exist (and doesn't cause as much syntax vs logic confusion later on).

I can assure you they were using OOP in C++, creating their own standard library, leaving behind the ways of C, as any proper C++ course during the ARM C++ days.

The lecture notes that eventually became this book were their path into discovering C++.

https://www.bertrand.pt/livro/programacao-com-classes-em-c-p...

"Top-level statements" in C# is a double edge sword: In a long run it will help make C# a bit more approachable to an absolute beginner to programming by reducing "noise" and cognitive load but right now it tends to confuse the beginner due to countless tutorials, SO answers, books, courses being written using using, namespace, class, Main structure.

Which makes the feature kind of pointless. Especially since all teaching materials (and those who have used them for teaching) were saying to just ignore the rest for now and concentrate on

  Console.WriteLine("Hello World!");
which is, as it's written, confusing to a beginner anyway ("What is Console?") until he learns about classes, after which both namespace and using get clear(er).