3 ms·
I could not agree more with every word you have written here. I would like to add that scientists are neither averse to change, nor too lazy to learn new tools
by Derbasti 13y ago
I could not agree more with every word you have written here.
I would like to add that scientists are neither averse to change, nor too lazy to learn new tools. However, they typically only care about the solution to their problem, not about programming in general. It is thus futile to try to convince them to use a different tool from a programmers' point of view--you need to convince them by showing them how much simpler they can solve their problems.
We are right now in the process of switching the introductory programming courses at our university from C to Python and I very much hope that we will be able to phase out Matlab as the default choice for the intermediate courses in the coming years.
- dsego 13y agoI've had an unfortunate opportunity to have to help out a cousin's girlfriend with python. She's studying informatics and it's their introductory course in programming (recently switched from pascal). But python has really too many abstract constructs to explain easily. One example they had was using the for loop. I don't know python, but from the examples and exercises the professor gave them, it doesn't seem to have a "normal" for loop. All the examples used the function range() to generate an array of indices to loop over. Which is silly, since they don't cover functions and arrays until later. I had a hard choice to either go into details of why it works or tell her to just memorise it. Later on in her materials, after introducing arrays, suddenly the for loop doesn't use indices and she has to unlearn the old way. The other problem was explaining strings and methods, which they use (such as str.uppercase()) but their introductory course doesn't cover OOP. The last atrocity was an example of looping over lines in a file using the for construct. Of course, polymorphism, iterator patterns and so on are too advanced, but it really bothers me that they have to just memorise stuff without knowing why it works. I'm glad I had C as the first language. Firstly you generally learn how the CPU actually handles instructions, since C is so close to metal. Secondly, after C you can really appreciate what other languages have to offer. And thirdly, I really prefer the bottom-up approach. Then again, my perspective might be a bit skewed, since I graduated in computer engineering, which is a bit more involved than informatics.
- analog31 13y agoI'm teaching Python to my kids (ages 10 and 13) right now, after finally ditching Visual Basic myself last year. Of course I'm at liberty to improvise my "syllabus." I decided to introduce lists before program flow. I introduced range() as a way to populate a list. And then we started doing things with lists using constructs like [x2 for x in range(-10, 10)]. At that moment, my daughter asked: "Can we use Python to make a graphing calculator?" With my syllabus in tatters, we installed matplotlib and played with it a bit. I've explained to my kids that in programming, sometimes we have to look up and use things before we fully learn how they work. This approach would probably make no sense for teaching C, where looping comes before lists. But in my idiosyncratic mental map of Python, lists come before looping. I'm not dogmatic about what first language to learn. My only intention right now is to see if my kids will take an interest in it.
- Derbasti 13y agoThose are all valid points. However, I am teaching an introductory programming course and I have seen many a student terribly confused by manual memory management and low level data types. My hope is to be able to introduce the very basic parts of programming (variables, assignment, branching, looping, functions) without having to go into any OOP or containers. There are always people who will never get even those most basic concepts, but there might be some who will get a basic glimpse of what programming means who would otherwise fail at basic C data types. In the end, they will all need to understand all of Python, then C, then (sadly) Matlab. What you are describing is indeed very interesting. One has to be very careful to not introduce too many concepts too early. So maybe, one should restrict looping to while loops until lists are introduced. And string processing could be taken as the introduction to OOP.
- hackinthebochs 13y agoTotally agree. I learned C first, then C++. I wouldn't have it any other way. The top-down approach means you truly understand nothing until a year or so down the line. The bottom up approach lets you fully grasp the small world you've been exposed to. And as more concepts are introduced your world expands. At no point are you just left wondering WTF are these magic keywords doing.
- nightski 13y agoThe thing is it isn't just about solving their problems. The tough thing is to convince them how much it would help the community as a whole. I have tried many times to download some PhDs code and attempt to get it to compile. Usually it can be done after a lot of effort and tweaking. But it would be beneficial for science if code was treated as important as the paper itself.
- Derbasti 13y ago> But it would be beneficial for science if code was treated as important as the paper itself. One could argue that it isn't. In science, the concept is usually more important than the implementation. But I totally agree. Scientific code tends to be awful and I wish I knew what to do about that.
- kyzyl 13y agoThat is one point of view. Another is that the entire scientific community is entitled to peer review your work, and you should enable them to. Not just your referees, who will likely not compile and test your code, anyhow. The concept may be the most important thing, but what good is a paper asserting some new concept if everyone can't verify it? I think it is the approach that folks like Fernando Perez at ipython are pushing with their html notebooks. Reproducible, comprehensible science.
- Derbasti 13y agoI LOVE ipython and its notebook! It is seriously one of the best things to happen in the last few years for scientific computation and teaching! So amazing!