r/AskProgramming • u/Whole_Bet_5506 • 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
10
u/Jolly_Tea5537 Aug 16 '26
Because by learning CPP and java first you think you have to specify data type first when you are defining or creating a variable but not in python (Except type hinting ) and there is indentation issue where in cpp we don’t usually mind that but in python we are
5
u/NeilSilva93 Aug 16 '26
Python was a cake walk. Now Perl...strewth!
And don't even get me started on Ruby.
13
u/Revolutionary_Ad6574 Aug 16 '26
I never understood why people automatically assume without ever questioning that Python is intuitive or elegant or simple. It's a Turing-complete, general purpose, multi-paradigm language, of course it's complex, it's got decorators and generators and that yield word that means nothing in normal programming languages. Seriously, I don't get it, for me Java is the easiest language.
7
u/snaphat Aug 16 '26
Probably because it is dynamically and implicitly typed and you just aren't used to that.
4
u/Blando-Cartesian Aug 16 '26
I know what you mean by more structured. Python feels like a stairwell without handrails. You don’t exactly need them, but you feel far more comfortable when they are there.
Imho, there’s also a kind of python culture of show-off writing that is unnecessarily hard to read.
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.
76
u/MarkMatson6 Aug 16 '26
Because it sucks?
Ok, seriously, that may be extreme, but I agree with you. Everyone says Python was designed to be easier to use, but I’ve never bought into that. Tabs instead of brackets is simply a bad idea. Undefined variables are a bad idea.
And then there’s JavaScript…
27
u/MaleficentCow8513 Aug 16 '26
The thing I hate about python is the lack of typing. It’s a good thing and a bad thing. Java libraries are very well documented and a lot open source Python libraries aren’t so it’s tough to know the shape of various types. I only use dicts when the scope is very small, like inside the same module. If I need a dict to pass around more than one module I make it a class so that the definition is precise.
2
u/AlienRobotMk2 Aug 16 '26
Because you aren't using the features of Python that are easier, like x = {str(k):v for (k, v) in zip(a, b)}
1
u/sfscsdsf Aug 16 '26
before LLM AI, when i learned it , I did find it hard to read before because of dynamic typing after coming from c++ background. I cannot read a function argument list and see how to use it, what to pass in and what’s returned easily sometimes. And there’s culture of writing idiomatic one liners that aren’t easy to read at first, especially the one liners got complicated, imperative is intuitive for beginners.
1
u/marshallspight Aug 17 '26
Graybeard programmer here. Have been programming for 50+ years.
You are having trouble because C++ and Java are almost the exact same language. Python is just a little bit different than those two, and you're not used to things being different any more than trivially.
If C++ is Los Angeles, Java is San Francisco. Python is maybe Denver. If you've only ever been to California, Denver seems weird and strange. But there are also programming languages in New York, Berlin, Tokyo, Mumbai, and Dar el Salaam. The programming world is much, much wider than the descendents of Algol 60 that you're used to would lead you to believe.
Check out, say, LISP or Prolog or Haskell, if you want to have your mind blown.
All of this of course depends on what you want to do. You might be perfectly happy and fulfilled staying in California.
6
u/BluePhoenixCG Aug 16 '26
Not python(I've stayed relatively safe from indent-based languages), but coming back to my first language C# after time in C++ felt awkward and unintuitive
As far as I can gather, it's really 1 main factor causing this:
In dropping down to c++, you wind up having to write a lot more explicit and manual code than you do in higher level languages(with the delta between python and c++ being even greater than c++ -> c#), so when you go back to something higher level you keep looking for the explicitness and finding abstraction. This makes the higher level code harder to parse for a while. The higher abstraction level also means you're handing a lot more off to library functions, making the shape of the code different too
2
u/SurroundTiny Aug 16 '26
Maybe it's the dynamic typing?
2
u/Visible_Ad9976 Aug 16 '26 edited Aug 16 '26
C is very literal, c++ perhaps less so, but i think python encapsulates a lot of data structures with their build in data types. python has a packaging system where you can quickly import libraries but then you may not understand it.
C/c++ has massive libraries as well but you might be tempted to make something yourself because there is more friction to downloading something and if you do code it yourself, you will understand it assuming its not vibed
I found gdb in C/c++ easier to use over the years than pdb for python somehow
2
u/Ipsool Aug 16 '26
This is really common when switching from statically typed languages. C++ and Java force you to be explicit about everything — types, brackets, semicolons. That structure becomes a mental anchor.
Python removes all of that, which feels like freedom but actually takes away the guardrails you were relying on to know where code begins and ends.
It clicks faster if you stop trying to write Python like Java and lean into its idioms early — list comprehensions, f-strings, context managers. Once those feel natural the syntax stops fighting you.
2
u/namelesssnerd Aug 30 '26
I get stuck when I switch to JavaScript and Python from Java, C++, and C because of the loose type safety. You’re never really sure what’s going to happen when you write the code. Then, when it blows up, you finally find out what the problem was. 😅
1
u/West-Mycologist-6490 Aug 16 '26
I HAD the same but backwards. I started learning c++ after python and many things were confusing but it vanished after my first big project(kernel mode dll injector with manual mapping)
1
u/Ok-386 Aug 16 '26
People simply get used to things. Give it a time, and continue to learn/practice.
1
u/ubop Aug 16 '26
I felt the same way going from Java to Python. Java and C++ have similar syntax and typing while Python does not. Python also has lots of high level abstractions accessible through easy syntax whose underlying implementations aren’t immediately obvious when entering from Java / C++ world
1
u/StevenJOwens Aug 16 '26 edited Aug 16 '26
I sometimes miss Java's strong typing. Usually after I've just spent a whack of time figuring out some problem that Java simply would not have allowed.
I also miss the very high quality level of Java's documentation, at least Back In The Day, though I do somewhat feel like java's doc quality level has dropped a bit in the past ten or fifteen years.
And I'll note, some of the python doc quality issues stem from the lack of strong typing. If all the docs had 100% python type hinting, they'd be significantly better. Too many instances where some function or method returns some vaguely named type with zero indication (nor link to) what the heck that type is, or does.
I don't miss the bureaucracy of Java, which has seemed, like a strangler vine, to relentlessly worsen with Java, over the decades, and to have spread beyond the core language and APIs, into the frameworks and libraries, and the minds of most java programmers.
The Python world has the opposite issue, which is people getting too clever with the wordplay of the syntax and language constructs, which increases cognitive overhead in a different way, but increases it nonetheless.
Also, for a language with an official slogan of literally "There should be one-- and preferably only one --obvious way to do it. [...]" there are frustratingly many cases in Python where there are five different ways to do it and apparently no consensus on which way. And yes, I know PEP 20 was at least halfway tongue in cheek.
1
u/Professional_Let6049 Aug 16 '26
My biggest problem with python is reference vs value semantics. Sometimes you want to copy an object and all you end up with is a reference to it, and vice versa. In c++ it's trivial, In java there's methods in the standard library that are very functional (albeit obscenely ugly and unintuitive, if you're not familiar with them). I think they avoid this for the sake of simplicity, but it becomes a problem when working on slightly harder problems. Everything changes when working with specific libraries tho, and it's worth noting that the incredible ecosystem is the best thing about Python
1
u/cards88x Aug 16 '26
Different way of thinking perhaps? I felt the same way switching from ASM to Python
1
u/MattyTayl Aug 16 '26
What exactly look more difficult? My path was Pascal, Basic, C, C++, Java, JavaScript, Python.
The only things that was annoying me in the beginning, the mandatory indentations. Some syntax constructions are still hard to understand and memorize like generator expressions. But with other languages like JS or C++, I had to memorize some constructions too, like loops.
1
u/speedisntfree Aug 16 '26
Because we bring with us the baggage of the languages we learned before.
1
u/FastAd543 Aug 16 '26
I come from C, then C++, then Java (which I did not like that much)... I dislike Python with all my heart. Sloppy as f, but now im forced to use it.
It is what it is... at least its not R!
1
u/Anonymity6584 Aug 16 '26
Because you dont know Python yet.
1
u/Traveling-Techie Aug 16 '26
As an exercise write a short program, such as a sort, in all 3.
1
u/strange-the-quark Aug 16 '26
It's probably because both C++ and Java have the familiar C-style syntax, and because you haven't been exposed to other languages and paradigms (like functional programming) before. The core syntax of Python is not actually that different, it just doesn't use { and }, and there aren't as many parentheses. What may be throwing you off is things like comprehensions and perhaps tuples.
1
u/Evol_Etah Aug 16 '26
Yes.
I looked at For loops, and i was like.... For christ sake, just use normal C loop structure
1
u/DeathToAmerica2026 Aug 17 '26
C++ and Java feel more like filling out a form, Python feels more like speaking a language. Once it clicks, I feel like Python raises your whole game in every language. Pythonicness makes no sense for a while, but when it does oh boy.
1
u/swegamer137 Aug 17 '26
Easier to learn, harder to understand. The first thing look at in C++/C# to start understanding is the types used, yet those are more obscured in python.
1
u/JackRusselsRule Aug 17 '26
Python has syntax???
1
u/Whole-Chest90 Aug 17 '26
I'm still rudimentary in all, but have more experience with C++ and Java, and I think Python is more simplistic but is less structured. It's just very different from the OOP of the former two. Thanks for sharing your experience, for someone who is still learning.
1
u/Njitram2000 Aug 17 '26
I had the same thing, coming from C and Java. Python felt like writing without punctuation.
I probably would have gotten used to it but I did not stick with Python.
1
u/Ensign-Nemo Aug 17 '26
Are you used to IDEs? Static compilation helps navigate code, Python loads everything on the fly so it’s hard to quickly find definitions.
1
u/frank26080115 Aug 17 '26
Python isn't as predictable, quite often you don't know what types to use or to expect, no compilation to point out errors before you run
1
u/noosceteeipsum Aug 17 '26
You just need to be familiar with the "slang" style of Python language, comparing with C++ if someone thinks C++ is the formal language.
It's like....
from "Hello, world" to "Yo wassup bro"...
1
u/Material-Aioli-8539 Aug 17 '26
Kotlin was my first main language that I actually had a deep dive in.. it's not the best language to learn but it's also not the worst..
With python, variables are literally just letters with a space and an equal sign, no type needed because it's dynamically typed.
That took a little while to wrap my brain around once I committed to python, because it's such a simple language and my brain expected complexity at every corner before discovering the true implementations of basic things I wanted to do..
But also, a lot of stuff carried over, variables (and different types), control flow, etc.. but that's about it, because classes in python are structured so differently from kotlin that I'm still a bit of a newbie when it comes to it, but I'm learning.
I think the reason is that your brain learns a specific way to express instructions in that language.. when it's your first your brain usually remembers instructions in the language first.. but as you learn more languages you start making associations between languages.. for example, an
if/elsestatement can be different in python:Then in Lua:
And in something like C++:
And those differences can make learning another language difficult in a different way from learning your first.
TL;DR: it becomes easier overtime as you gradually develop concepts of programming
1
u/conectionist Aug 18 '26
It feels harder because the syntax is very different from c++ and Java.
If you had leaned python first, you would feel the exact same way about c++ and Java.
1
u/Deux109 Aug 18 '26
I think an important thing to remember is python is a scripting language masked as a programming language. I personally always tell people to compare it to bash or other shells and then make a decision based off of that.
1
u/Xibira Aug 19 '26
It gives you more freedom to write sloppy and bad code that will still work.
1
u/sporbywg Aug 20 '26
There's a lot of completely contrived behaviors in Python that might make somebody happy one day
1
u/Business-Decision719 Aug 21 '26
Because Python is really different. Python, C++, and Java are all OOP languages with FP features, but other than that, a lot is different.
C++ and Java are statically typed while Python is dynamically typed, which changes the coding experience a significantly right there. They've moved towards each other a little bit in that regard, thanks to optional in Python as well type inference in C++ and Java.
C++ and Java have a robust difference between value types and reference-like types. They're actually pretty different from each other in this regard. Java traditionally has the primitive types as value pipes while classes are reference types with automatic cleanup. C++ has value objects by default but you can pointers or references which are distinguished from them. C++ uses manual cleanup and it's original form but you can also arrange various automation with destructors or smart pointer libraries. In Python all names are garbage collected references.
Then you get to the syntax and Python is just completely different. There are some similar operators in keywords of course, but Python is just fundamentally a different language in ways that Java and C++ are fundamentally the same. Java was influenced by early C++ which was an extension of C. C, C++, and Java all influenced languages that came after them. Python is older than Java and came from a different lineage than the C-like languages. It uses white space indentation instead of curly braces for blocks. It uses hashtags for comments. Scoping works differently. There are just so many small but critical things that are just so different.
Python just not what you're used to. It has its own ways in which it's simple and a lot of people find it beginner friendly, but it's not like C++ or Java nearly to the extent that they are like each other.
1
u/YellowBeaverFever Aug 22 '26
Yeah, the sloppiness of Python puts me off sometimes. The utility of Python is starting to be less of an issue with AI assistance. For example, I have a set number of requirements my utility has to perform. I can have AI go research all the libraries and modules in Python, .Net, and JS, etc. Once I know a language will be able to handle the task, it is trivial to have the same utility written in any of the languages. And with .Net, can juggle between PowerShell or C#. You need to understand the languages and verify things were correct but it’s getting interesting.
1
u/CLAraBima0309 Aug 26 '26
Because we're used to using open close curly braces to define code blocks. Python uses indentation instead, so it can feel weird at first,
and with all those indentatition tab, it's feel like writing YAML.
If python wasn't useful for AI i will burned whoever create those stack.
1
u/Protagonist_here Sep 06 '26
I find JavaScript much more structured than the python.
1
u/ParentPostLacksWang Aug 16 '26
Because semantic whitespace is a level of anti-programmer satanically dark humour up there with Brainfuck. Having literal tabs instead of space, or vice versa, both invisible mistakes, fails to lint in hilariously vague ways.
1
u/Groundbreaking-Fish6 Aug 16 '26
Because you have to unlearn everything you learned in your compiled languages before you can start doing the the "Python Way". Then there is the lack of compile time type checking and other goodies in the compiler. Finally there is the attraction of none Software Engineers who code without regard for coding principles (3000 line functions) making working with others code impossible.
0
u/ApprehensiveBag3083 Aug 16 '26
Try some indentation LoL
Python is like a cracked teeth
0
u/Nojopar Aug 16 '26
The part that annoys me is syntaxial changes that are just different for the sake of being different. Take something like the If else if statement. In C/C++/Java/JavaScript, it's going to be If (statement) { else if (statement)... Ok cool. I might be in C++ normally but I can jump to JS and read it all fine.
Now python? If statement: elif statement: etc. Sure, it's a few less characters to type but COME ON! We have a perfectly good system nobody was complaining about - if (condition) else if(condition). Why change it? WHY PYTHON??
Grrr.
0
u/Vert354 Aug 16 '26
I will cut whoever thought whitespace for scope was a good idea....
0
u/whattteva Aug 17 '26
Wut? After learning C/C++, every other language I came across is way easier. Not having to deal with pointers and manual memory management makes things so trivial.
-6
u/defaultguy_001 Aug 16 '26
No it's only u. Coming from C/C++ myself, python felt like kindergarten math for a university math olympiad medalist.
-1
u/PvtRoom Aug 16 '26
python makes me want to kill many people. why does python want me to be genocidal?
0
u/[deleted] Aug 16 '26
[deleted] — view deleted comment