DEV Community

loading...

Discussion on: What programming language should I learn next?

Collapse
jankapunkt profile image
Jan Küster Author

Python is actually very high on my list of candidates. Are there also things that annoy you when using Python? What about the indentation based syntax? Is this something I could tackle with a linter (if there is something like this for python)?

Collapse
hanpari profile image
Pavel Morava

It is simple.

You use Black to format your code.

You use MyPy to get optional static typing.

Linters may or may not be useful.

Collapse
ahferroin7 profile image
Austin S. Hemmelgarn

Yes, there are actually some pretty good linters for Python. The two most used are flake8 (mostly focused on coding style over anything else) and pylint (which covers coding style, but also covers a bunch of other things).

The off-sides syntax though is surprisingly easy to get used to because it tends very strongly to follow logically from where you would be indenting anyway in other languages. The only tricky part is remembering that you need to explicitly mark empty code blocks with pass and remembering that it is usually harder to read one-liners.

The big complaint for most people with Python is how the package management isn’t really designed in a way that makes handling of concurrent versions of the same thing sane. Essentially, packages default to being global unless you use a tool like venv (included in the Python 3.3 and newer standard library) to create an isolated environment, in contrast to how NPM defaults to all packages being local unless you tell it otherwise.

Collapse
darrencearnaigh profile image
Darren Kearney (he/him)

Most code editors will have support for Python indentation based syntax without any further configuration required. If your needs are greater then there is a rich ecosystem out there to cater for you as Python is one of the most popular programming languages in the world.

Most Python projects will follow the PEP-8 coding style. Python's seemingly restrictive syntax has a great benefit; It makes looking at other peoples code easier since everyone has to use the same whitespace rules. The PEP-8 style guide allows you to quickly understand the source code of most python projects by removing coding style as a barrier.

Link for official docs for PEP-8 standard (they are kinda dry, so I recommend a tutorial instead!) - python.org/dev/peps/pep-0008/

All good Python programming courses deliver course content in PEP-8 coding style so you will build muscle-memory for this as a matter of course. They likely note this in the course description.

Good luck in your learning!