Live data from Hacker News

Teaching D from Scratch: Is it a viable first language? (2021)

dlang.org

71–80 of 91 posts

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#71
post #59

Earlier quoted context omitted.

On point but C# is now widely available on any OS under .NET (core) iso .NET Framework. It should be included in the shortlist in my opinion.

It's available but not in common use, and where it is used it is used mostly as a portability option (though it is very well possible that is no longer the dominant use, I just haven't seen it used any other way outside of the Microsoft eco-system).

Main deployment platform for back-end workloads using .NET is Linux. There are GUI frameworks which support it (Avalonia and Uno), file and sockets I/O support is first-class. CLI tooling is platform-agnostic, paid and free tools for developing in C# are available under Linux and macOS. With some effort it can be also run on FreeBSD (not mentioning interesting but niche projects like BFlat which can target UEFI directly).

For example, getting the SDK on Fedora is just

    sudo dnf install dotnet-sdk-8.0
It is as cross-platform as it gets, far more easier to manage than installing JVM implementation and then dealing with a switcher or just the fact that Java needs Gradle to build projects over trivial dotnet new console; dotnet run/build/publish

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#72

But why? Why use esoteric languages no one knows?? Why teach someone a language they can’t use at work? Just teach Go it’s so simple and teaches you actually good practices unlike Python. Senior devs hate it and junior devs love it for the same reason.

Default nullable types weren't a good practice even when Go was published.

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#73
post #24
post #22

Earlier quoted context omitted.

Well, syntax and intuitiveness of composition of programming basics matters, and those are different But D's "extreme" is in its unpopularity, so student exploration is very limited

In what way are they different? "Different" for me is Lisp or Haskell. D is a crossover between C++ and Java in my (albeit limited) experience.

In what way is C++ different from Python?

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#74
post #13
post #8

> I am confident that D can be a viable first language Not sure what this confidence is based on, the basics are broken (toolchain, basic syntax errors you shouldn't even need a compile step to figure out, the squiggly error underline should be right there in your editor!), and what does sticking to "Vanilla D" offer as a benefit vs. some other language?

What stop schools giving out pre-installed virtual machine images? Most people don't setup their own environment for their first language....

How is this an easier setup vs. asking students to download and run an executable or two?

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#75
post #57

I've taught hundreds of people programming. For one year, at my first real job, I was tasked with teaching the programmers within a big company Pascal. All of them were already professional programmers using Fortran, COBOL, or assembly language. The company had a commitment to modernize their software development practices and one facet of this was to introduce a more modern language--Pascal at that time (circa 1976)…

I'd throw Python out too, as it's just far too slow*, which would set wrong expectations for learners. While itmcaan be sped up by writing everything in C and calling it from Python you've already thrown C out, so that's not an option. The languages remaining are very unfortunate though: JS is infamously the language designed in 14 days, and Go is a Google project, so I wouldn't be surprised if programming in it awakens Deep Ones to feed on your sanity.

* https://github.com/attractivechaos/plb2>

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#76
post #75
post #57

I've taught hundreds of people programming. For one year, at my first real job, I was tasked with teaching the programmers within a big company Pascal. All of them were already professional programmers using Fortran, COBOL, or assembly language. The company had a commitment to modernize their software development practices and one facet of this was to introduce a more modern language--Pascal at that time (circa 1976)…

I'd throw Python out too, as it's just far too slow*, which would set wrong expectations for learners. While itmcaan be sped up by writing everything in C and calling it from Python you've already thrown C out, so that's not an option. The languages remaining are very unfortunate though: JS is infamously the language designed in 14 days, and Go is a Google project, so I wouldn't be surprised if programming in it awak…

> I'd throw Python out too, as it's just far too slow*, which would set wrong expectations for learners. While itmcaan be sped up by writing everything in C and calling it from Python you've already thrown C out, so that's not an option.

I'm not sure I follow you. Are you saying using e.g. numpy is not okay because it's implemented in C? How does that make any sense? The cpython interpreter itself is implemented in C so everything interpreted by cpython is just as much "in C" as something else like e.g. numpy.

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#77
post #75
post #57

I've taught hundreds of people programming. For one year, at my first real job, I was tasked with teaching the programmers within a big company Pascal. All of them were already professional programmers using Fortran, COBOL, or assembly language. The company had a commitment to modernize their software development practices and one facet of this was to introduce a more modern language--Pascal at that time (circa 1976)…

I'd throw Python out too, as it's just far too slow*, which would set wrong expectations for learners. While itmcaan be sped up by writing everything in C and calling it from Python you've already thrown C out, so that's not an option. The languages remaining are very unfortunate though: JS is infamously the language designed in 14 days, and Go is a Google project, so I wouldn't be surprised if programming in it awak…

Why would execution speed be particularly relevant? Python is slow but that hasn't stopped many useful applications from being written it, plus proper use of libraries written in C (e.g., numpy) again mitigates the issue.

From a learning perspective, a slower language could actually be beneficial in the sense that it's impractical to brute force a solution to a problem in a way that you can get away with in C or similar.

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#78

Earlier quoted context omitted.

> Why teach someone a language they can’t use at work? Not everything is about work, especially for children.

If you don’t teach children to succeed at work and get ahead you are knowingly putting them at a disadvantage. If I knew programming when I was much much younger I would be in an even better position than I am now, and I’m in a great position.

If I knew programming when I was much much younger I would be in an even better position than I am now

In what way? Looking at everybody I've known and worked with over my career, I'd say the correlation between how good they where at programming as a child and where they were in their career at 40 was basically zero.

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#79
post #51

If you want a compiled language with strong types, Swift actually is a very nice language for learning. It has very nice ergonomics, and the Swift Playgrounds iPad apps are really nice and engaging.

The last thing you want is types when you're a beginner. TCL/Shellscript, for all its defects, just has strings, which means you have expr num OPERATOR num. you also just have commands. I've seen beginners try to set a variable from whatever is printed, so the concept of a return type is a tricky one. funny, now that I think about it, php is actually a great introductory language because it just prints everything to…

> The last thing you want is types when you're a beginner.

I disagree. Data types are an intuitive concept. Integers and strings are obviously different, and you can do further and distinguish arrays, characters, and dictionaries.

I'd argue Python is slightly beginner unfriendly in this one way because variable types are implicit rather than explicit (unless you use type annotations), but still important, as you'll get a type error if you try to, for example, sum a number and a string.

Re: Teaching D from Scratch: Is it a viable first language? (2021)

#80
post #57

I've taught hundreds of people programming. For one year, at my first real job, I was tasked with teaching the programmers within a big company Pascal. All of them were already professional programmers using Fortran, COBOL, or assembly language. The company had a commitment to modernize their software development practices and one facet of this was to introduce a more modern language--Pascal at that time (circa 1976)…

As a first language, I would teach python or javascript with java, C#, C, C++ as strong contenders depending on what they study, and possibly R or MATLAB is there is a very specific and good reason to do so
Post reply on HN