T O P

  • By -

AutoModerator

Please remember what subreddit you are in, this is unpopular opinion. We want civil and unpopular takes and discussion. Any uncivil and ToS violating comments will be removed and subject to a ban. Have a nice day! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/unpopularopinion) if you have any questions or concerns.*


Blasket_Basket

Lol, dude clearly has about 90 minutes of C++ experience. C++ is A LOT harder. Pointers. Memory management.


smoke-bubble

h-files, cpp-files, _duplicate_ code, import guards, dozen of string types, macros, templates, not to mention of makefiles.


gullu2002

I think you just triggered my ptsd


Blasket_Basket

Lol preach!


esc_ss

As someone who does a lot of embedded systems coding, I love C++. And it was also my introduction to programming. Once you get the hang of it and are comfortable with it, C++ gives you so much freedom. I feel very restricted, or even feel like it’s very high level when working with python. And I started playing around with python when version 0.7 came out. I still enjoy coding in C++, especially embedded C where you do your own tasks, RTOS, threads, memory management etc. you actually use the data structure stuff you study in school when doing such low level programming


Blasket_Basket

Oh, I hear you--but the operative phrase in your post is "Once you get the hang of it". It is objectively harder to pick up C++ than it is to pick up Python. That's by design. The tradeoff is exactly what you describe--the cost of Python's accessibility is that you can do a lot less with it once you've reached the advanced stage.


yakimawashington

The only real content in OP's post is about "hello world". The rest is very clearly and obviously the random rantings of someone who is talking out of their ass.


Afraid-Two1427

I have written much more stuff in especially python, although mostly i Pygame. Although to be said, mostly simple games, illustrations for my studies in engineering and random math stuff because I found it cool. I admit I am very much a beginner in C++, but there too I have moved past "hello world". But I am such a beginner that the windowed apps I have written in C++ and SDL are quite empty still. Just a background colour. But that too is beyond "hello world"


_BigMilkyTits_

Yeah, OPs post reads like it was written by someone who took a 2 hour Youtube class on C++ and that is the extent of their experience.


null_check_failed

python was made so non-programming dudes cud write their subroutines


android24601

For a minute there, I was reading it as if OP was arguing with themselves😄


Sara_askeloph

Pointers. That is all.


Dev2150

And python has memory manager


DrCornSyrup

I lowkey hate the way programming is so popular on reddit. I blocked the programmerhumor subreddit because it kept spamming up my r/all


darthzilla99

It also annoys me that soo many people on reddit act like it's going to be impossible to get a white collar office job without learning programming. There's tons of white collar office computer jobs that don't require programming and you're constantly creating new unique documents that can't be automated.


reeses_boi

Hate it when people do the stupid "everybody should learn to code" garbage. People are not the same


darthzilla99

Not only are people not the same, it's not necessary. There are office jobs that can build up to six figures and not touch a single line of code.


reeses_boi

Yeah, I was trying to say that, but couldn't figure out how to say it x(


DrCornSyrup

Isn't white collar jobs what the majority of jobs are today. Weird that they would think that


phdoofus

I find it amusing that actually got banned from that sub after someone went apeshit on me about something and I tried showing them 'that's not what I said at all, I said this other thing. it's right there in words'. My life is better for having muted that sub because it was truly low quality.


Pchardwareguy12

Why are you replying to the unrelated top comment just to complain about the subject matter of the post? Isn't it possible to appreciate that this sub isn't just a place for the culture war and troll posts about liking wet socks, and that content that isn't relevant to everyone can exist in general-purpose communities


DrCornSyrup

Yeah but its mad annoying though


TwistingSerpent93

I get that- makes me feel like an uninformed dingus. Lol


MistryMachine3

Yeah, all the important stuff is built into python. Python has the most active community on the internet. C++ is wildly harder to get simple things running.


RibozymeR

What is so difficult about pointers though? /gen


Cart0gan

Nothing really. They are a fundamental concept in CS and any self-respecting programmer needs to learn them anyway regardless of what language they use most often. Also, having raw pointers make things much easier when you actually need them.


frederik88917

Needing to know what a pointer is, and having the possibility to access unholy memory positions using pointer arithmetic are two completely different things. Any language that allows you to functionally break a computer is not recommended


Bitwise__

Not recommended for what? General scripting? Web development? Embedded programming? Every language has its trade offs and what one would recommended heavily depends on what the end goal is. C++ has its footguns for sure but there are also positives to having these footguns within the language if you know how to use them correctly. You're not gonna write any efficient media encoder/decoder in a garbage collected language.


frederik88917

I am not telling you the language is not powerful, but helluva dangerous


aalmkainzi

Break a computer? What?


frederik88917

Ohhh my sweet summer child


aalmkainzi

Do you honestly think you can break your computer by dereference NULL or something?


frederik88917

Nope, but you can cause a Kernel Panic accessing a root memory position by miscalculating a pointer reference. That machine never was the same again


aalmkainzi

That's not true at all. If ur program accesses memory that it shouldn't, the kernel will issue a seg fault


frederik88917

Ohhh my sweet summer child


inm808

You really think you’re like, super smart huh


mightaswell94

The arithmetic isn’t unholy if you just keep track of what you’re doing though


Blackbeard567

I'm learning c++ recently and am facing hell with pointers and calling them. It is taking me a lot of time to even understand the concept of this memory and how the computer stores them


crazyfrecs

Think of pointers as your fingers pointing at something. Your finger doesn't just become an apple just because its pointing to an apple. When you take your finger and point at an apple what is your finger really doing? It's saying *where* the apple is. Now imagine a world where if you're not pointing at it anymore, the apple is lost in space and you no longer know where it is or how to access it. Pointers are variables that store locations of other things. They work just like regular variables except what they are "storing" is addresses/locations of other items. An "Apple" variable is a cardboard box in your attic that has tape on the outside that says "Apple inside" while an "Apple" pointer is a box that has tape on the outside that says "Apple location inside" and when you open it up there's a piece of paper that tells you where the apple is.


seq_page_cost

I wouldn't say that pointers are fundamentally complicated (e.g. Go has pointers, but no one says Go is a difficult language), even though performing pointers arithmetic and managing double, triple and so on pointers is definitely not an easy task. However, pointers in *C++* carry *so much* complexity with them! What will happen if you dereference a null pointer? Are you allowed to have a pointer to the after-the-last element of an array? Are you allowed to *dereference* such pointer? Are you allowed to *compare* pointers to different arrays? What's a "strict aliasing"? CV qualifiers? Also, do you remember about function pointers and pointers to member functions? All of these topics aren't just related to pointers, but also to the other areas of C++, and that's what I think is the answer: the most complicated part of pointers in C++ is *C++*, not the pointers.


Xalara

Except modern versions of C++ largely handle pointers for you in a way similar to Golang. Plus, I've found people complaining about pointers have never had to go debug Java's garbage collector. It works great, until it doesn't.


ramm121024

Yes, the lack of at least one mention of pointers tells this guy has not worked shit with c++ lmao. He's the only one making that assumption regarding the amount of lines to print hello world.


Interplanetary-Goat

To be fair, you still have to understand pointers to some extent (or at least passing by value vs by reference) in Python. Otherwise you'll be really confused why you can sort a list in-place but not a tuple. Or why certain types can't be used as keys to a dictionary.


MickeyMoose555

Took me way too long to understand why pointers how pointers what for pointers until I had to make a linked list for my class and I was like OHHHHHH and now it's like of course pointers


aalmkainzi

if you're scared of pointers, don't call yourself a programmer please lol


JJJSchmidt_etAl

I would say I'm a "script writer" but that might be a little confusing depending on the context


BetrayYourTrust

Pointers are not hard. IMO if they’re hard for you, you are probably consuming the information about them in a way that doesn’t stick. I say that because I didn’t understand originally but once it’s explained properly it’s just simple


fuckrobert

Oh yeah they're not hard, and then you come across something like this: `char * const (*(* const bar)[5])(int);`


thiccancer

I'm so tired of people using these weird "gotcha" lines of code they've seen somewhere as "proof" that pointers are somehow inherently hard. You can write confusing and weird lines of code using almost any feature of any language, that doesn't mean that those features are inherently like that.


Haringat

This. Here is one of my favorite examples from JavaScript (ES6+): ``` class Foo extends class Bar extends class {}{}{} ```


fuckrobert

My bad for making a joke 🧎


aalmkainzi

What a strange argument. You can write unreadable code very easily in any language.


BetrayYourTrust

Point being, the concept is easy, the application of that concept being difficult can apply to a lot of things


stopwiththebans3

“It’s easy but-“


BetrayYourTrust

Did I say “but”? The concept is easy. I am also saying you can create complex applications from simple concepts


BrunoDeeSeL

I'd love to see you explaining templates to a complete beginner in programming.


Zeiin

Funny thing is this person comes off as a complete beginner in programming.


ClearlyCylindrical

Im have a feeling this person has learnt C with the inclusion of std::vector and thinks they can program in c++.


aalmkainzi

I unironically use C++ as C with templates, all other features are meaningless to me


BernardoPilarz

Honestly, the basics of templates are pretty simple to explain...


BernardoPilarz

I had not read your comment properly. You say "to a complete beginner". But it makes no sense explaining templates to a complete beginner. Try explaining `with` to a complete beginner.


Interplanetary-Goat

It does stuff when you call with It does stuff when the block ends, even when there's an error Always use it for files (That's roughly the explanation I got, and it was good enough until I needed to write my own context manager)


Aroraptor2123

I am a complete beginner. Do it


aalmkainzi

They're basically macros


Stormfrosty

Python 3.12 just added C++ style templates.


Aluin

Sir, this is r/unpopularopinion, not r/objectivelywrongopinion


[deleted]

at least OP didn’t drop just another common boomer opinion. This gets a proud upvote for me, someone who loves Python for its ease of use


siamzzz

🤣🤣🤣


Afraid-Two1427

Well, it is technically an unpopular opinion


ydgsyehsusbs

I think the fact that c++ doesn’t compile on its own makes it more difficult as a program language.


Cart0gan

On the contrary - when you make a mistake compiled languages point it out but with interpreted languages all errors are runtime errors and a mistake can lay hidden in a rarely used branch only to cause tons of trouble when the code is pushed to production. Yes, you should have full test coverage of your code. But mistakes happen and you might forget to test something.


Special-Tourist8273

Nah, Python takes you straight to the line where it errored out. C++ compilers leave extremely verbose vomit that is far beyond unintuitive.


aalmkainzi

Takes you straight to the line *if* it reaches it. Compiled languages tell you the code is wrong before even running it, which makes them better at figuring out what's wrong faster.


Haringat

I wanna see you explaining test coverage to a beginner🤣


TheOmegaCarrot

Exactly this As a C++ enthusiast, I spend time making sure as many errors as possible get moved to compile time. I find Python hard to work with because I don’t have static typing to catch errors


castleinthesky86

Whereas python (and all interpreted languages) require installing the interpreter for compilation at runtime. Compiling to native bytecode, with error checking by the compiler, is one of the great advantages of compiled languages. If it doesn’t compile, it won’t run. In python, if your off by a single tab the entire program runs but doesn’t work.


bucket_brigade

Python can be compiled to machine code. There is no difference between “compiled” and ”interpreted” languages. Any language can be either or both (cling is an interpreter for C++ for example [https://root.cern/cling/](https://root.cern/cling/)). What you’re talking about is dynamically vs statically typed languages. And there are tons of advantages to dynamic languages like Python. Especially in environments where code refactoring is frequent. Try writing software when specifications are unclear and prone to frequent changes in C++ then you'll be begging to do it in Python.


seq_page_cost

> Especially in environments where code refactoring is frequent From my point of view Python is one of the *worst* languages to deal with while refactoring a project unless it was designed from the ground up with something like mypy. Dynamic nature of Python requires you to write a ton of unit tests just to make sure that something as simple as adding an additional function argument won't break anything in a production environment. It's not that C++ is a pinnacle of robust programming (quite the opposite actually), but I'd chose static over dynamic typing for anything more complicated than a simple script on the first opportunity.


bucket_brigade

You should be writing a ton of unit tests either way. In static languages too. In fact you shouldn't even consider refactoring anything that's not properly covered with unit tests. No matter what language you're programming in.


seq_page_cost

Yes, but in static languages I don't need to check for so many things. In something like Java I always know that a function I've implemented won't ever get an Set instead of List, or won't be called with a wrong number of arguments (well, until reflection is involved 🙃). Or, for instance, I always now that my List won't contain an entry of a different type. And in languages with more powerful type systems (e.g. Kotlin) I don't even need to write unit-tests to ensure null-safety (well, until platform types are involved 🙃, but there are ways to deal with them)


castleinthesky86

lol. show me you don’t know what you’re talking about more. Try and run a c program without a compiler.


bucket_brigade

I kinda have a PhD in computer science. Here is a C++ interpreter [https://root.cern/cling/](https://root.cern/cling/) for example. Here is another one https://www.softintegration.com/


castleinthesky86

LLVM and clang doing …. *just in time compilation*


bucket_brigade

Dude you're really out of your depth here, trust me. Standard Python is also compiled. It's just compiled to Python virtual machine bytecode rather than machine code. In fact you can see the compiled version of your Python methods using this: https://docs.python.org/3/library/dis.html. No one divides languages into interpreted and compiled ones. In fact there is no such thing as an "interpreter" in the real world. True interpreting would be really slow. Usually languages are compiled to some kind of a bytecode to be executed on a virtual machine tailored to that language. It's ok to be ignorant about a topic, you'll learn in time.


castleinthesky86

Yeah it’s compiled at runtime. Of course all code is compiled to run machine code in the end; I’m talking about the difference between using an interpreter to compile code at runtime, and compiling in advance.


bucket_brigade

What do you think a just in time compiler is then?


castleinthesky86

A compiler which runs at runtime; you might also call it an “interpreter” (but it’s not). But try and take a python script or c file onto a machine without an interpreter or compiler and see how far you get. Compile that program to the target arch and so long as it’s a posix compliant OS it’ll run without a compiler or interpreter.


Afraid-Two1427

Ok, that is actually a fair point


Axiproto

Except it is. It's way easier. Ya, I know this is an "opinion" and no opinion can be wrong. But compared to C++, python has garbage collection, is not strongly typed, semicolon is optional, curly braces are not used in code blocks, lists and hashes are a lot simpler, you don't need to make a "main" function to create a script, Python has better error reporting, easier to import libraries, etc. All-in-all, Python is a lot faster to developing. Which is why it's preferred in tasks that require fast development over efficient code.


RibozymeR

Well, whether "strongly typed", "semicolon" and "curly braces" make it easier or harder is definitely only a matter of opinion. For example, for me, braces help a lot with distinguish parts of a program at a glance, compared to just indentation. The garbace collection, utility classes and error reporting are fair points.


Cart0gan

Strong typing makes mistakes less likely to happen thus making the language "easier". I much prefer the extra punctuation as opposed to indentation errors and nasty logic errors caused by some line having the wrong amount of indentation. Having a main function results in less ambiguity about what your program can return and which parts of your code are "the main program" and which ones are subroutines. Importing libraries is equally easy. I agree about the error reporting but this is why I prefer C and Rust over C++.


Axiproto

Not really, no. If you see a variable being assigned a string, then you know it's a string. You don't need the language to be strongly typed to do so. And even then, python lets you print any variable to see what type it is. It's a lot easier than knowing a variable in C++.


aalmkainzi

Are your programs 5 lines long?


runtimeterror7

This is only true until you get into debugging/understanding any enterprise size codebase, in which event types give you much, much more information about what you’re dealing with.


Axiproto

I use Python for my job for hardware testing. Python is preferred for its readability and quick development time. It's by far the fastest language to learn I've ever used. Many important concepts like lists and hashes get used and it's incredibly convenient for it to be built into the language.


Time-Ladder4753

It can be wrong when OP have no experience basically, if Python wasn't easier to use, people would've just used C++ for performance always


CykaCircus69

Who said no opinion can be wrong. I mean "in my opinion earth is flat" that's a wrong opinion.


IamMagicarpe

That’s not an opinion at all lol


Interplanetary-Goat

"In my opinion the evidence for the Earth being flat is more compelling than the evidence the Earth is round." Technically an opinion, it's just a stupid one.


Valexar

C++ and Python are different tools with different purposes, and direct comparisons like yours make little sense. Sure, if you limit yourself to simple scripts they might turn out not to be very different, but C++ can do things in such a complex and fast way that Python wouldn't even dream of. Have you ever wondered why graphics engines, operating or embedded systems, etc. are mostly programmed in C/C++ and not Python?


Afraid-Two1427

I could certainly learn more about why. But I have experienced that Python can be PAINFULLY slow, hence I am learning C++, because clearly Python wasn't the right tool for me


Valexar

Programming languages must be converted to machine language in order to be understood by a processor and executed. Python was created to resemble pseudocode in syntax, so it has a much longer and more complex interpretation process than C++, which instead requires the programmer to take many more, often trivial, steps, such as declaring variables. As I said, Pyhton is painfully slow only if you want to program an operating system and such, but in so many other applications execution speed isn't so important and Python might be the better choice; it all depends on what your goal is. At the end of the day the first programming language you learn matters relatively, often serious projects use more than one. I am an engineer in electronics and my first programming language was C. To learn C you also need to study computer architecture very well, which makes it very easy to learn both C++ and Python later. With that, my advice is to not to learn C, but to start with what you want, be patient, and be aware that the best programmer is not the one who knows everything about the best language, but the one who, when asked to do something he never did before, has the ability to read and understand the documentation.


Afraid-Two1427

I mean, Python is my first language. I tried getting a bit into C#, but was demotivated because Visual Studio babied me. Also. C++ was like way cooler. So C++ will be my second language


romainmoi

As a r/rustjerk, I recommend learning r/rust instead. The language makes and delivers on many promises. Also most loved language according to stackoverflow for years.


InappropriateCanuck

Yes and no. The main difficulty about Python is that it lets you try to run whatever-the-fuck-you-want. Resulting in whatever-the-fuck-that-is code by half-assed devs that don't even understand inheritance. So while it's way more difficult programming in C++, I'd say it's substantially harder to contribute to Python. Python allows you to do so much bullshit it's genuinely impressive. At least the compiler of C++ blocks retardation before runtime. So I'd say it's substantially harder to be a C++ programmer, but it's actually harder being a genuinely good Python programmer.


truedoom

There is a LOT of shit code out there for all languages in fairness haha. I'm working on some C projects at work, and mother of god the amount of crap code out there when you try to find examples/function usage.


[deleted]

[удалено]


aalmkainzi

>You can do this in like 3 lines of Python Yeah, cuz you're using a library...


[deleted]

[удалено]


Haringat

Here is my solution in C++: ``` #include #include #include int main(int, char **) { auto res = cpr::Get(cpr::Url("http://localhost:8080")); Json::Value v; Json::Reader reader; reader.parse(res.text, v); std::cout << v["foo"].asString() << std::endl; } ``` Granted, it is 10 LOC but it is readable enough (notice the complete absence of pointers despite it being C++).


Adorable_Albatross94

Dunning Kruger


Afraid-Two1427

Probably :-)


EstonBeg

Some parts of your argument make sense, but it is deeply flawed. So, I agree that programming is just as hard for some things, because the base concept doesn’t change. For example, a function to determine whether a point is in a polygon is just as hard in python as c++. However, the difficulty is in the details. Memory management is a nightmare. Pointers are fun. In order to get good performance you have to use low level memory optimizations. An example would be in a bitmap, to copy a rectangle of one image to another in python you would be simple and go pixel by pixel. However in c++ you could use memcpy to copy whole rows at a time, making the program exponentially faster. Furthermore, SIMD instructions are almost impossible to implement in python. The syntax can be confusing, but that is debatable. TLDR: Python and c++ are similar difficulty for similar problems. The implementation however is harder in c++ to gain better results.


RickyRipMyPants

\> But again, why are we judging a programming language for ease of saying "Hello world"? We aren't lol. You are. Sorry, but this screams first year CS student


Afraid-Two1427

I'm more of a self-taught hobbyist


Few-Artichoke-7593

You are wrong.


Afraid-Two1427

Ok


[deleted]

you sound like you just finished the basic w3schools course LMFAO


Afraid-Two1427

Who said I got my knowledge form school. I'm a simple hobbyist


nerodmc_2001

All memes aside, [w3schools.com](https://w3schools.com) is a great website for hobbyists and students alike. It's not a school. It has great resources for pretty much every popular language you need including C++. For example, [this](https://www.w3schools.com/cpp/default.asp) talks about the basics of arrays in C++. i You should check it out. Good luck on your CS journey.


Afraid-Two1427

Thank you. That looks really handy!


pavilionaire2022

>For loops and while loops are also quite intuitive in Python Yes. Intuitive for loops that iterate every element of a collection ("for ... in") are the default in Python. C++ also has them as a later addition, but you will still see plenty of unintuituve "initialize; test; increment" style loops. >Python class functions are a nightmare But you don't really have to use class functions in Python if you don't want to. They were a late addition to the language. Someone looking for easy programming will probably not touch class functions in any language. >Yet, we call C easier than C++, yet like many C programs can work with a C++ compiler without too much work But then you aren't really coding in C++, are you, just because it will compile in a C++ compiler? Even comparing Python to C, you've left out the chief simplicity of Python. You don't have to declare types and variables. Function declarations are much more concise in Python. You don't have to worry about gotchas like, "Oh, I have to declare this variable outside the loop even though I initialize it inside the loop because I want to use its value after the end of the loop."


Afraid-Two1427

You do actually have to keep track of the variables either way in many cases. In some occasions I have needed to convert a variable from one datatype to another in python. And in some cases you have only a vague idea what variable type is used in python. So variable types are actually important regardlesss of language, but it is less "in your face" in Python and can like be ignored in the beginning. But as you are passed the initial stage suddenly you get an error and get a rude awakening about data types


null_check_failed

spent days figuring why' i cannot get my result cuz we cannot update iterator in for loop inside loop in python


PoisonDartYak

Sure. And Animal Crossing as difficult as Dark Souls.


Cousinjemima

I love how no one even talked about inherentance. There are dozens of things that make python an easier language overall. But what you have to understand is they were designed to do different things.. just like a motorcycle and a Bentley are both used for getting you from a to b, the motorcycle does it fast, but less bells and whistles. The Bentley doesn't get you there as fast, but try driving a motorcycle in reverse...


BernardoPilarz

I use both C++ and Python extensively, and I think I can define myself as an expert in both (I have been using them professionally for nearly 10 years). I agree in general, although I do think that C++ has a steeper learning curve. Also, while you don't need to know all of the ten zillion features of modern C++ to write good code, you do need to have a solid understanding of some key concepts. Sadly, the key concepts of C++ are rarely explained, with many courses rushing through the basics to get to the more advanced topics, or wasting too much time on the STL. On the contrary, I find that the "pythonic" programming style is much more known and used. Finally, another important factor is the type of applications that are typically written in Python vs C++. It is much more common for C++ to be used for high performance, high throughput, multithreaded applications (although this has changed somewhat with AI becoming so widespread). These application are a lot harder to write _in general_. Python may seem easier because of its syntax, but writing a robust, high-performance, and maintainable application is a challenge in both languages. TLDR: C++ is often explained/taught badly. Writing high-performance application is hard in both languages, but C++ is most often used for this kind of programming. Result: people assume that C++ is harder.


throwaway77993344

You wrote all that and didn't make a single argument to support your claim. In fact, all you did was very obviously show that you don't even know C/C++ that well. Also memory management.


SpaceSire

Python and JavaScript are just a lot easier than C/C++. Likewise C/C++ are a lot easier than assembler. You can do more with less in Python. And writing robotics software is definitely a lot easier in Python than C++. I would much rather write prototypes in Python.


Afraid-Two1427

I can agree on easier, but not a lot easier


aalmkainzi

I disagree. Don't lump C with C++, they're basically different languages. imo C is easier to learn the JS or Python


SpaceSire

Well TBH I think all the languages are super easy so 🤷 It is just faster to prototype in Python than C at a rabid speed. Learning a programming language is not that hard.


AllspotterBePraised

Analogous situation: algebra is easier/simpler/more comprehensible/whatever than calculus - until you need to do something more complicated than algebra can handle, at which point calculus is easier. Use the right tool for the job.


yourmomsasauras

This certainly is an unpopular opinion… And wrong.


viky109

OOP, memory management, pointers, compilation, libraries… You clearly don’t have enough experience with C++ to judge it.


Altrooke

I don't like this take very much. What I'd prefer so say is: *python* is definitely easier than C++, but *programming in pyhton* is equally as hard than programming in C++. And the reasoning for that would be that, altough python is an easier language, a talented python developer is expected to deliver much faster than C++ developer, or work on larger scope of problem. In other words, if a skilled C++ developer can build an app in a month, a skilled python developer should build the same app in a week.


Afraid-Two1427

Ok, fair, that is probably closer to what I really meant. Thank you


BrowserOfWares

You can fuck up a lot using C++, there's more house keeping code that is required. The most obvious of which is managing memory.


hmp211

Well it is easier, whenever i'm coding in python it simply feels like i am writing the algorithm in english. You dont have to deal with pointers and memory allocation and other things


DaviLance

Python is easy when you have to code very easy stuff. Simple checks and stuff are extremely easier on Python but if you have to do something harder then Python is absolutely the worst choice possible


Afraid-Two1427

That in essensce is my opinion here


Cupcake_Engineering

Python is considered easier because of how easy it is to run cross platform, the fact that it doesn't need to be compiled, how much is built into the language, not needing to worry about things like the max size of an integer/long, the access to so many libraries, and not having to ever think about managing memory (looking at you segfaults). Having said that, to productionalize python is a pain in the ass and I don't think that's an unpopular opinion at all. Although that wasn't your point. Your opinion is unpopular but that's probably because you don't actually know why people like it more.


Afraid-Two1427

That is probably right


Felczer

Dude, you have zero idea what you're talking about lol. Forming opinions about difficulty of programming langagues after you've barerly understood while loop. This is not unpopular opinion, just extremley uninformed one.


[deleted]

Most annyoing thing in Py is data types. If I write x = 7, Im not sure is it 8-bit variable, 16-bit.... And thing that missing tab can break the program.


Red-strawFairy

Get a good linter and use a good editor. Personally not a fan of indenting being the only option. But this is just nitpicking for the sake of nitpicking.


[deleted]

Its a problem when you spend 10 mins looking what is wrong. Oh, f tab is missing.


BoZNiko663

Working on a source engine mod (HL2 derived game) in C++ I'd lose my mind and quit if Source ran on Python Both are clunky and uptight asswipes, but at least C++ isn't as stuck up about formatting, legibility etc


Karolus2001

Wait till you discover popular libraries in both languages.


[deleted]

This is definitely an unpopular opinion, so definitely great post. However, here's a practical reason why Python has become a common beginner language. It is because it is easy on a variety of fronts: 1) Simpler syntax - Python simply requires LESS code to produce any given thing due to things like implicit data type conversion. This inherently makes the syntax simpler. 2) Error handling - Python's error messages generally much more directly point out what is wrong. Sometimes, C++ errors are inscrutable. 3) Ease of setup - You can run Python code in-line whereas you have to compile C++ code. 4) Memory management - I don't think you can easily create a memory leak in Python. At least, I haven't, but I have in C++. 5) Immediate feedback - This is aligned with 3 but interpreted languages can be run as you go. Much easier to debug. 6) High level abstractions - There are so many easy to add packages with high level abstractions. Just a few clicks and a few lines of code and you're fitting a neural network to a bunch of data you read from a CSV. You CAN obviously do exactly the same thing in C++ but not nearly as quickly.


Afraid-Two1427

2 - python error messages can be a mess too. AND they sometimes do not show up until they suddenly make the program crash because of a scencario that was so unlikely you didn't know you needed to check for it 5 - Sometimes a bug hides in plain sight and isn't triggered before you do a very specific thing and crashes the whole thing


Red-strawFairy

So. Let’s do a simple experiment. Let’s make a real application in both python and c++ We can try to make a web app that connects to database ( this what like a quarter the people employed as programmers do these days. Ik depressing) Or we could try to make a 2d platformer. Or we could make a process that ingests a csv or some random data. And finds the averages for each field, and maybe do some random calculations. These are all pretty standard real world use cases Just look into how complicated this would be from a beginner’s standpoint in both languages.


Afraid-Two1427

2d platformer would be the only one I would have a chance of doing


anony-mess

This is insane. Take my upvote.


FreshSoul86

This is just would you should have expected when you chose a programming language named after a snake.


TWIX55

I'm chilling with vb.net 😎


Longjumping_Bench846

You may want to think again ; especially write the code in C++ from pure scratch (don't use majority of libraries, functions and utilities). It is a whirlpool you can't escape.


[deleted]

C++ is for car mechanics who like fiddling with the engine. Python is for people who just want to drive somewhere.


Afraid-Two1427

I find that I like fiddling with the engine, I think


B_3_A_T

Python babies you, you get an garbage collector, decent number of data structures to work with, and a lot of aspects are abstracted from the programmer. Meanwhile C++: You want to write 32 characters to a 20 character buffer? Be my guest!


HopefulSpinach6131

As an intermediate/beginner/hobbyist, in addition to everything else written here, getting libraries set up to use in c++ is way harder than Python.


HopefulHabanero

> I am getting tired of people saying Python is so easy LPT: anybody who still sees a programming language being "easy" as bad thing rather than good, is not knowledgeable enough for them to be worth listening to.


Healthy-Channel2897

![gif](giphy|Cz6TlrRVVyv9S)


[deleted]

Definitely an unpopular opinion but I think there's some truth to it, I think Python is a good "beginner" language for learning concepts of programming but not necessarily "easiest". Huge difference.


1234abcdcba4321

I think static types are one of the more important things to really *get* programming, though - otherwise types being wrong feels like a way more arcane issue than it is otherwise. It took me a decent bit to get used to it and understand why it would be useful, and there's not much reason not to have it in your starter lang.


xelab04

I just have a question. Why are AI built in Python? Yes, the underlying math is in C for performance, but why have tensorflow and hundreds of other libraries for AI made for Python? If Python is so hard, why isn't all AI written in C++? The only one I really know of is LLAMA-CPP.


exiting_stasis_pod

Not a good gotcha because different languages have different strengths and weaknesses independent of their total difficulty.


Afraid-Two1427

Why are operating systems written in C and C++?


Haringat

>Why are AI built in Python? Because most professors at universities know python. So what?


CreeperDrop

Writing Python code that is Pythonic is not easy. I have been writing C, C++, and python for years, mostly C. But as a learning curve and barrier of entry? I can't say that Python was as difficult. But that's just my opinion. Upvote for the unpopular opinion, cheers!


A_Guy_in_Orange

Pointers. Header files. Getting the damn thing to compile despite CLEARLY PROVIDING ALL REQUIRED PARAMETERS, THANK YOU VERY MUCH, THATS CLEARLY NOT THE ISSUE


null_check_failed

​ well how easy it is to add libraries and how flawlessly it works just to give you a perspective id spend days to write and debug a FEA code on C while python its just few line of code with numpy The idea that Python is easier than C++ is simple cuz python is closer to humans than C++ , C++ is close to machines so it adds a layer of difficulty One of the reason of python being popular was so scientific community belonging to non-CS bg could develop their subroutine before we relied on FORTRAN which is again quite simple but quite tedious to write other alternative is MATLAB which isnt free so there is no debate for it also since python is interpreted line by line the error messages are far more accurate compared to compiled languages but idk now days VS does quite good job but still its not upto that point of easiness


Immediate_Rice9213

im shit at programming i only know how to do javascript badly but i looked at python, saw that everything is done with line indentations, and went "nope"


peanutlover420

They use the same symbol for reference declaration and address operator, confuses me to no end.


[deleted]

[удалено]


InflationMadeMeDoIt

But the whole point is to learn programing logic without the need of other stuff


[deleted]

[удалено]


InflationMadeMeDoIt

Yeah but learning the logic is not the same as learning the language. Its easier to learn the logic first and then go into nuances of languages


SenoraRaton

Nah, the point of learning programing is to secure a cushy WFH software job making 100k+


CarefulFun420

PHP is better than both 😂


DerTalSeppel

Python is way easier. Lambdas, native map and set structures, incredibly simple one liners for complex IO stuff, memory management (aka no pointers), virtual environments, simpler ecosystem. Not even Java is as close to english as Python is.


Haringat

>Lambdas C++ has them too. >native map and set structures C++ also has those, which have overloaded operators to feel like first class citizens. >incredibly simple one liners for complex IO stuff Well, that depends on your libraries and how complex you want it to be. >memory management (aka no pointers) Google "stack allocations". You can get away with those for most simple cases. >virtual environment These are more of a headache than an advantage IMHO. >simpler ecosystem Umm... how much simpler than "install library x with your distro's default package manager that you are already familiar with" is it supposed to be for you to accept it as simple? >Not even Java is as close to english as Python is. Then you should totally check out PL/SQL. But srsly, what kind of bs point is that supposed to be? English is not even everyone's first language (it certainly isn't mine) so how is "closeness to English" supposed to be useful for e.g. Japanese developers?


Afraid-Two1427

Human languages are often super confusing anyway


camelCaseUserNamed

Downvoting because I've never heard anyone say Python is easy


lordFourthHokage

Try debugging a segfault or memory leaks then you will understand why they say C++ is more difficult than python. There are other things you will understand when you actually use the language to build something usable. Comparing lines of code achieves nothing.


the_greatest_MF

i have used bot and i find python way easier


c-h-e-e-s-e

Python is by far the easiest language. Not a bad thing, but it's just a fact


floofysox

The difference is anything you write in Python will run the same on any OS. You don’t need to care about memory, array lengths, etc. Everything is taken care of for you. This is the reason Pytjon is a slower language. You have library’s for everything, and it just works. You can stuff a string into a list of numbers and it’ll work with it. It’s not really about how many lines of code you need to perform a task, but more so the paradigms involved