Live data from Hacker News

Show HN: Intro to Python and Programming for non-CS majors

github.com

51–56 of 56 posts

Re: Show HN: Intro to Python and Programming for non-CS majors

#51

What I never understand about intros like this (even intro courses in college), is why not start with types? Reading the content, it’s obvious there’s something different between a string and a number, and a list (or a dict) is obviously very different again. You quickly figure out that these things are also capable of doing completely different operations, but why? And what things (methods) are they capable of? I wa…

I introduce the idea of a type right in chapter 1 because of exactly the argument you make.

As Python is really more about the behavior of objects and not so much their type, I introduce these already from chapter 4 onward, for example, iterable vs. container, and many more. I actually would say that this is the essence of any dynamic language (duck typing).

"and how to read the python documentation" -> that is an important point you raise!!! I found that beginners have real trouble reading the docs because they are screening for words like "list" instead of "iterable". However, as I teach abstract behaviors early, they actually understand the docs.

"like using .format() instead of fStrings" -> I mention .format() but mainly use f-strings and tell the students right away that they are both faster and easier to read and that they should default to them.

Re: Show HN: Intro to Python and Programming for non-CS majors

#52

At this point, I feel like there are too many "Intro to Python" courses floating around. It will take a newbie, multiple hours of reading reviews and recommendations to find a course. There are many good ones out there. I wish there was more effort spent on creating intermediate courses. It would be great if there were more people trying to write books like this Nicolas Rougier is trying ( https://github.com/rougier/…

What would be contents you expect from an intermediate Python course?

Some example topics that took me a lot of reading from different sources to understand.

- how to write a python library that you can host for public/private use

- adding test coverage to data science python projects

- learning libraries like matplotlib, seaborn beyond what you see in tutorials

I think material for all fo this exists in different sources like documentation/stack over flow but either it's too detailed or too superfluous. The middle (intermediate) layer is often missing.

Re: Show HN: Intro to Python and Programming for non-CS majors

#53

Earlier quoted context omitted.

What would be contents you expect from an intermediate Python course?

Some example topics that took me a lot of reading from different sources to understand. - how to write a python library that you can host for public/private use - adding test coverage to data science python projects - learning libraries like matplotlib, seaborn beyond what you see in tutorials I think material for all fo this exists in different sources like documentation/stack over flow but either it's too detailed…

I get you.

The plotting tools I would actually consider in an "Intro to Data Science" course, not in an "Intro to Programming".

I started to write a library implementing Gilbert Strang's Linear Algebra book assuming nothing but core Python. What inspired me to do that was reading Philip N. Klein's book "Coding the Matrix". I thought writing a LA library for fun and study purposes makes sense if you want to go on and study data science. However, that project is not yet ready to be published. Would that be what you are looking for?

Re: Show HN: Intro to Python and Programming for non-CS majors

#54
post #37

Earlier quoted context omitted.

In the future we will likely have different tools to handle dependencies and environments. If these things aren't immediately useful, it might be worth teaching other stuff instead.

Let's hope poetry will become a standard. Opinionated, I know :)

Fourth time is a charm!

Re: Show HN: Intro to Python and Programming for non-CS majors

#55

Earlier quoted context omitted.

Some example topics that took me a lot of reading from different sources to understand. - how to write a python library that you can host for public/private use - adding test coverage to data science python projects - learning libraries like matplotlib, seaborn beyond what you see in tutorials I think material for all fo this exists in different sources like documentation/stack over flow but either it's too detailed…

I get you. The plotting tools I would actually consider in an "Intro to Data Science" course, not in an "Intro to Programming". I started to write a library implementing Gilbert Strang's Linear Algebra book assuming nothing but core Python. What inspired me to do that was reading Philip N. Klein's book "Coding the Matrix". I thought writing a LA library for fun and study purposes makes sense if you want to go on and…

I agree with you about the tools being in a data science course. What I'm pointing out is a lot of people have spent energy creating intro to programming courses but similar amount of effort has not been spent in creating intermediate courses that help people become proficient with the tools of data science. It's usually "intro" level content or library documentation.

I think writing code really helps you understand the algorithms in more depth so I'm all for exercises for LA like you suggest.

Re: Show HN: Intro to Python and Programming for non-CS majors

#56

Forgive me if I missed this, but I would highly recommend talking about virtual environments, pypi, and the existence of other things like pipenv. The environment/dependency management story for Python is such a tire fire and I wish someone introduced me to it from a reasonably high level at the very beginning of my time with Python. It doesn't have to dig deep. Just needs to talk about what these things are, why the…

Strongly recommend ignoring virtualenv, venv, and pipenv; and using Poetry instead. Poetry is simple and feature-complete where the others require you to learn all kinds of minutiae. http://python-poetry.org/

didn't know about this. Thank you for sharing. Looks really clean.
Post reply on HN