Cover image for A python journey. Episode 2

A python journey. Episode 2

ochaye3000 profile image ed ・4 min read

I'm aware that coming from a programming background I will be attacking a new language different from someone who has never programmed before and as I'm no pedagogical expert I would, therefore, leave introductory texts and strategies to those far better qualified than me to do so.

What I'm trying to convey here is how I usually look at a new language is to take common reference points and see if/how they apply to this new language. ...then spend some time learning its jazzhands features. Many people spend a lot of time and effort trying to memorize ridiculous amounts of syntax, this might be helpful in a technical interview where you're not allowed the internet, or for the dreaded whiteboard exercise. How useful they are is a debate for another day...

Most languages can be broken down to:

  • how do you declare things?
  • how do you loop and iterate?
  • How do you create reusable blocks and functions?
  • how do you express things idiomatically in this language?
  • what are the tooling/linting/formatting options?
  • is it static or dynamic typed?
  • what's its primary use?
  • is this for jobs, or for fun?
  • what's a realistic build project that will cover the additional features / specific reason for learning?

Now for myself, I find I'm answering these questions in reverse order? Why because looping is looping, syntax rules are something people fall foul of and rely on a linter/compiler to tell you what's garbage until you've burned it in to memory.

What's a realistic build project? Python web projects? Flask or Django API? ML so a statistics course followed by SciKit-Learn or PyTorch projects? Some Data engineering/analysis with copious amounts of pandas? See where this is going? learning a new language is realistically just a gateway to using new toolsets with an understanding of what it going on underneath over some monkey-see, monkey-do code along exercises with YouTube or Udemy. The caveat being welding a metal suit and a sassy talking companion called Jarvis might not be a good first project. Aim for achievable first then aim to go up a weight division.

Why am I learning Python over Rust, Go or C#? I believe the naturally expressive syntax of python is the way that next-gen computer languages will go. Terse languages are powerful, that can't be disputed but the adoption of python to most corners of the technology industry and beyond is impressive for a relatively slow, dynamic typed language.

What's its primary use? Well, that's almost impossible to answer because it has become an option (and a viable one) in most domains bar a few requiring low-level languages that it's main competitors would also be inapplicable for. All things to all people or also-ran that gets superseded in most areas is a debate for another day.

What are the tooling, linting and formatting options like? It starts to get to be a bit of a mixed bag here.

  • Anaconda Vs pip/virtualenv
  • autopep8 vs Black pylint and so on - it all starts getting a bit messier there.
The data science brigade

Most of the data science crew and the subsequent tutorials are using Anaconda and that will take care of dependency issues for you albeit a sizeable install for a lot of tools you wont need (miniconda might be better here).

The web developer brigade

Start on some web/flask examples and you'll see a lot of them are more 'developer' types so a lot of environment definition and self-management. You'll occasionally find discrepancies between options. Example Flask-JWT, OK largely it's been abandoned because it's been superseded by flask-jwt-extended but you'll find loads of tutorials using the older package and for a newbie to run into an error on the same library version between conda and venv is quite choppy waters to hit the beginner with. Is "well this works OK with a different package manager." an OK answer? Probably not to someone where everything is new.

That's the one emerging criticism. The zen of python advocates for clarity - clarity typically comes with a 'one-way' of doing most things and yet it falls down at how you even install the software. Now that the community has finally moved on from version 2 the chance is there for the internet to slowly clean up in references of how to resolve issues.

In summary, after a few hours what have, I learned?

  • using typical camelCase as is universal in the javascript world will kill you in code review, or technical tests. Don't do it. However, snake case is fussy, but not a deal-breaker.
  • Looping using a range is quite nice to have the implicit iterator instead of using the compound for (initialise; resolve condition; increment/decrement) syntax ubiquitous in other languages that haven't ported all their code to Map/FP styles as yet.
  • The expressiveness is quite lovely. numbers = list(range(1000)) is simple and fabulous so the learning curve is to be admired.
  • List comprehensions and comprehensions, in general, are fabulous.
  • writing lambda instead of => feels a little bit weird.


Am I likely to stick with python for a while? Yes, I'd like to. I'd like to build a web product that deployed an ML model as a way of moving beyond the trivial projects found everywhere. The scripting potential for DevOps is strong too. Ultimately it's a language I think I could teach my kids how to make first programming steps in and perhaps that's one benefit that is underestimated.

Posted on by:

ochaye3000 profile



Reformed javascripter who plays with python.


markdown guide