# Issues encountered teaching classes with Julia for the first time

**URL:** <https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553>\
**Category:** New to Julia\
**Created:** [March 5, 2021, 1:35pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553 "2021-03-05T13:35:03Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 5, 2021, 5:55pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/21 "2021-03-05T17:55:39Z")

</div>

> [@rdeits](#):
>
> Can you give some more detail about this? How do you instruct students to install Julia and the packages they need? And what do you ask them to do? And what kinds of things go wrong?

The evidence for the latest (most serious) issue is that students installed a couple of packages which broke all of their other installed packages. I’m trying to isolate which package(s) they installed.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [March 5, 2021, 6:13pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/22 "2021-03-05T18:13:41Z")

</div>

> [@compleat](#):
>
> Yes, the same here, and I was just starting to win them over when alot of students started having the issues I described above, and the combination of these two things has made life very difficult for me (you wouldn’t want to be me at the moment!)

I received very bad “teaching scores” last year, and the open-questions in the survey made it clear that the main problem was in having used an odd language nobody knew about… but this made me thinking on the real utility of these kind of surveys… after all, what the students know on what they will need in their (hopefully long) professional carrier ? Yes, they are not CS students, but I honestly thought that showing them how to solve their domain specific problems using a modern programming language and exposing them to it was the best thing I could do for them and their professional future, even if the kind of stuff that I taught could have been done in Excel if one wants.

Indeed this year I did the course in Excel (I made a survey before the course asking them, Excel won) and the students have been happy, sic :-///

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [March 5, 2021, 6:23pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/23 "2021-03-05T18:23:31Z")

</div>

> [@compleat](#):
>
> I’m trying to isolate which package(s) they installed.

You can check with `st` what versions work for you, and make up a command with all the packages and versions (just an example):

```julia
(@v1.6) pkg> add --preserve=all Stipple@v0.6.0 ShiftedArrays@v1.0.0

```

If the install changed some dependency before, by forcing some versions you know should work, you should get an error with the packages. Or at least I think something like this should work, possibly excluding if you need #main or #master for some package.

> [@sylvaticus](#):
>
> Indeed this year I did the course in Excel (I made a survey before the course asking them, Excel won) and the students have been happy, sic :-///

> **[The Reinhart-Rogoff error – or how not to Excel at economics](https://theconversation.com/the-reinhart-rogoff-error-or-how-not-to-excel-at-economics-13646)**
>
> Last week we learned a famous 2010 academic paper, relied on by political big-hitters to bolster arguments for austerity cuts, contained significant errors; and that those errors came down to misuse of…

> **[Damn you, Excel spreadsheets, JP Morgan Chase edition](https://qz.com/119578/damn-you-excel-spreadsheets-jp-morgan-edition)**
>
> The US Securities and Exchange Commission’s investigation into JP Morgan Chase’s hiring practices in Asia took a more serious turn with a Bloomberg News report that the bank kept a spreadsheet of well-connected hires from prominent families, linked...

> ultimately led to the bank to declare $6 billion in losses and could lead to [another $600 million](http://www.reuters.com/article/2013/08/28/us-jpmorgan-whale-talks-idUSBRE97R0WA20130828)in fines. As James Kwak [explains on Baseline Scenario](http://baselinescenario.com/2013/02/09/the-importance-of-excel/), the errors stemmed from a combination of copy-paste mistakes and a faulty equation created to crunch the numbers.

> while Excel the program is reasonably robust, the spreadsheets that people create with Excel are incredibly fragile.

---

<div class="post-metadata">

**Author:** ![tobias.knopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias.knopp/32/7551_2.png) [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)\
**Post date:** [March 5, 2021, 6:29pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/24 "2021-03-05T18:29:13Z")

</div>

Wouldn’t the problem be partly solved by providing an environment with pinned packages? This will not solve all problems but the OP was mainly concerned about what happens if the package landscape is moving during the course. I would argue that the course does not need to follow package changes.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [March 5, 2021, 6:40pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/25 "2021-03-05T18:40:25Z")

</div>

> [@tobias.knopp](#):
>
> Wouldn’t the problem be partly solved by providing an environment with pinned packages?

Definitely this. I have one lecture where I have students install some packages, just to see how it works, but everything else uses pre-defined Project.toml and Manifest.toml that students then `instantiate`.

I make sure students are all installing the same version of julia as me, and I did not encounter any issues, even with windows users. At minimum, you should make sure they’re using projects for everything, then usually it’s easy to reset by just deleting the toml files (though in practice, I’ve never had this issue).

I can’t even imagine what they’re doing that could bork their registry, but it should be as easy as removing the `.julia` directory, then launching Pkg again.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 5, 2021, 6:51pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/26 "2021-03-05T18:51:05Z")

</div>

When I taught a structural dynamics course, I presented the students with tutorials in Julia.  
Around one in five students complained about the “unknown” language.  
Most came to appreciate it by the end of the course. I’ve had a couple of emails  
prasing the choice afterwards. But for some students programming in whatever language will generate  
a negative response no matter how hard one tries to make it palatable.

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [March 5, 2021, 6:59pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/27 "2021-03-05T18:59:49Z")

</div>

I would not be messing around with `add --preserve=all` etc.

> [@Palli](#):
>
> ```julia
> (@v1.6) pkg> add --preserve=all Stipple@v0.6.0 ShiftedArrays@v1.0.0
> 
> ```

That will just control what is in the Manifest.toml.  
Which means it is a causal `] up` away from being swept away.

> [@compleat](#):
>
> [even Environments often don’t help, and I don’t even want them to have to go that far]

I really think you have to use Enviroments. they might not solve everything but they will help.  
Its also one of the thigns that is way easier in julia than in any of the common alternatives (Python/R/Matlab etc.

At least teach them enough to do `julia --project=.`  
to start julia in an eviroment with a `Project.toml` that you are providing.  
and that has the packages with the compat settings you trust.  
Which might be `=` rather than default `^` compat.  
e.g.

```julia
[compat]
Stipple="=0.6.0"
ShiftedArrays= "=1.0.0"

```

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [March 5, 2021, 7:00pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/28 "2021-03-05T19:00:53Z")

</div>

> [@sylvaticus](#):
>
> Indeed this year I did the course in Excel (I made a survey before the course asking them, Excel won) and the students have been happy, sic :-///

One more to @Palli 's list:

> **[Excel: Why using Microsoft's tool caused Covid-19 results to be lost](https://www.bbc.com/news/technology-54423988)**
>
> The decision to use a spreadsheet format that dates back to the 1980s has proved to be unwise.

There are numerous fundamental issues with Excel like

- tight coupling of data and logic
- no version control
- artificial restrictions like max number of columns / rows

If you are not doing something completely trivial (like adding / plotting a few numbers), Excel is almost always the wrong tool.  
Imho every student should learn this lesson.

---

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [March 5, 2021, 7:22pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/29 "2021-03-05T19:22:47Z")

</div>

Is this an undergrad class? Maybe having two required languages is too much anyway. I took biology, not data science so obviously the focus on software use is different. It was coordinated throughout the uni that we would be taught R and only expected to know R for any class. Even then lots of people thought it was terrible that we were being made to use this difficult software “just because it’s free”. Making students learn additional languages for different classes is enough to make most hate coding. Whereas if they are given the space to become competent in one language they may see the power of it and learn to live code.

Honestly, I love Julia. It’s my go to language for any problem. It’s changed my approach to problems and made me a better programmer and scientist. But Ive definitely had more issues getting started with it than I did with R or Python. If students are already learning other languages, I think I’d present examples of things that can be done with Julia but start them out on something more familiar and has more answers on stack exchange etc.

Just my thoughts. I totally get why you want to teach in Julia. And it’s a real shame that there’s been kickback.

---

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [March 5, 2021, 7:26pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/30 "2021-03-05T19:26:15Z")

</div>

Although perhaps I’m being weak/defeatist. You are giving your students a great opportunity. They don’t have to like you for it. But some of them will thank you in the end.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 5, 2021, 7:40pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/31 "2021-03-05T19:40:31Z")

</div>

Thanks all for your thoughts. I’ve got a few leads to look into.

One thing I told my students about Julia is that its adoption by industry could very easily pick up dramatically in the next few years. If so, being among the few with it on their CV’s won’t hurt at all.

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [March 5, 2021, 7:52pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/32 "2021-03-05T19:52:22Z")

</div>

For three double lectures (of one course) I taught this fall, I made a JupyterHub server in the cloud. Once you know it, it’s reasonably easy to do. I can spin one up now in 15min. See [GitHub - mauro3/JupyterHubWithJulia: Desciption & scripts of how to deploy The Littlest JupyterHub with a Julia kernel](https://github.com/mauro3/JupyterHubWithJulia)

One thing to note is that Julia is pretty resource hungry. One notebook will start at around 0.4GB (If I recall correctly). So if you expect that students have several notebooks open at once, you will need to provide enough memory on the machine.

If I taught a whole lecture course, I would probably try to get the students to install Julia on their machine. That way, it’s easier for them to use it in the future (although, probably only few will actually use it again). Maybe having a backup JupyterHub running would be a good idea. That way you can point the students who struggle with the install to there.

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [March 5, 2021, 8:14pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/33 "2021-03-05T20:14:20Z")

</div>

I actually have seen my package setup “lock up” two times, I think, but was never able to reproduce it. Maybe if Julia crashes or get’s killed in the middle of certain package management operations?

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [March 5, 2021, 8:18pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/34 "2021-03-05T20:18:55Z")

</div>

> [@compleat](#):
>
> Maybe the Pluto devs. will eventually add a ‘static’ option as well (or already have?).

I’ll like that, too. When some cells are compute-intensive, full automatic update is often not viable. If Pluto had the ability to disable the auto update - either globally, or even better, for selected cells - it would be usage for an even wider range of problems.

Maybe for cells without auto-update (and the cells depending on them) the output could be marked in some way (“greyed out” or so) if it’s out of date, so the user’s won’t overlook it?

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [March 5, 2021, 8:49pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/35 "2021-03-05T20:49:57Z")

</div>

> [@oschulz](#):
>
> If Pluto had the ability to disable the auto update - either globally, or even better, for selected cells - it would be usage for an even wider range of problems.

> <https://github.com/fonsp/Pluto.jl/issues/971>
>
> In some applications, the computational cost of evaluating some cells can be so …high that using Pluto instead of Jupyter is currently not an option (for example cells that do expensive statistical inference, run a simulation for minutes, etc.). However, the number of such cells in a notebook is typically (very) small.
> 
> Would it be possible to allow the user to disable auto-update for selected cells? The cells could be color coded or so to make this obvious. And if the output of the cell becomes out-of-date, the output could simply be "greyed-out" or so (same for all cells depending on it). Then the user could choose when to manually trigger re-evaluation of the cell (which would, of course, then also trigger evaluation of all "normal" cells depending on it).
> 
> I feel this would not break the philosophy of Pluto, since things would still be auto-updated for the most part, while it would open up Pluto for an entire class of applications (those involving heavier computing). It would also be quite natural to use, I think: While the user is playing around with some cells that (e.g.) define the input of a calculation, and to some initial check and plots, they typically \*will not\* want their (maybe chain of) expensive "main calculation" cells to be re-run all the time. However, when they're happy with their (e.g.) input stage, they \*will\* want to trigger their (maybe chain of) main calculation cells, and of course they \*will\* also want all their follow-up analysis and plotting code to run.
> 
> In some contexts, e.g. where cluster or clould job submissions are involved, running certain cells might actually consume limited computation budgets (or money, in the case of cloud). Even if not, it might load a system heavily, affecting other users. So allowing for optional control of the update-mechanism would also be resource-friendly.
> 
> My apologies if this has already been discussed.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [March 5, 2021, 10:20pm UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/36 "2021-03-05T22:20:40Z")

</div>

I wonder sometimes why people have this attitude that it’s not worth learning a language that is not used by the largest amount of people. R and Python user bases were smaller once as well, and it’s not like the machine learning and statistics software we have now is all perfect. There are so many weird things in R for example, but people mostly ignore or just accept them because they perceive R as the “blessed” choice for statistics, without asking deeper questions why that came about historically. Peculiarities in Julia then might receive much harsher criticism, almost like “why are you trying to displace the status quo with something that is not even perfect yet”

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 6, 2021, 12:15am UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/37 "2021-03-06T00:15:44Z")

</div>

> [@oschulz](#):
>
> I’ll like that, too. When some cells are compute-intensive, full automatic update is often not viable. If Pluto had the ability to disable the auto update - either globally, or even better, for selected cells - it would be usage for an even wider range of problems.
> 
> Maybe for cells without auto-update (and the cells depending on them) the output could be marked in some way (“greyed out” or so) if it’s out of date, so the user’s won’t overlook it?

Neptune is essentially Pluto with such a feature (‘don’t execute’) turned on all the time. Have you tried it? My students like it. I set it up, but I don’t claim the credit. Neptune is Pluto, with a pinch of ‘common sense’ (IMO) thrown in.

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [March 6, 2021, 6:49am UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/38 "2021-03-06T06:49:46Z")

</div>

> [@sylvaticus](#):
>
> Yes, they are not CS students, but I honestly thought that showing them how to solve their domain specific problems using a modern programming language and exposing them to it was the best thing I could do for them and their professional future, even if the kind of stuff that I taught could have been done in Excel if one wants.

Think about it from the students’ perspective. One of my semesters in undergrad (around 2010) I was taking 5 STEM courses and doing a research project. Research required me to learn & write `Fortran77` and learn how to use `Cygwin` on my school-issued laptop. Another class required me to learn & use `NI` for data-acquisition (wind-tunnel) and use `Matlab` for data analysis. Yet another class had me learning `Python` for workflow automation (`Abaqus` scripting). And in _yet another_ class (modeling and analysis of uncertainty) I had to learn & use `Minitab`. If I all of a sudden found myself in another class, where I _could_ use any of these languages, but my professor mandated I use `Julia` (or another language) because “it’s the best, trust me” I would have been upset. I had no time to learn _yet another_ language, let alone debug installation issues when I had other perfectly good tools at my disposal.

In my opinion, university shouldn’t be focused on teaching how to use “Language X”, but rather “how to think like a programmer/engineer/scientist.” I think it’s fine to show students a modern language, but at the end of the day all that should matter is whether the student found tools that let them learn and apply their knowledge to solve the assignments. If the student ends up writing a FDM hypersonic CFD code in Excel for their assignment, fine… as long as they produced the results required and implemented the technique properly.

---

<div class="post-metadata">

**Author:** ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Post date:** [March 6, 2021, 6:57am UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/39 "2021-03-06T06:57:11Z")

</div>

I started with Julia last Fall, and I’ve had issues with 2. and 1. Usually they were caused by me changing from one Python installation or virtual environment to another breaking IJulia, which in turn caused me to re-install the whole 💩, sorry but that’s how I felt. Now I’ve since learned a lot about how IJulia, Python and Julia are connected, but fixing it when changes happen is not intuitive.

And since I’m on MacOS, installing the software typically works just fine. Homebrew, conda, pip, ven, docker work fine in isolation. Managing Julia and Python installations together is a bit harder but doesn’t break if you don’t move Python. In the same category is the problem that Julia installs its own Python in .julia/conda. Now that I wanted to call Python from Julia I had two Python installations to manage.

I would very much prefer if there was **one** way to say to Julia that Python is \>\> here \<\<. If I change where \>\> here \<\< is it would do whatever necessary to fix itself like precompiling IJulia. And no secondary internal conda.

Pluto helps a lot because you don’t have Jupyter, so that part can’t break.

I also quite like Docker since I can install any software I want without interfering with my base system. I’d use it more if the memory management was more intelligent. I’ll explain. I’ve run some Julia notebooks that took a lot of more RAM than exists in my Mac, up to 50 GB on a 16 GB mac. MacOS is marvellous, the system didn’t freeze or anything like that. But with Docker I have to set a max memory limit, and then it ends up using that memory all the time.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [March 6, 2021, 8:13am UTC](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553/40 "2021-03-06T08:13:03Z")

</div>

> [@StatisticalMouse](#):
>
> I would very much prefer if there was **one** way to say to Julia that Python is \>\> here \<\<. If I change where \>\> here \<\< is it would do whatever necessary to fix itself like precompiling IJulia. And no secondary internal conda.

Actually, this feature basically exists. Making `ENV["PYTHON"]` point to your python executable and `] build PyCall` will tell PyCall to use this global installation rather than installing another one into `.julia/conda`. Similarily, you can set `ENV["JUPYTER"]` and `] build IJulia` to point to an existing jupyter installation.

[Previous page](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553.md?page=1)

[Next page](https://discourse.julialang.org/t/issues-encountered-teaching-classes-with-julia-for-the-first-time/56553.md?page=3)
