|
|
|
|
|
by msgodel
324 days ago
|
|
I think if you learned to program 20 years ago or more you're likely to be faster at C than Python unless you jumped on Python in the Python2 days or earlier. For me it's pretty hard to get in the flow with Python because I keep having to stop and read the documentation. I think this is just a personal thing but it's possible that Python may just be a significantly more complex language and that's driving some of it. I'm sure I'm not the only one like this. There was a string heavy app I wrote years ago and I had multiple false starts in Python and then one day I just said "this needs to get done" and plowed through it in C nearly one shot in a couple hours. I've experienced this kind of thing multiple times. It's a little hard to really communicate how this feels. EDIT: Yeah I think it really depends. I certainly do a lot of heavy numerical/ML stuff in Python just because that's where the libraries are (and IMO the libraries being written in python isn't a coincidence, it's a fantastic language for that.) It's not just "string handling algorithms" though. I've written an entire web browser in straight C and it was mostly just walking through standards and coding. Maybe some of it is familiarity but I think part of the lack of familiarity comes from C just not having complex built-in data structures. There's no hashmap in C. There are no iterators in C etc. There's a tiny standard library to become familiar with and that's about it. |
|
It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving.
I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is its ecosystem of useful abstractions (there’s an XKCD for that). And not having to worry about memory management or null pointers. How powerful exception handling is. Etc.
Python may in some ways be a more complex language, but I find it much simpler to reason about.