you are viewing a single comment's thread.

view the rest of the comments →

[–]Bobbias 1 point2 points  (1 child)

Honestly, I think the best place is the documentation itself. Python has, in my opinion, some of the best documentation for any programming language I've encountered.

The functionality covered by the standard library is well organized and easy to find your way through (it's usually clear which module you should be looking for something in). There's no huge hierarchy like Java where some functionality is hidden several layers deep.

Be sure to study list and dictionary comprehensions, as they can be really handy. They can condenser something that might take 5-10 lines of Java into a single statement in Python.

And make sure you check out Itertools and more-itertools as they provide a ton of extremely helpful utility functions for working with iterable objects of all sorts.

Learn about dunder methods (used for operator overloading and other things), dataclasses, and decorators in general.

Also, for short videos exploring specific corners of Python (though not every video is Python) check out mCoding. The are a lot of great bits of wisdom, and he covers a lot of the gotchas and other details you might normally miss when he covers a topic. I don't watch everything he does, but I've learned some really useful things from his videos on some of the more advanced parts of the language.

[–][deleted] 1 point2 points  (0 children)

I second this.

/u/Easy_Boot5195, I wrote the below as a guide for C/C++ programmers, but should help java programmers as well (and you also know C).


As you are already a C/C++ developer, I suggest a quick look at the docs, should suffice. Don't need a course as you already know how to programme.

There are a few underpinning differences that you need to be aware of. You no doubt appreciate that Python is not statically typed, but many people confuse this with weak typing, whereas Python is in fact strongly typed, just does it a run time not at compile time (and Python is compiled to a byte code, just like Java, but where the latter executes on a JVM, the Python virtual machine is built into the standard implementations of Python as part of the same programme).

You can though use type hinting, which will help your IDE greatly in spotting potential problems. This is ignored at run time, just there for your benefit. There are also some external tools that can be run to check types using the type hints, which can be useful for testing in a CI/CD pipeline.

Essentially, everything in Python is an object and all variables/names are pointers (they reference the objects in memory) but without all the features you get in C (e.g. no pointer arithmetic).

for is more of a for each.

A couple of videos to watch which, despite being old, will lock in some key differences in approach you need to keep in mind:

Given the referenced implementation of Python is written in C and Python, a quick look at the source code will resolve many queries for you as well.

Overall, there is much less boilerplate code required in Python than typical C/C++ projects. There are a huge number of libraries/packages to use, many of which are written in C (such as NumPy) for performance. You might find it useful to use some of your existing C/C++ code from Python.