Julia as first language

I’m not really trying to push back. You did this thing, and it worked, and you have a valid point. I’m more trying to tie it into the overall pedagogical thesis I have, which is it’s a bad idea in most cases to send people down the wrong path for a long distance.

Sometimes a bit down the wrong path is fine, even beneficial, because it gets you moving and you can find out what’s wrong with that path and realize why you need to be on the right one. But 24 months with training wheels or a whole year long course in “programming in Julia” using matlabisms or Pythonic idioms is I think a very bad idea for the majority of people particularly when we have evidence from something like Kevin’s experiment where fairly standard Julia idiom was taught to completely naive bio students successfully.

Your mileage may vary, but it’s likely to vary in a unimodal lump with light tails rather than a massively spread out cauchy distribution.

1 Like

Has anybody indeed suggested that here, or is it a straw man argument? The discussion is about teaching Julia as the first language, meaning teaching basics of programming first, and loops definitely belong to the basics of programming.

2 Likes

It’s not supposed to be a straw man, it’s supposed to take that axis to the limit where we can all see it’s probably not correct and then help us think about where on that axis we should be. The point I’m trying to make is that it’s a good idea to pare down the complex thing to its core, but not to alter the core to be different from the essence of the thing you’re teaching.

To put it in a different context. I personally believe that Bayesian methods are the correct way to analyze data and that Frequentist analysis is very very wrong and misleading and responsible for many bad scientific problems. So for example I would never recommend anyone to take a standard Statistics 101 class to “get started”. I realize this is highly controversial claim, but this is a strongly held belief based on much experience. Once you’ve had your thought process ruined by thinking about null hypothesis testing and treating experiments as random number generation and such it is extremely rare to recover.

For what it’s worth, I thought it was a compelling analogy, and while I think @mbauman raised an excellent point about meeting people where they are, that doesn’t mean that we shouldn’t at least think about what we believe will work for the most people the best.

3 Likes

Thanks @mason. I think we would get far if we write pedagogical material that focuses on what’s essential to programming and just happen to show those essential things in Julia. So for me that’s things like user data types (structs), functions, loops, arrays, and basic control flow. Just stick to that pared down subset of Julia while composing your pedagogical materials and you’ll likely do well.

What this probably means is things like broadcasting and parametric types and details about method calls and the tuple of types that are used to select a method wind up waiting to later. But functional programming concepts, like using “find” or “map” are probably right there in the beginner stuff because functions are first class in Julia.

Honestly I really like @kevbonham’s material linked above.

There was a textbook used in the 1990’s which was really good at teaching basics of computing using scheme. It was more gentle than SICP. I googled it and found a digitized copy here:

Although this is aimed at CS students, I think it had some really good ideas about structuring the mental path towards better understanding. If I were going to write material today I would look at this table of contents and then try to take ideas from it and think about how to present similar ideas in Julia.

Scheme relies heavily on tail recursion, so instead in Julia we’d use loops for example, but it’s still worth it to think about the tension between abstractions and the machine.

I was a TA for a class that taught using this book in about 1994 or 1995. Students came out of it understanding a lot of really fundamental ideas in a way that students who took “a quick intro to C for engineers” didn’t.

4 Likes

But I don’t think this is really being proposed.

But I didn’t teach anything about macros, and very little about types (except to help them recognize what Method errors were trying to tell them) - a bunch of people in this thread have claimed one “must” teach these things to beginners.

This is the right answer. I appreciate the praise for my course - I worked really hard on it - but I don’t think the course I designed would be ideal for a physics student that wants to learn coding, nor for someone that wants to learn web design. I think the ideal course for a beginner that has a degree in library science is going to be different then the ideal course for a high school kid.

And if you’ve got 24 months to teach someone, you need something different than if you have only a semester or (god forbid) a 3 day workshop.

But if I’m wrong, the best way you can show me is but building those resources that do things the way you think they should be done. I’ll even be happy to review and provide feedback, and help you design assessments that test if your students are learning (I have some formal training in this arena). Hell, I’d even be up for coming up with shared learning objectives and a procedure for comparing efficacy - that could be a cool project.

But my point is, the next most useful contribution to this discussion would be actual content that fits your vision.

7 Likes

Dabbling Doggo Dot J L has put together a video course on Julia for beginning programmers. It LGTM!

7 Likes

Stacktraces

might depend on the domain

but PyTorch has some of the best documentation for any library I’ve seen

1 Like

I absolutely agree with that.

One thing, that I learned in my time as programmer, is that things often look substantially different in practice, than they do in theory.

Theory hides things from us, as we do fail to see all the details, put false weight on some assumptions, and overall lack any kind of feedback from reality.

I mean, that is such a strong statement:

We lack feedback from reality.

And I feel like people don’t even want to hear any of that.

They seem to have already made their mind up about what’s sensible for beginners.
To the degree, that they can’t hear anything anymore, when they are spoken to by one.

I feel like we lack a certain kind of empathy, and the ability to listen, instead to speak.

It’s not like our ranks are flushed with inspired people, and that we don’t know where to put the all of them, because there are just so many of them.

Our industry lacks people for just as long, as we ignore the science part of computer science.

We continue to ignore both people and science.
And I am sad about that.

That is by design and not all that bad. Theory is the essence, abstracted away from details, that remains as “truth”.
Tech bros hype new stuff every week and call it fancy names. That comes and goes and is not quite knowledge.

I don’t say theory is bad. :slightly_smiling_face:

And it’s insufficient to understand the universe, or ourselves.
Since it leaves us in the dark, to what stays true.

1 Like

Theories should come out of some experience. Certainly some people have some experience teaching with Julia. Do we have them saying “this is really hard” or “Julia is unsuitable?”

At the moment I’m writing a book on data analysis and statistics. A very opinionated book. Where it needs examples I write them in Julia. It’s not a book about programming so I’m not teaching how to write Julia, more like I’m teaching how to use mathematical ideas and then Julia is the implementation language for short examples. I think Julia is transparent enough that I can write 10-15 lines of Julia and intersperse some comments and not feel that I have to explain the code in detail, since the mathematical ideas have been explained in detail and Julia is just implementing those details fairly straitforwardly. I personally think that wouldn’t be the case in R or Python or Scheme or Java. Matlab might be suitable but Julia is far superior and freely available.

But as I say I’m not teaching programming. Still, I wish I’d had Julia as a beginner. When I did start programming, in about 1989 at age about 13, I tried a lot of different languages, Pascal, FORTH, True Basic, Prograph, C, etc. Of those I think actually True Basic which was designed explicitly for education was also closest to Julia in flavor. Julia vastly exceeds it’s power, but True Basic was the language where I explored fractals, classical mechanics, iterated function systems, simple ODEs, etc because it was powerful enough, simple enough, interactive enough, and had graphing capabilities.

I think we all agree that different beginners need different things. A beginner whose primary interest is in building a toy SQL database backed web app for keeping track of library books probably wouldn’t be served well by Julia. A kid who is excited about chaotic dynamical mechanical systems or interacting ecological systems or generating spatial visualizations of the history of COVID infections would be pretty excited to have Julia I think.

Which maybe gives me an idea for another book… Exploring dynamics with Julia.

3 Likes

You still would have had to wait about 6 years for the first i686 cpu, and until the early 2000s for the minimum RAM to become affordable. :wink:

My Mac SE had 1MB of RAM and two 1.44MB floppy drives. I hand upgraded it to 4MB of RAM, a 68020 accelerator board and a 100MB hard drive around 1992 or so. But the SE was my second computer, the first one was a TRS80 Color Computer and had the expansion ROM reader and could store programs on cassette tape!

The original question posed seems to be a call for suggestions from the community.

I don’t really understand where this comes from or to what it is referring. Can you expound on it?

3 Likes

A lot of people read what you wrote, and participated in the discussion you started. When people still disagree with you, another possibility is that your arguments were unconvincing.

I disagree: Julia has a ton of inspired developers, who do excellent work and distribute it generously as open source. I continue to be amazed by this every single day.

23 Likes

Well, you could have had … it was just called “Common Lisp” back then :wink:

Seriously, imho Julia is a nice language for teaching.

  1. It has a sufficiently simple semantics or can be restricted to a suitable subset – as suggested by @mkitti. Interestingly, HtdP even restricts Racket to several teaching languages building up from the substitution model of evaluation – which is very easy to follow, yet precisely defined – to environments and mutable data.
  2. Julia allows to remove the curtain, e.g., when implementing efficient numerical algorithms from scratch or reaching into the internals of the compiler.
  3. Finally, also advanced concepts such as parametric types or meta-programming/macros are readily accessible. Further, multiple dispatch is very powerful and enables highly flexible and modular code – imho, OOP is no match here.

On the other hand, people who just want to get stuff done might not care for any of these. Especially, when trying stuff alone, the most relevant criteria probably are:

  1. How many snippets for common problems are readily available?
  2. How amenable is the language for adapting such snippets, e.g., via trial and error?

While this “how can I achieve want I want without actually understanding what’s going on?” attitude might be nice to quickly hack something together, it’s rather bad for teaching/learning. True understanding needs to go beyond simply calling some libraries and packaged tools, e.g., using the tidyverse and GLM’s exclusively. Gelman & Nolan have a nice example, on how interesting a seemingly simple statistical problem gets when you think outside of standard models (Gelman obviously provides a Stan case study on this problem).

1 Like

People have not even understood the assignment. It’s not that I feel they disagree with me, they have rather taken over the conversation and talked about something else.

And this is exactly the type of gaslighting, I was speaking about.
Its tiring if people can’t listen, but speak over you.

This is exactly the type of hostile behavior towards newbies, I was speaking about.

People use this thread for what they think it should be.