Live data from Hacker News

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

dlang.org

81–90 of 91 posts

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

#81
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)…

> Furthermore, let's remove languages that aren't general purpose; this knocks out SQL, HTML, R, Shell, PHP, SAS, Matlab, Assembly, Visual Basic, and Verilog.

Just a nitpick, but modern PHP is definitely a general-purpose language, and quite a decent one. Assembly is also inherently general-purpose, and might have a much higher learning curve, but its foundational nature also makes it an important step in a layered approach to learning (a la Nand2Tetris).

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

#82

No. Sorry but it just isn't. Nor are a whole pile of other interesting and useful programming languages. You need something that offers instant gratification, preferably an interpreted language or a language organized around an interactive prompt. If I had to teach someone programming today I'd pick JS because it is available everywhere and it doesn't need any tooling at all. It's far from a perfect language but avai…

> You need something that offers instant gratification, preferably an interpreted language or a language organized around an interactive prompt.

https://run.dlang.io/

https://hub.docker.com/r/dlanguage/drepl/

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

#83
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…

Too slow for... what?

For beginners, whose main concern is implementing basic data structures/algorithms, Python is fine.

I still use Python for daily scripting (sorry, don't get along with Bash) and it's runs pretty fast.

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

#84

Earlier quoted context omitted.

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 direc…

In my experience, the only places pushing for C#/.NET in Linux are places that were already C#/.NET before the core started to support it.

It's still fairly popular but that popularity is waning as languages with more modern design principles are gaining momentum without relying on a heavy framework like .NET. This could make it a poorer choice for somebody just learning as there may be fewer opportunities for junior devs by the time they graduate.

Even Microsoft has started transitioning to Rust in some cases. I'd hesitate to recommend a language to somebody getting started if that language is under publicized risk of being replaced by its maintainer.

I would add that a purely OOP language also probably isn't ideal for a first language, though. Being able to start teaching with just functions is quicker to introduce than having to describe objects first.

An OOP centric language is definitely appropriate for a second language. But if we are talking "intro", the faster somebody can type hello world while still having more programming concepts in the file than just the print statement, the better. For that last statement, I'd also exclude Python.

I always recommend talking about goals first then recommending a path.

If they know web dev is their future, JS.

If they know IOT is their future, C.

If they know games, probably still C as C++ is still likely the path for a while.

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

#85

Earlier quoted context omitted.

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 direc…

In my experience, the only places pushing for C#/.NET in Linux are places that were already C#/.NET before the core started to support it. It's still fairly popular but that popularity is waning as languages with more modern design principles are gaining momentum without relying on a heavy framework like .NET. This could make it a poorer choice for somebody just learning as there may be fewer opportunities for junior…

What? None of this makes any sense, even if we go back a few years.

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

#86

Earlier quoted context omitted.

I think “esoteric” is meant for brainfuck, maldbrot and similar. D, nim and co, are quite traditional in language design languages, just not popular (yet).

> esoteric > 1. understood by or meant for only the select few who have special knowledge or interest; recondite > 2. belonging to the select few Just because some people give special meaning to the phrase "esoteric programming language," doesn't mean that people who don't know about it should be chastised for not knowing the... esoteric meaning of the phrase. This reeks of "my club uses this adjective only for this…

It seems to me less like some elitist exclusionary thing, and more like they're objecting to the idea that if a language isn't within top 10 programming languages used, it must be esoteric and only weirdos and enthusiasts use it.

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

#87
post #51

Earlier quoted context omitted.

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 g…

Perhaps its because I learned programming via shellscript(rc not bash) and piping text into programs. I never had to deal with the difference between a string and a number unless I did something that actually needed the difference to be distinguishable. especially dealing with awk which just coerces greatly, hell, I didn't even have to deal with size limits since pure awk supports bignums. Sure, awk has types as well, but that concept came much later, especially things like scope. I think it both helped me and hurt me. I never understood why people said static typing was great, only after you had a huge program did you see where the pitfalls were.

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

#88
post #87

Earlier quoted context omitted.

> 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 g…

Perhaps its because I learned programming via shellscript(rc not bash) and piping text into programs. I never had to deal with the difference between a string and a number unless I did something that actually needed the difference to be distinguishable. especially dealing with awk which just coerces greatly, hell, I didn't even have to deal with size limits since pure awk supports bignums. Sure, awk has types as well…

That's an interesting perspective. It probably does have a lot to do with the first programming languages you learn. The first programming languages I learned were all strongly typed, so it seemed inherent to the concept of a variable when I learned it. I had to wrap my head around dynamically typed languages as "Ah, all variables are actually just pointers to structures with a tag indicating the type, and they can be rebound to objects with different types." When I write Python, I use type annotations, or I keep track of the type in my head, and use casts as convenient conversion functions. But, since Awk and shell script don't make you cast things explicitly as much as Python, I can also see how someone would learn programming with dynamic types in a really natural way.

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

#90

Earlier quoted context omitted.

In my experience, the only places pushing for C#/.NET in Linux are places that were already C#/.NET before the core started to support it. It's still fairly popular but that popularity is waning as languages with more modern design principles are gaining momentum without relying on a heavy framework like .NET. This could make it a poorer choice for somebody just learning as there may be fewer opportunities for junior…

What? None of this makes any sense, even if we go back a few years.

We are talking first language. Not people who are looking for a job right now. What about that doesn't make sense? These are people who are likely months to years away from getting a job.
Post reply on HN