Vlek / vlek.github.io

Personal blog
2 stars 0 forks source link

Python to C# back to Python, What I learned #93

Open Vlek opened 4 months ago

Vlek commented 4 months ago

From first learning programming in python, then getting paid to do C#, and now revisiting Python again in my spare time, there are a few things that I have learned that I feel would be interesting to talk about.

  1. Duct typing is doing something magic that isn't really explained at the time. In programming 101, there is a handwaving moment where they talk about types and how one usually has to use specific types in specific scenarios, but, because of duct typing, the programmer can use anything in the same context (like as a parameter to a function) so long as it adheres to the contract (i.e., an interface) for how it is used within the given context. You can use the ABC library, but look at some Python code. Who actually does within the Python sphere?
  2. Project structure is important, and, in Python, it's not really defined for you.
  3. The tooling for Python is actually really good.
  4. Visual studios can be trash, so having so many options is great for Python.
  5. Are brackets really necessary? What about semicolons?
  6. Which would I use now if I was going to do a new project?
Vlek commented 2 months ago

It's hard to serialize python objects to get json.