87 points · by teleforce · 4y ago · 74 comments
There, FTFY.
Also: are they well-paid because they are D experts, or is being a D expert merely correlated with other traits that explain their high pay?
All I can say is they haven't had any trouble getting those jobs.
> are they well-paid because they are D experts, or is being a D expert merely correlated with other traits that explain their high pay?
Both. As related to me by their employers. D experience looks good on the resume. It strongly suggests that the person is not one of those do as little as possible people - that they actually like programming.
> "The features that I found the kids handled well were basic types like ints and strings (though what a funny name “string” is, that took a while to sink in)"
I have so ingrained in my brain the association of "string" to a text variable type that I didn't even consider the fact the name is bizarre.It really doesn't make sense at first sight, and this is something I probably would not have realized until someone asked me "Why do they call it a 'string'?"
Fun read. D rocks.
As a reasonably experienced programmer, however, this terminology makes me uncomfortable. To me, "text" implies a sequence of words written in a human language, rather than a sequence of arbitrary characters. It hints at structure which may not be present in a string.
Where does string come from. How odd.
For me, first language should be strict and not too loose with the rules (so not python). Once you've got the rules down and understand why they are there / why certain languages use those constructs - build from there.
But take all of this with a grain of salt because I was a very distracted student more interested in working for startups during college than graduating with a nice GPA ;)
Rndm_access, I know everyone is entitled to their opinion, but can I probe a bit on this?
Can you tell us about the largest code base you feel productive in? How about the largest code base you love?
How many lines of code are they? How many active developers do those code bases have (i.e. developers with weekly commits)?
Do you have trouble staffing new engineers?
Thanks for any reply given.
The largest code base I love and feel productive in is Linux kernel which is mostly C and assembly, medium sized project of 30 million lines, probably less than ten thousand active developers (although difficult to judge with the way development on certain features or functions can occur for years on private repositories before being merged), I would say relatively high rate of change for a project of the size.
To that end, I’ve left out a lot of the advanced features (so far), such as:
Templates
Type inference
Operator overloading
Overloading in general!
__traits
Classes/Interfaces/OOP
Pointers/references (mostly)
Memory management in general (thank you GC!)As someone who had a Clojure phase about 9 years ago: the actual problem with modern Lisps is that they don't really offer a big set of unique good features. The basic functional map-filter-reduce "meat grinder" is everywhere (and has been almost everywhere for a long time, Java not having lambdas for ages is what clouded everyone's vision into thinking that's not the case). The other "Lisp feature" is macro metaprogramming based on homoiconicity (Code Is Data™) and we have it in some non-Lisps too now (hello Elixir) and… is it really the best way to do metaprogramming? Ehh. Well, many compiled&typed languages actually do similar-ish things: using syn in Rust proc macros / haskell-src-exts in Template Haskell you can work with code "as data". And that isn't as nice to work with as D's `static foreach/if` + reflection/introspecion thingies like allMembers/getMember.
(It's impractical to program in C without using the preprocessor, and the preprocessor requires use of a lot of very outdated programming practices.)
D can be used in "BetterC" mode, where it operates as what C could be with modern sensibilities.
So yes, perfectly usable without OOP or classes.
Well, "is" is quite the load-bearing word in those claims. I think it is kinda true in the sense that lots of things can be represented as OOP. A great example is how Scala represents ML-style ADTs as sealed class hierarchies.
:D
> "Another challenge I’ve faced is the lack of a good debugging experience for VS Code on Windows. The C debugger for VS Code displays, for example, a string as a length and a C string (which might have trailing garbage). I’d rather not confuse them with this. I have read that Visual D has a better debugging experience, but I need dub support for these projects, and Visual D focuses on Visual Studio integration, something I don’t necessarily want to deal with in teaching these kids. "
You need to use the Microsoft C/C++ "cppvsdbg" option in your "launch.json" config as the "type", and also to use Webfreak's custom Natvis file for how to display D native types in the debugger:https://code.visualstudio.com/docs/cpp/launch-json-reference...
https://github.com/Pure-D/dlang-debug#natvis-with-vsdbg
This makes associative arrays display properly, and strings, etc.
I think this has been integrated in latest code-d. You want to compile with "-gc" flag though (not sure if this is the same flag name on DMD as it is on GDC/LDC).
The LLDB debugging is worse than the "cppvsdbg" mode IME.
[1]Seven Deadly Sins of Introductory Programming Language Design (1996) [pdf]:
If you pick something like python, any common beginner problem should have questions answered on stackoverflow, blog posts, etc. With a more boutique language that's not the case. Not to mention the ecosystems are much larger so chances are a library already exists to do something instead of making the beginner do it themselves and overloading them. There will be more tutorials, so people can get unstuck. More documentation around the tooling and just documentation in general exists, and so forth.
---
Of course, you should teach "what you know best", but how hard is it to learn e.g. python (even just for the scope of the course) and just teach that? My favorite languages are Rust and Go, but I'm not going to foist those upon newbies just because I'm more familiar with those than javascript, python, ruby, etc.
The secondary lesson here is that teaching (well) is actually quite difficult. Coming up with a curriculum is hard. Keeping students engaged and unstuck is hard. Knowing how to program doesn't prepare you for any of that.
2. D supports many styles of programming - imperative, meta, OOP, functional, machine code - so one can quickly learn these many styles without having to learn another language. With D's inline assembler, one can even use D to learn assembler without needing to deal with all the boilerplate of setting up an assembler program.
3. Interpreted languages, for example, do a good job of hiding what is actually going on. This leaves gaps in a programmer's knowledge.
4. D has a active and large learn forum. Help is available as needed.
5. Being a D programmer marks one as innovative and willing to try new things. Many employers consider D experience on the resume as a nice plus.
6. D includes a C compiler (ImportC) so if you must use a solution in C, it's easy to access.
1. People learn more than 1 language. What I'm referring to here is complete beginners who need to learn -how- to program. Once they grok that, it's not difficult to move to other languages, obviously with some exceptions.
2. It's not the job of a -language- to teach everything about programming or networking or computers or various protocols. That's the job of a curriculum.
3. There are way more $major_lang jobs than jobs for D, Clojure, Lisp, Crystal, or any of the other languages that are significantly less used. The sky is the limit for how many languages people want to play around with and learn, once they know enough to start learning other languages by themselves. No recruiter is gonna be like "oh, you learned $major_lang... Even though you likely applied to this role because our stack involves $major_lang and that's a language that you know well..."
4. Help, resources, meetups etc for $major_lang are orders of magnitude more plentiful than for D, etc. Imagine telling a student "no, no, you need to prove yourself by making forum posts for <niche language that I personally like and use> instead of having stackoverflow questions or tutorials to follow" in the case of getting stuck. Of course students should strive to do as much as they can themselves, but you would be surprised to see what beginners get stuck on and just need a gentle push to get going again.
5. Being able to be independent is more engaging than having to constantly pester a teacher or a forum. If a student wants to be a go-getter with e.g. python or lua, there are communities and resources to build games or websites, etc. And those already have had common stumbling block questions answered because they have large communities around them.
For the goal of teaching someone how to program, any language other than the major ones like python, javascript, ruby, c++ strictly make it more difficult for students because of the smaller ecosystem, lesser amount of documentation, and smaller community in general. I have nothing against D or other niche languages, but I'm against picking languages just because I'm familiar with them.
It can be difficult for experienced programmers & power users to remember that there's a sheer amount of information that needs to be learned in. There is no reason to make that more difficult for students.
It's easier to transition from D to C++, or D to Python, than to transition from C++ to Python or vice versa.
You're right, it's not the job of a language to teach everything. But since D supports multi-paradigm, it's easier to use D to teach it.
A novice stands no chance to figure out anything with this.
Same result for javascript: https://stackoverflow.com/questions/8290710/
And python: https://stackoverflow.com/questions/50510291/ (this one got downvoted, awesome experience for a novice, some people argue abusive nature of stackoverflow is intended so that people learn hard all its ins and outs before touching it or get abused)
Though I guess the classic workaround for that is to carefully construct the course such that these details are revealed gradually, without being overwhelming.
One's experience of adopting to new hardships and challenges can either be an uphill battle or downhill. You start with a hard language with manual memory management and small community you are forced to figure things out on your own, learn by helping others and contributing libraries. Then you can appreciate easier languages and learning them would not be as steep of a curve compared to starting off easy.
This was exacerbated by GML (the Game Maker Language) being the first real programming language I learned and used a lot. Idiosyncratic to say the least, but taught me "OOP" in terms of how scripts attach to objects to define behaviour. Fascinating stuff. Game Maker 4 is the reason I'm a programmer two decades on!
While this is not a crazy argument to make, it applies to people teaching themselves to program. If you're teaching someone else how to program, you're very carefully introducing new ideas, you're teaching them what they need to know, and you're answering the questions when they get stuck.
You are referring more to university classes that "teach" programming. That's a little different from this, where the author was actually teaching.