Kate Greogry talk Naming is Hard: Let’s Do Better is not specific about C++, Julia or any other language, but how to name things properly in any language. As currently working as teacher and leading exercise classes of introduction to programming in C and also going through tutorials about Julia, I constantly find myself agreeing with her, that naming is hard and we should work on making it better.
This isn’t a rant. It is just stating my position. If it read like rant, it means that I need to work on my English. I also won’t be talking about names in core Julia or specific packages, since this is about the way we learn and teach programming, not how core of particular language use names. What is equally important I don’t have enough knowledge of Julia core to speak about it.
I must stress that my perspective is of average programmer that teach beginners how to start with programming. It is convenient variables
y, because it is less typing for me, but name of object should tell you something, not be just convenient to type. If
y are coordinates they are fine, the same is true of using
i just to interating
for loop (we work in C, which it is even more true). But, recently I try to avoid things like
x to name
d1 to name dictionary. First, because I feel that I encourage bad practice on my part, second, because I don’t believe that it is a good practice for teaching (see again Gregory’s talk).
When I introduce variable of type
int in C, just to show how integers in C (to stick to this concrete case) works I would rather type
int intVar = 0;
than what most materials that I saw has. Do my students understand that it is short-hand of
integer variable? I hope so, but I should check it when we go back to class after the break. Still, I believe that it is worth, since it make it easier even for me. When I see 'intVar1` I immediately know that this variable exists only to show how integers work.
When learning Julia I will know change code like
d1 = Dict()
dict1 = Dict()
Again, more typing, but less overhead for me. I just read
dict1 and I know that this variable is just for illustrating how dictionaries works.
I hope that you will find Gregory’s talk as worth watching as I did.