Python or C++ programming

Reverend Conehead

Well-Known Member
Messages
9,953
Reaction score
11,858
I'm considering learning either Python or C++ or both. There are reasons to learn both. LibreOffice, which I use, is written in C++. It would be great to go in and be able to modify some of its features. LO is open source, so I could get my hands on the source code. The same thing is true of another application that I like. It's named CherryTree, but it's written in Python. It would be cool to know Python and be able to modify that application as well.

I learned MS Visual BASIC (classic, not dot net) some years back. I enjoyed creating some freeware with it, but today that language is obsolete. Plus, it was never able to compile a program to run under Linux, which I now use. I wrote a freeware multiple file renamer that I would like to re-code to run under Linux. If I learned C++ and Python for the purpose of modifying those other programs, I would have my choice as to which language to write my renamer in. I miss being able to write a specialty program for something I want to do. I'm curious if anyone here has coded in either of these languages or both and what your impressions are.
 

Eric_Boyer

Well-Known Member
Messages
5,789
Reaction score
1,573
I don't like interpreted languages, so I doubt I would enjoy python. I consider c++ to be as dead is classic VB for different reasons. It is needlessly complicated, has no garbage collection, and takes decades to master, which I never did.
 

JoeyBoy718

Well-Known Member
Messages
12,715
Reaction score
12,709
Depends on how far you want to go with computer science. There are many more advanced details to C/C++ (pointers, garbage collection, memory allocation) that might not be necessary to try to wrap your head around if you only want to learn how to program to play around with little projects in your free time. C/C++ is mainly used nowadays for systems programming (developing operating systems, drivers, databases) and if speed is an issue. Python has a lot of cool built-in functions and libraries that allow you to do pretty advanced things in a few simple lines of code. It's also much more readable if you plan on cracking open source code and figuring out how something works. C/C++ were the first languages I learned in undergrad and was a good way to learn the basics of programming, OOP and data structures, but I haven't used it since. I taught myself Python in a weekend in grad school because it had a lot of libraries to do natural language processing and data analysis, and it's become one of my favorite languages. It's also one of the best languages to learn if you want to learn how to build a simple app or website (along with PHP, JavaScript and Ruby). It has a few good web frameworks (the one I'm familiar with is Django). Overall, I would say mastering Python and becoming familiar with some of its libraries will really open up your possibilities to do a lot of cool projects. If you want to get a strong grasp of computer science, then C/C++ would be good languages to learn. If you want a mix of both, I'd say maybe learn Java.
 

Reverend Conehead

Well-Known Member
Messages
9,953
Reaction score
11,858
Depends on how far you want to go with computer science. There are many more advanced details to C/C++ (pointers, garbage collection, memory allocation) that might not be necessary to try to wrap your head around if you only want to learn how to program to play around with little projects in your free time. C/C++ is mainly used nowadays for systems programming (developing operating systems, drivers, databases) and if speed is an issue. Python has a lot of cool built-in functions and libraries that allow you to do pretty advanced things in a few simple lines of code. It's also much more readable if you plan on cracking open source code and figuring out how something works. C/C++ were the first languages I learned in undergrad and was a good way to learn the basics of programming, OOP and data structures, but I haven't used it since. I taught myself Python in a weekend in grad school because it had a lot of libraries to do natural language processing and data analysis, and it's become one of my favorite languages. It's also one of the best languages to learn if you want to learn how to build a simple app or website (along with PHP, JavaScript and Ruby). It has a few good web frameworks (the one I'm familiar with is Django). Overall, I would say mastering Python and becoming familiar with some of its libraries will really open up your possibilities to do a lot of cool projects. If you want to get a strong grasp of computer science, then C/C++ would be good languages to learn. If you want a mix of both, I'd say maybe learn Java.

Thanks. I really appreciate your comments. Java is actually my third consideration. A coworker wrote an application for us in Java that helps my work day a lot. We have Windows 10 at work and the thing runs great under it. I took it home and ran it on my Kubuntu Linux PC, and the exact same program ran perfectly. There was no Windows version and Linux version. The exact program ran under the two different operating systems. That was impressive. I have noticed Java applications always have a non-standard interface for their operating systems, but I'm sure that's a tradeoff to make it so portable between operating systems.
 

JoeyBoy718

Well-Known Member
Messages
12,715
Reaction score
12,709
Thanks. I really appreciate your comments. Java is actually my third consideration. A coworker wrote an application for us in Java that helps my work day a lot. We have Windows 10 at work and the thing runs great under it. I took it home and ran it on my Kubuntu Linux PC, and the exact same program ran perfectly. There was no Windows version and Linux version. The exact program ran under the two different operating systems. That was impressive. I have noticed Java applications always have a non-standard interface for their operating systems, but I'm sure that's a tradeoff to make it so portable between operating systems.

Yeah Java uses a Java Virtual Machine to interpret bytecode so that it's able to run on any machine that supports Java, unlike other languages like C++ that are more dependent on the operating system. But then there's a speed and size tradeoff with Java because it requires installing a Java Virtual Machine as well as compiling to bytecode and then interpreting the bytecode, whereas C++ compiles directly to executable machine code so it doesn't need that extra layer of interpreting.
 
Top