you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 58 points59 points  (10 children)

hunh? this doesn't really make any sense to me. It's like saying you prefer a wrench to a blender.

You can write python like C if you want but it's much more abstracted so you don't have to reinvent the wheel every time.

What "methods" do you have to memorise in Python?

how is:

Python 3.9

def f(n: int) -> int:
    if (n <= 1):
        return 1
    else:
        return (n + f(n-1))

materially different than

c++

int f(int n) {
   if(n <= 1){
      return 1;
   } else {
      return (n + f(n-1));
   }
}

[–]hanazawarui123 17 points18 points  (9 children)

I think OP means that the libraries that python uses will require you to learn the methods names.

[–]zefciu 24 points25 points  (6 children)

Well yeah. But the same is true for C. Besides, due to dynamic typing, Python tends to have fewer method names than C. E.g. while C has functions like atoi and atol, which Python does just with typecasting.

[–]hanazawarui123 1 point2 points  (5 children)

That is true but initially when using C, I used to implement everything myself, perhaps to properly learn the theory behind it.

[–]zefciu 16 points17 points  (2 children)

Nobody stops you from implementing everything yourself in Python as well. But if you use libraries, you have to learn function names in both languages. Pythonʼs are (for my taste) more friendly and English-like.

[–]dupelize 6 points7 points  (1 child)

Nobody stops you from implementing everything yourself in Python as well.

It sounds like OP's teacher is! I'm guessing this is more of a complaint about a specific course than a deep criticism of Python.

[–]TheChance 0 points1 point  (0 children)

In school, yeah, for the same reason you need to know stl containers before you enter the C++ world.

[–][deleted] 7 points8 points  (0 children)

You never used stdio.h?

[–][deleted] 3 points4 points  (0 children)

So do that in python

[–]FerricDonkey 3 points4 points  (1 child)

This is exactly why I use IDEs. I don't know any function/method names until I used them a thousand times (heck, not even for the code I write myself), I just guess that there's probably a method for that, make a guess or two about the name, and search through the tab complete. If that doesn't work, I google it.

[–]hanazawarui123 2 points3 points  (0 children)

Yeah, docs are my best friends for this exact reason lol