Julia as first language

True, but I think a first-language tutorial should also serve as a beginner’s tutorial for people coming from other languages too. It’s far more likely that someone encountered another more popular language before Julia anyway, and no tutorial should ignore these people and tell them “don’t read me.”

And here people should be told about stack memory. Heap memory is talked about when mutable types are introduced later. But it won’t take long for people to get to an explanation of heap memory.

1 Like

It is not necessarily about teaching new programmers. Maths & CS students are not the same as e.g. biologists who also need to learn say how give an injection to a lab rat. Those others cannot be taught to the same curricula as programmers, still many of them are taught the basics of programming, and Julia could be made suitable for this purpose.

1 Like

As someone who is coming from the perspective of a user, that is new to programming, and likes to pick up a modern language in the first place, I cannot tell you how tiring this is.

I cannot count anymore, how often I heard about the details of what object orientation is, by the hundredths’ person telling me what it not is, in contrast to functional programming.

And only by that.

There is a place for “I am coming from Python, I am interested about Julia” tutorials.
They are beneficial, and I recommend doing them.

I like how they are done in Gleam.

And please, for the love of god, spare the people reading our tutorial are already a programmer.
And that automatically happens, when you are considering them to be Python programmer.

This is one of the most pervasive misconceptions, and one that entirely destroys the whole purpose of a beginner introduction.

People who are programming in Python for years, are not in the same ballpark of those who use Julia as a first language.

Introduction to computer programming should not require Python skills.
As an introduction to Python should not require Julia skills.

There is a distinct place for all of them, do not mix concepts, because it seems they are all beginners from your perspective, as their perspective is likely to be different. :slightly_smiling_face:

A language, supposed to introduce other people into programming, should reduce possible confusion and distraction. And that means, you omit everything that is not absolutely basic to the understanding of the feature at hand. In order to understand how to build a function, I dont need to know how its done in Python.

That’s way too early. Low level details like stack and heap should not be on a beginners mind at all.

2 Likes

I think it already is, conditional on the student(s) actually having to write code for which Julia is a good match. If this does not hold, I don’t really see the point if teaching them Julia. There are great scripting languages out there for calling canned procedures, eg R (data cleaning, making plots, simple data analysis).

Again, please see https://bisc195.wellesley.edu. In one semester, I had bio students go from “never coded before” to writing a package that compares and analyzes coronavirus genomes, writing unit tests, commiting things to GitHub, etc.

16 Likes

I agree, I do not think a Julia tutorial should explain paradigms that don’t exist in Julia. After all, the tutorial isn’t specifically intended for people who know other languages either. My earlier statement meant we shouldn’t omit easy details for simplicity’s sake because people’s preexisting programming knowledge can skew them into misconceptions, especially since they are more likely to attempt experimenting with code. This is a good clarification.

I disagree. We certainly shouldn’t go into much detail. But you’re not going to understand why some practices matter if you can’t at least imagine main memory as a virtual sequence of bytes and know how efficiently memory is freed on the stack versus the heap. Arrays won’t make sense, you won’t know why people tell you to use immutable types instead of mutable types, you won’t know why @time reports “allocations” or what they are, you won’t know why reassigning that variable to a different type caused allocations. You’re right that implementation details are mostly unnecessary and confusing at the beginning, but ZERO implementation details are also baffling. The little bit is not hard for a beginner to pick up, and it’s harder to pick up other things without it, I can say that from personal experience.

3 Likes

Yes, that’s my point to. Whether a person has coded before is just one factor that determines whether Julia is a good language for them, and perhaps not even the most important one.

Motivation, intelligence, attention to fine detail, perseverance, and last but not least having a good instructor are IMO much more important for getting benefits from Julia than whether it is one’s first language or not.

7 Likes

And lots of other disagreements…

I would like to propose that there may not be one tutorial to rule them all. And that’s fine. I’m not going to teach my bio students about macros or stack / heap etc, because I’ve been using Julia effectively for ~6 years, and I barely understand them. Others may have different opinions / experiences, and you know those best, so your approach can be different.

I would further like to propose that, at this point, discussions about lesson content might best be had on a repo with actual content. I think there’s consensus that julia can be a good first language. So go forth - make it so!

11 Likes

I mean, same here. I don’t know what’s in a stack frame and I can’t tell you how any operating system finds free memory. I’m talking about literally cartoonishly little detail, more grunting “computer like compact memory, I write this to compact memory”, less systems engineering. For example, having a diagram of a square attaching to a chain of squares to represent push!ing an element to a Vector{Float64}, or Vector{Any} having squares with arrows to distant blocks to represent references. I remember my confused phase learning NumPy, and such diagrams really helped me through it.

1 Like

This is fine (we all have priorities), but note that a lot can be learned about this in a few hours. Same applies to macros.

1 Like

Correct me if I’m wrong, but it seems to me that we’ve all converged on the same answer: Julia is a great choice for a first language. Maybe not the only choice, and the “best” choice is a different discussion.

Now it seems like the discussion is mostly, what is the best way to teach julia to non-programmers? combined with “what tutorials exist or need to be created to teach non-programmers?”

I will go out on a limb and say most of these resources do exist Just go to the JuliaLang.org Learning page! Perhaps these resources aren’t touted enough, but there is certainly enough material to teach beginners from different backgrounds. It even covers different ways people learn from RTFM to tutorials to full length books to YouTube videos. The JuliaLang YouTube tutorial playlist alone has 9 entries with a total of 103 individual videos.

Given all the information that is currently out there, is the issue simply that people don’t know where (or how) to look for it? Maybe the JuliaLang.org homepage needs to be edited to put learning resources front-and-center? Are the resources out-dated and not helpful anymore? :man_shrugging:

5 Likes

Well, the discussion has always been about the willingness of community members to commit to Julia as a first language. :slightly_smiling_face:

I am not saying this is not the case, I am not saying Julia is not a good first language.

I do observe, that it is in practice a very science oriented language.
It’s enough to look into this forum, any blog post about it, and every article surrounding it.

So I question, if all the cornerstones are already at their place. :slightly_smiling_face:

I definitely think, that the potential is there, and it still doesn’t take a psychic to see,
that Julia isn’t used like that.

And I think that has a lot to do, with how we see newbies. And I think the Julia community sees newbies mostly in the form of students, who have to program, and who might as well do it in Julia.

And we would probably all agree, that this is a quite narrow definition of a newbie.
I would rather introduce people from other backgrounds to the language.

And I like to know, if I am alone.

2 Likes

Science orientation of Julia gets thrown around a lot. At what level of Science does one notice a need for Julia over say Python or R on modern hardware (say Apple M1 Macbook pro)? We are talking about newbies, so when can the sales pitch be made?

1 Like

The sales pitch to programming newbies?

We see you.

2 Likes

At the level where one starts to implement things from scratch, as opposed to just calling existing libraries. And by “existing libraries”, I’m not counting NumPy: Anything done in pure NumPy is better done in Julia.

1 Like

Besides the thing, that I consider R one of the worst languages to program, because it’s just so different from other languages, almost useless outside of science - because it’s very domain specific - and almost useless within science, thanks to Julia - is this off-topic.

This is not a thread - although abused as such multiple times - to suggest new fancy things, we can use to improve Julia as first language.

That would be a successor topic. Besides this, and as I just wrote, does it seem inopportune, to make one language, particularly an odd one like R, the requirement to learn stuff like building functions, understanding control flow, and doing similar tasks, in a comparable simple language.

It’s like having to learn how to balance on a unicycle in a clowns custom, to qualify for a regular children’s bicycle.

actually this is absolutely true and training wheels make it take much longer and cause more injuries than just having kids learn biking directly. Specifically there’s a thing called a “push bike” which has 2 wheels, is low, and kids push off the ground instead of pedaling. They learn the dynamics of riding, which requires doing the exact opposite motions of what you’d do to turn via training wheels. Training wheels are bad in every way and dangerous. A typical toddler age 3 or so can learn to ride a push bike in a few days and with essentially no falls (I know because both my kids and all their friends learned that way around age 3)

image

PS Explanation for those who care about these things:

The dynamics of biking requires what’s called “countersteering”, that is, in order to turn right, you must push forward on the right handlebar turning the handlebars to the left, this moves the front of the bike out from under you, causing you to begin falling to the right, then after this starts, you must turn the handlebars to the right in order to track the bike around in a curve.

On the other hand, if you have training wheels, when you push the handlebars to the left, your bike begins to fall to the right correctly but then hits the training wheel which pushes you back up and holds you in place, this makes your bike continue turning left when you wanted to go right.

So you learn quickly and incorrectly that to turn in any given direction you must turn the handlebars in that direction, fall towards the outside of the curve, and have the training wheel hold you up. This is the only way that you can turn a bike with training wheels through any considerable tight turn (but actually you can turn very gradually the normal way with training wheels on, so actually the dynamics change abruptly while you’re riding, and that’s even worse). Training wheels are unstable, cause oscillations, prevent you from steering correctly and therefore teaches you precisely the wrong way to steer, and causes more injuries and problems while solving nothing.

The moral of the story is that if you want to provide some kind of help for beginners, you are much better stripping back the extras (such as pedals) than bolting on some additional thing that alters the way things are done. You don’t want people to learn precisely the opposite of the proper lesson, you want them to learn some lesson that is close enough to correct that they can learn to correct it in a minor way when the complexity comes back.

6 Likes

Quite appropriately, this isn’t universally true. I heard all the dads rave about balance bikes and tried my darnednest to get my kid to take to a balance bike… but she never got it. She — and a number of her peers — would just walk above it, never quite getting the “glide” idea at all.

We used training wheels for a few weeks just to accustomize her to her new “big kid bike” and then took them off. In just a few sessions she was flying. No broken bones, no scraped knees. She’s the first in her preschool to ride a pedalbike on two wheels, and golly ain’t she (and I) proud.

This thread is full of assertions about “the right way” to learn, and I say phooey. There’s more than one way to do it, you gotta meet your audience where they’re at.

16 Likes

Certainly some people have had success with training wheels. In this context, usually the training wheels are there to overcome a psychological issue, fear, so that the kid will spend time on the bike. But it’s important to get those training wheels off quickly because the dynamics of a training wheeled bike really is different. If you let a kid ride with training wheels for a year before trying to get them to balance it will be very detrimental.

It’s also important to use the training wheels in a certain context. I’ve personally witnessed some horrific accidents where a child goes down a hill with a turn, the child starts out turning using a lean the way a bike does, the training wheel counter-torques them, pushing them over to the other side where the other wheel hits, they now are in a back and forth oscillation, feet come off the pedals (where the brakes are for kids bikes) and now they’re going fast, down a hill, oscillating back and forth, and there’s no way to stop. The only outcome that’s possible is to overturn and wind up flat on the pavement or go straight into traffic and be hit by a car. The worst case I saw fortunately was a bad abrasion, but hills and training wheels are a recipe for injury.

Also, given that she did have a push bike, it’s quite possible she learned something about it, even if she never got into gliding.

I agree with this thing you said though,

Still, it’s usually not a good idea to create a training system in which you learn the exact opposite of what’s good for the real system though. And if you do, do it for only a very short time so you don’t ingrain that behavior.

To bring it back to Julia, for example suppose you created a system where you told everyone to program it just like Matlab, with vectorizing every step, never write a loop, materialize every intermediate quantity, etc… and then teach a whole year long course where that’s all anyone does. That’d be a bad way to teach Julia I think.

2 Likes

I feel like this is such a perfect example of the discourse here, though. Quite honestly, I felt like I was failing as a bike-enthusiast-dad for putting on the training wheels because of all the hard-line exhortations like yours from bike-enthusiast-dad community. But it’s what my kid needed to succeed.

And even after hearing my story, you feel the need to pushback and caveat and worst-case. Seriously, YMMV. That’s the point, on bikes and on Julia.

14 Likes