Another possible solution to the global scope debacle

I am one of these instructors who is arguing for a change in scoping behavior. For the record:

  • For my own personal use of Julia, I really like the 1.0 scoping rules. They’re simple and consistent, and it’s easy to add a global keyword for interactive snippets in the REPL. I’m still a bit on the fence, but I may even prefer the 1.0 system over the proposal in this thread (again, for my own use).
  • For my teaching, 1.0 scoping requires a bit of extra effort but is no great hardship. I can choose between taking a small detour to explain scoping up front, or I can punt and have the students use SoftGlobalScope.jl in the first sessions and explain why later.
  • My sole concern in pushing this is that I think 1.0 scoping is too unintuitive for unchaperoned beginners, and I think it will significantly hurt their inital impression of the language and may even slow adoption rate long term. Stefan also seems to be coming around to this view. I’m arguing for a change simply because I think my role as a teacher gives me a canary-in-a-coal-mine perspective that much more experienced Julia coders than I may lack.

Basically, please don’t kill the messenger misunderstand the message. We teachers are not griping about what we have to teach, we’re (or rather many of use are) worried about the confusion of our students.
[EDIT: clarified last two sentences, thanks Tamas.]

4 Likes