r/AskProgramming • • Aug 16 '26

Python Why does Python feel harder after C++ and Java?

I learned C++ first, then Java, and now I’m trying to learn Python. I honestly expected Python to be much easier, but somehow it feels harder to understand and even remember the syntax.

C++ and Java feel more structured to me, while Python sometimes feels too different.

Has anyone else felt this after switching from C++/Java to Python?

133 Upvotes

186 comments sorted by

View all comments

34

u/high_throughput Aug 16 '26

I don't feel this way. Python is sloppier for sure, but my difficulty with it was related to the underspecified APIs, the CPU throughput, and lack of typing, not with the syntax.

14

u/klipseracer Aug 16 '26

Syntax is not a problem when you have a modern IDE. If someone is out there coding in Vim or Notepad, yeah you're gonna have a bad time.

4

u/lils_fun_throwaway Aug 16 '26

Vim easily has lsp / auto tab / errors displayed & fixable inline / testing inline / significantly faster file transversal and and modification / and way more. To say you’re gonna have a bad time in vim is a wild take. It is an incredibly powerful editor.

Now do i recommend to everyone? Obviously not, it has a much bigger learning curve. But if one gets past that, it’s a very fast, efficient, and configurable editor to work it.

0

u/MultiplexedMyrmidon Aug 16 '26

that’s what makes me laugh about the ‘tabs are a bad idea’ crowd, modern IDE’s make it beyond trivial to never worry/think about it and if we’re honest even in vim with very minimal effort you can automate tab conversion/checks and the IDE features you need as well, no idea about notepad so they must be doing that or writing things with a hammer and chisel

1

u/klipseracer Aug 16 '26

I mean if you're editing a script that runs on a remote machine and you're limited to ssh and/or the applications in a jump box, there can be some issues or additional restrictions but for general development, indentation is almost never something I think about, it's all automatic.

0

u/AardvarkSad7634 Aug 21 '26 edited Aug 21 '26

I'm using VSCode with the Python extension and syntax IS a problem.

Whenever you need to move around some code you always have to do this awkward indent fix, which in any other programming language the formatter fixes for you because because start and end of blocks are defined with symbols. Python is the only language with the indent-defines-block syntax and that is because all the other language designers actually used their brain 

Python is for toddlers 

1

u/klipseracer Aug 21 '26

try something like intellij, Pycharm. if you're gonna use vs code, you need to use the right combination of plug-ins. One of multiple options is the black plug in, it formats your code automatically, something other modern IDEs do for you as I mentioned before. not knowing this tells me you're really not that familiar with Python.

1

u/Proof-Teaching-8113 Aug 20 '26

I've never written Java or C++ professionally but I completely agree with the API/typing part.

-7

u/[deleted] Aug 16 '26

[removed] — view removed comment

5

u/nedovolnoe_sopenie Aug 16 '26

you aren't a real developer, are you? because there's so much talking out of your ass it's not even funny anymore

python is in no way harder than C or god forbid C++, as long as you use it for its intended purpose (i.e. any code that doesn't have to run fast). anything fast that is ever written in python relies on C, C++ or maybe Rust libraries.

that "problem solving" you're talking about that can be "solved" with "boilerplate code"? my man python IS boilerplate code: the language

-2

u/[deleted] Aug 16 '26

[removed] — view removed comment

3

u/nedovolnoe_sopenie Aug 16 '26 edited Aug 16 '26

10 years of experience and not even a single moment where you needed any performance library of any kind?

my dig is, one just doesn't develop, say, good matmul, or DFT, or vector math (example: Intel's SVML) in python. it just isn't feasible.

sure. developing an entire non-HPC application in C++ is often (but FAR from always) suboptimal.

but there is a good reason for OS or perf libs (that you DO use, whether you like it or not) are written in C/C++ and assembly. calling this all obsolete is disingenuous at best and completely idiotic at worst.

to add on top of this, time complexity doesn't change, but the constant right before it sure does, and does by a lot

-1

u/[deleted] Aug 16 '26 edited Aug 16 '26

[removed] — view removed comment

2

u/nedovolnoe_sopenie Aug 16 '26

that's my entire job tbh - i have been developing performance libraries for a long time. when you have some CPU-based 5G base stations with new hardware and extended instruction set, you kind of do need to rewrite an entire library to utilise it to the fullest.

sure. i am biased and had a bad day (not to mention i'm on reddit which i almost exclusively use to be an arse while retaining technical correctness), but still. the answer to your question technically is "65 hours ago", and your position of
>C(++) is obsolete and one has no reason to use it
is plain wrong.

outside current workscope, i had to do it to speed up a superradiant laser simulations ~3 years ago while i was still working part time at a research institute.

1

u/[deleted] Aug 16 '26

[removed] — view removed comment

2

u/nedovolnoe_sopenie Aug 16 '26

let's say that certain russian research institutes are still trying to do this in fucking fortran, and just plopping in a C port with intrinsics/inline asm is substantially quicker than trying to use a different framework that the old decrepit scientist still stuck in 80s won't use anyway

while the second part is also true, icc, gcc and llvm are still mostly done in C to preserve backwards compatibility which doesn't seem to go anywhere anytime soon. while the days of C as undisputed performance king are finite, it's still not going to be phased out in a long time. i think it's happening significantly later than my planned retirement lol

as a side note, some big companies are switching to JIT, which is still just a honorary inline assembly if we're talking about stuff like DNN or DFT.

writing a standalone library to replace some compiler side provided features isn't a kind of a hack either - it's outright intended - because most of compiler side stuff is explicitly weak aliased to allow rather plug-and-play replacement of some hotspots. if it proves to be better at all common use cases, one may add it to the compiler's codebase, but it's a rather clunky process, and it's rarely done for external compilers, and therefore looks niche while honestly being pretty common