A new D blog post/announcement has been posted!
Get the full details here: How I Taught the D Programming Language at a Russian University | The D Blog
A new D blog post/announcement has been posted!
Get the full details here: How I Taught the D Programming Language at a Russian University | The D Blog
Corresponding tweet for this thread:
Share link for this tweet.
I like a few things from the article:
This is the story about how ā¦ and how students sometimes surpass their teachers.
In my first months of university, I entertained the thought of being a school teacher. Now I realize that this was just a call for justice of sorts. There is a stark difference between a high school and a university, and for me, the latter was a much better experience. It felt like in just one month at university I learned more than in one term in high school, and that was so cool. Why couldnāt they explain it this way back in high school , was my common thought. If only educators applied the same educational methods in a regular school, it would make the experience much better. My desire to become a teacher vanished the second I received my first paycheck as a programmer (in Russia, āprogrammerā is a very well-paid job and āschool teacherā is the total opposite), but some memory of that desire remained.
This was also the time when I became interested in D. Compared to C++ it looked like a perfect programming language. You can write code that would be as fast, but without all those C atavisms. I used D for my masterās thesis, and I loved it. My program was twice as small and simple as the older C++ version while performing better. Implementing complex and more efficient algorithms in D was much easier; doing the same in C++ would be too much work, and, like any student, I always struggled with my deadlines
In 2018, an unusual offer surfaced on the D mailing list: ā¦
I didnāt see myself as a full-fledged lecturer and expected to be just an assistant. At the beginning that was the plan, with someone else acting as a lecturer. He was going to give lectures remotely via Skype, and I would assist him on site.
To my surprise, the university in question was
I checked their program: D was introduced for third-term students, and during the first two terms they learned C, C++, Prolog, and even some Lisp, I think (a bit too much, but why not). Their math course was solid, too (yes, I am among those who think that math is important for programmers).
We started working on the course program, although I barely included myself in that āweā. That was a mistake. With one month left until the classes started, the lecturer was suddenly leaving us. The news took me by surprise, butā¦ there was still plenty of time, right?
Everything was saying that there would be no help and that I had to do the whole course by myself, but my impression was hard to shake. The grave realization only came one week before Day One. Only then did I start to prepare for real.
This is supposed to be the part about the trials and tribulations of the endless bureaucracy awaiting a poor programmerās soul.
Things like the principles of
import
are easier to grok when using a command-line compiler rather than some āintuitive interfaceā.
Lifted by the success of the first seminar, I was slammed to the ground by the first lecture. It contained the full theoretical explanation of type systems and their various types, compared D with other languages, brought out the problems of C and C++, and demonstrated what makes D different. It was a total failure.
But the problem was with the lecture itself. First, it was too much for one class. Second, the lecture was based on the talks I did for my job that were intended for seasoned programmers. I realized that everything that Iād prepared for my future lectures must be tossed aside and rewritten from scratch.
I had several reasons to think that this was a well-fitting problem. First, I could write a solution I expected to see from the students in five hours or two evenings. Compensating for the studentsā level, it looked like a good project for a semester-long assignment. Second, the solution isnāt too straightforward. Simple brute force would take too much time so you need to cut off the equal variants in the beginning. And third, I was fascinated by this problem myself, so I thought the students would feel the same. I couldnāt be more wrong.
Thatās how in just one year you become an old geezer teacher who canāt keep up with the times.
The chemistry of a group coding session with a teacher ready to help wonāt kick in.
Bad students will skip classes anyway, but lazy B-graders could benefit from a little scolding.
And there were moments when I raised some questions:
Secondly, a broader outlook makes for better code. My familiarity with D improved my C++ skills and made it much easier to learn Python, especially its iterators. Most importantly, D is the futureāof C++ and beyond.
There is a challenge that Iād like to love myself, but with a different language. I donāt know how to point to the exact spot in the document. But follow the link and search for:
s = Multiline string, each line containing
To the surprise of the teacher each years students solve this problem differently and may find a better solution.
Itās also really interesting to see the translation. I havenāt read tho original one yet.
I do think D could have had a chance of upsetting or perhaps even replacing a lot of C++ usage except it had a couple major downsides in the past that stopped it (less so nowadays):
The first is a MAJOR issue for C++ devs, the second was a complete failure as a usability requirement.
One big thing from the article:
C++11/17/20 novelties were first battle-tested in D
Ehhh, no, not really at all, rather they were "battle-testedā in Boost for long long before D, in some cases for long before D ever existed.
And now Rust has better safety and reliability, even if not as many features, but those are things that exceedingly appeal to C++ devs, so I canāt really see D getting popular, much as an enjoyable language that it is, it missed its chance to shine due to those two big issues above in its past.
Yeah, there is a huge class of techies that sincerely believe having several options for certain big and important needs (and thus libraries) is desirable. Thatās one of the things that is still putting me off in OCaml btw.
At one point core contributors and community should converge and start agreeing on whatās the go-to way even if it lacks in one way or another ā there are sub-libraries springing up that deal with some perceived or real deficiencies in the bigger / std library and all is right in the world.
I donāt know why the above is such a mind-blowing revelation for so many programmers. Maybe some misguided notion of ācompeting librariesā or ādemocracyā or āchoiceā or whatever. But writing code for money is not a political statement; itās a job. Way too many people lack the ability to discern between the two, somehow.
D is a solid language that I never used but I liked what Iāve seen in a few tutorials and one video.
That being said, it might be a bit late to displace C++ now. Rust is gaining steam slowly but surely and is practically inevitable at this point, and for everything even further below there is Zig that is also improving steadily and stably.
No such put off with OCaml. Jane Streetās Core is an extension of the standard library, full interoperatbility.
However those āoptionsā in D were bad because, well obviously a GC, and it entirely split the ecosystems.
Not even that slowly, itās significantly larger than D has ever been even now and itās showing no signs of slowing down yet.