Ask HN: Old CS lecturer looking for advice from current and recent students
392 pointsI am 61, with an academic background in computer science, and many years in industry, mostly startups. I taught many years ago, and have resumed teaching, a database course: data modeling, relational algebra, SQL, application programming and architecture (e.g. 2-tier vs. 3-tier, web & mobile), database internals.
Student evaluations were pretty good for the most part, but quite a few students found the presentation a bit dry: I prepared every lecture as HTML ahead of time, made it available online, and presented it in class. A couple of times, I would do interactive things, e.g. tuning queries using EXPLAIN and playing with indexes. That proved pretty popular, but of course, it's difficult to capture this material, (I recorded a log of the session, but extemperaneous discussion was not captured).
Looking for advice on how to balance prepared material and more spontaneous things. Also, any other advice on how to make material of this sort (theory + practice) easier to absorb.
Comments (181) 74 threads
Earlier commentsOne of the biggest things for me is not necessarily the content of the lectures, but what happens outside the lectures. Some lecturers give small non-graded "challenge" assignments that really get me engaged with the content. A couple of my favourite examples of this:
- "Factor this small RSA key" - I ended up reading a paper on, and implementing Pollard's rho algorithm. It was on the extended reading list anyway, but I'm typically not motivated to read things just for the sake of it.
- "Implement OOP concepts in a "non-OO" language, such as C" - This one was just generally interesting, and helped to dispel some of the "magic" of OOP. It was also a chance to look under the hood of existing OO implementations.
I think CS can be a dry topic and not everyone will enjoy it. I think adding some visualizations like the videos from 3Blue1Brown can be cool. It's sometimes hard to visualize how an algorithm works by reading it. https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw
Best of luck
For pedagogy, if it needs to be interactive, it should just be source code that will be executed in whatever is the idiomatic manner for the underlying language or tool. (But very often, things don’t need to be interactive anyway, and only are shoehorned into it because it’s trendy.)
For example, the Scala extension to Jupyter is painful. Absolute hindrance to learning or teaching or working. Compared with just writing source in a powerful editor and then using sbt, it’s night and day.
I say this as someone who has spent many years working with IPython and Jupyter, including writing 0MQ kernels to use IPython with a company’s in-house language, and working on large data science and machine learning teams.
Thinking of notebooks as discrete units of sharable work, I think, is absolutely eroding many more sincere collaboration, pedagogy and reproducibility skills.
It reminds me in some ways of the early 00’s MATLAB fad, especially how The Mathworks targeted students to get them hooked on this one way of working (with MATLAB as IDE, interpreter, presentation tool, etc.) to create a pressure on employers to offer MATLAB as a standard working environment.
For "reproducibility" or "experimentation" in a production-like R&D environment or university lab, there is one set of downsides. For pedagogy there is another.
From a reproducibility point of view, notebooks are bad because you'll always need the underlying software you're writing to have good modularity anyway. One-off helper functions or any pieces of important business logic, etc., need to be factored out into separate packages or libraries that can be imported anywhere they are needed. "Hard coding" implementations into a notebook is very bad for this, because if you don't exercise an unrealistic degree of care, then certain cells or definitions will rely implicitly on values or imports from other cells, and the interdependencies are a mess to untangle if you are trying port the code from the notebook into a more modular form. Experience has shown me that you don't gain any boost in productivity or speed for experimentation or tinkering if you ignore this and try to make things more modular later on. You just end up writing really sloppy notebooks that have to function as standalone scripts, and you waste some other engineer's time who has to go back and undo the mess.
If you just start out developing in source files in the natural and idiomatic package / library approach of your underlying language, it gets you 90% of the way there for zero extra effort.
The other big thing is that regardless of whether you are writing experimental code to test an idea or a prototype, or you are writing production code, you should be using code review in both cases. Particularly in the experimental case, as in machine learning or statistics, many of the mistakes that make you go back and waste a lot of time are because of methodological errors or diagnostic errors that should have been reviewed by other researchers before you execute the experiment or prototype -- which means you want your code in a good format for simple code review tools, like PRs in GitHub or analyzing diffs. Notebook formats are notoriously bad for this, and since you can accomplish any of the same dev tasks without a notebook anyway, it's an argument against trying to shoehorn a code review process to use some extra type of tooling for analyzing code review artifacts directly from a notebook file.
Along the same lines, notebooks end up encouraging you to have a large block of imports that implicitly define your dependencies, including resources, settings, environment variables, local files, URL settings, etc. etc. This stuff should always be factored out into a maintainable settings artifact of some type that can also be version-controlled and reviewed.
So once you refactor any kind of reusable logical components, refactor any hard-coded settings, use proper dependency management, and put anything of any importance into source files that facilitate easier packaging / sharing / code review ... all you're left with in the notebook is shallow plotting code, which can just as easily be in a source file as well.
Once at that point, I don't think it matters if it's a notebook or not, and it would be fine to use notebooks as extremely shallow presentation tools that do nothing but import other source packages and produce plots / tables / etc. But again, if you've gone that far, there are better ways to produce the same plotting artifacts, etc., and to get away from reliance on the browser as the display medium, and to improve code review even of the plotting artifacts.
For pedagogy I think the problems are different. First you have to think about what is the goal? If the goal is to teach programming concepts, then you are better off teaching them in the idiomatic execution paradigm of whatever language you're using. So distribute source files and instructions to students, rather than isolated notebook cells. Consuming this stuff by looking at it through a web browser is not a relevant property in this case, because the lesson has nothing to do with how the source code is visualized. You're essentially just teaching the students to be impractically lazy by relying on notebook cell execution as the means to advance in the lesson, when they should be learning the appropriate idiomatic execution mechanism of the language they are learning.
A notebook could be useful for distributing a browser-based visualization of a concept if your goal is just to make a web app or something. Like, maybe you want to show an animation of the heat equation to teach a differential equation lesson, or plot a path of a projectile for physics. What's unique about these cases is that the lesson you're trying to teach is specifically unrelated to any source code, or even any particular language. In that case, it would be better to just make an actual web application using front-end tools. I admit substituting Jupyter is probably fine for this, because it also passes my earlier claimed test: students can treat these types of notebooks as throwaway gists... the source code is wholly irrelevant, only the take away concepts they are visualizing or poking around with using some type of visualization widget.
I think the big lie about notebooks is that these two cases (teaching a software concept and teaching a non-software concept that needs interactive visualization) should for some reason go together.
But 99% of the time they would never make sense together, and it makes the notebook suffer from a problem like PowerPoint being all things to all people. The 1% of the time when it might make sense is if you are actually visualizing a computer science concept itself, like visualizing the steps of quicksort and you'd like the actual source code to be implemented right next to the visualization. But even for this, the visualization of the concept should rarely be tied to a single language implementation, and studying the language-specific implementation should rarely involve visualization.
A second advantage is that the students have a written record to study. This should help motivated students with the drive to learn the material. Without such a drive, nothing you do will make a difference.
A third benefit to this approach is the ability to add links to good explanations of difficult concepts in the notebook.
Really, the biggest thing for me is making sure the lecture is properly contextualized. I can get the big picture of the lecture but I never can really pay attention for the full thing, so I tend to learn best from reading the material from my own. My favorite courses have been where the professor gives a good intuition as to why the content matters and how it relates to the greater body of work for that reason. Details can happen on my own time.
When I later took my database class, it was a cake walk.
He was building a time tracking + project management tool. Easy enough business case for anyone to understand. Enough complexity to drive my learning.
All comments shown.
Couldn't load more comments. Check your connection and try again.