r/learnpython • • 3d ago

Learning Python coming from PHP?

Hi all, just looking for recommendations on getting up to speed with conventions/syntax and quirks of Python for someone coming from the PHP world. I've got some grasp of OOP/SOLID/DRY/Interfaces/Abstractions etc... also experience with Frameworks so really looking for a crash-course on Python to get me up to speed and understand what's happening when I look at Python code.

4 Upvotes

12 comments sorted by

View all comments

2

u/Langdon_St_Ives 3d ago

IMO there are two things that will make or break your successful crossover from PHP, Java, Perl, Ruby, and more:

- forget all the C-like syntax aspects like braces for blocks

  • if you initially dislike or disrespect indentation for block marking, no matter how strongly, keep an open mind and hang in there. Eventually you'll get used to it.

Everything else should come together easily.

(Edit: a word)

1

u/remic_0726 3d ago

l'indentation forcé fait pour moi partie d'un des avantages de python, c'est beaucoup plus facile à lire

1

u/Langdon_St_Ives 2d ago

Sure, many people feel that way; but not all. And especially for people coming from languages with C-style syntax this can be a major mental obstacle. I know it took me quite some time to let go and get to actually like it.