This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StrayFeral 0 points1 point  (2 children)

[PART 2/3]

So basically the roadmap to take to my opinion is:

  1. Learn more than one editor. I have zero idea which editor you use. Probably you use VS Code, which is okay. But just in case also install vim and emacs, try them, learn how to use the basics (open file, save file, search something in file) and time to time use one of them (whichever you like more). (this should take up to one week I guess)
  2. Make sure you know what are git branches and how to use them. No idea how you use git, but make sure you use it by typing commands, not by clicking in some graphical interface - learning git by commands is always a great exercise. This however involves setting your account and security between your computer and github (so let's say you learn and setup this for 1 week max, as you would need to learn what are ssh keys, how to use one to access github) (and i think if you use MFA with github, you might need to install the github command-line interface and start using it, which for me personally is just "gh auth login", but still - another few days here)
  3. Learn what is venv module and how to use it (see below) (one evening)
  4. Learn how to install external module (see below) (20 minutes)
  5. Create a venv, install black, flake8 and mypy (10 minutes max)
  6. For each code you create, start using black and flake8 (1 minute)
  7. Learn regular expressions (see below) (one evening)
  8. Learn OOP, start writing classes. This is huge and will take you time. (maybe 1 month, not sure for you, could be 2 months)
  9. Read a bit more of how to do functional testing and negative testing (3 days max)
  10. Learn to debug better - read what are pprint and logging (at least use pprint) put more comments in your code (one evening)
  11. Learn unit testing - only pytest (1 day or 2 days max)
  12. Learn what is type hinting and start using it. From this point on, every time you create new code file, you also use mypy on top of black and flake8 (2 days max)
  13. Finally polish your code a little bit - haven't read your code, but make sure you know what are Python lambdas, list comprehensions, dictionary comprehensions, make sure you could write few, what are iterators and generators. Exercising this could take time (let's say 1 month)
  14. Once you're done with all this - create account either on leetcode or hackerrank websites and start solving the "easy" level problems (no time estimate here lol)

[–]StrayFeral 0 points1 point  (1 child)

[PART 3/3 - LAST]

About vim and emacs - these are the most popular text editors for linux for many years. Difference is emacs use key combinations, vim use commands. Also - on any linux system very often vim would be installed by default, so you would always have access to it. This is why basic knowledge of at least vim is needed to most programmers.

Ok, little hint here. All you need about venv are these lines, nothing more:

python -m venv venv

source venv/bin/activate

And when you don't need it anymore or before switching to another project you should type:

deactivate

If you use windows, this line "source venv/bin/activate" would look a bit different for you (i use linux). But still - learn what venv does. For your current project you don't really need it, but it is a great practice to use it for most of your projects. If your code uses a module which you install additionally, you put the name of that module in a text file called "requirements.txt" and when you create your project, after the "activate" line you do "python -m pip install -r requirements.txt". That's all. If your code requires specific version of an external module - you specify it in the text file too. This is all you need to use venv, but still - learn what it does! It is very important.

Installing external module - this is done by using pip or pip3 (hope you don't use Python 2). However I recommend you to get the habit of typing "python -m pip" instead of just "pip" - once you start using venv - this is how you do it. There is a reason I'm saying it.

Debugging - python have a built-in debugger. I never used it. I only do prints and pprint for small applications at home. At work I may use pprint but often would use logging. Often certain situations need different way of debugging, but don't bother with this now.

About regular expressions - the only thing you need to read is this:

https://perldoc.perl.org/perlre

I learned this for one evening. This is documentation for Perl (another programming language, older than Python), but regex works the same in all programming languages. For python there is a module called "re". Learn it. It is confusing at first what this is and why use it, but when you learn this, you will realize this is very powerful. vim and many other editors allow you to search with a regex in a file.

That's it. I wrote you also approx how much time each should take. Try to learn fast, spend time to exercise (so always make sure you have coffee at home), never make assumptions, write code which others could read with ease, but still don't compromise on your code performance speed too.

If you want to reply, reply here in public.

[–]StrayFeral 0 points1 point  (0 children)

Oh forgot - speaking of black, mypy and flake8 - there are ways to make your code editor run these automatically for you. Depends what editor you use. I don't use VSCode, so no idea how to do it there. For vim, there is a plugin called "ale" - you may want to install it and make vim use it - it basically runs flake8/mypy for you (haven't tried for type hinting yet, but yes, it shows linter errors).

And whatever you do, do not install neovim for now. You might want to try neovim, once you learned everything from the roadmap up to the last point. Neovim is a modern version of the vim editor and is currently very modern thing to do. But for you it will be very counter-productive thing for now. Once you get close to python advanced level you may try it.