Since I noticed that these languages are rather popular, what are the advantages and disadvantages of each over the others? and what is the need/motivation for each one of them?

Why are there no C++/Java libraries to deal with those needs?

Recommended Answers

All 13 Replies

Why are there no C++ libraries to deal with those needs?

There are.
From the docs.

So why are Python, php and Perl prefered over those existing libraries?
C++ is more efficient, is it not?

This can be understood mainly by examining the history of these languages. C++ was an object oriented development of C at the time where OOP was the new paradigm. Perl started as a system scripting language which was more structured than shell languages. It was then heavily used when internet was based on cgi scripts and there was no other alternative. Php succeeded because it made it possible to include dynamic code in html pages.

Python is different. It started as a general purpose language derived from a small university language called ABC. Its success comes from experience: people realized that using python led to drastic cuts in their programming effort!

commented: useful historical comparison +0

Interesting historical comparison, but what is the need for each 1 of them today? why is each 1 of them still used as opposed to neglected? what are their advantages over existing C++ libraries? Your post explains the reasons for the invention/creation of each 1 of them, but does not compare them with each other and C++, except from that part about Python and its cutting of programming effort.
I mean what is the advantages/disadvantages of each compared to the others, as well as to Java & C++ in important attributes such as efficience, code size, amount of commands to remember / available for use and other attributes?
And what makes Python easier to program with? and I heard that this is the explanation for why is Java prefered some times over C++. So why is Python prefered over Java in these cases?
off topic: How does 1 quote here and is there a way to mention a poster in a way that ensures his awareness such as the use of @ in a few other places?

For the off topic question, read this help .

To make short take any of efficiency, code size, memory effort, programming effort, then

c++ > java > python

Python is easier because it uses duck typing. Java is easier than C++ because of memory management and types management.

c# is very similar to java. Perl has ugly and unmaintainable code.

At times the speed you can develop a program is important, that's where Python will be best.

the OP asks something i have pondered over myself a number of times , but didnt ask anywhere feeling i might be tagged as vague and asking something without any objective. but regarding php , i would like to know how node.js stands against it. also, when it is said python speeds up development , development of what of things exactly ? pardon my ignorance as im just a few months old java programming student.

but regarding php , i would like to know how node.js stands against it.

This question should perhaps be asked in a web development forum, php, javascript ... ?

i saw php being discussed here , as is other languages.. so i thought maybe it wont hurt if i ask about one more language.

Python is a full featured language and you can develop just about any type of software with it.
Python is written in C, C++ and Python.

There is one version of Python called Jython that is written in Java and can use the Java library. It suffers from the slowness of Java.

Another version of Python is called IronPython and it uses the Microsoft NET Framework. IronPython can be used as an interpreted language or a compiled language.

And note that Python does not compete with C++ to the fullest sense of the word. It compliments it. you speedily develop in python and when you need critical operations you can make a C/C++ program and use it for that Part.

Have you heard of CTypes? One of best things ever occured to Python :)

My take in a nut shell:

There are certain camps in programming -- those who like complete control, and those who don't mind trusting others to do some of the annoying work.

C/C++ --> Meant to be compiled. You are forced to do memory management. It runs very close to the hardware level, which means it doesn't have a whole lot of overhead when executing. In general, web sites wont use it unless it's a web service or custom server that uses C/C++ as a back end (which is what PHP was meant to do).

JAVA/C# --> Memory management done for you. After that, JAVA requires a VM to run, and has a lot of other issues that programmers tend to dislike. It's also not very secure. C# is very closely tied to Microsoft, so some people dislike it for that alone (and .NET). They are used to develop anything from stand alone apps to web tools, though it's not commonly front-facing any longer (JAVA used to be, but I haven't seen it on the web in a while, now...)

Perl --> I don't know much about it other than I don't want to learn it because that means I have to read it. It's old.

PHP --> Dynamic web scripting / software development. In its current state, it can tackle just about everything from socket programming to massive data management. While it can be compiled, it's generally not used in such a manner. It's a server side web programming langauge.

Python --> A general purpose language that runs on a VM (like C#/JAVA), but it runs faster mostly because it is built in C/C++, and has good memory management. Python can pretty much do whatever you want it to do given a proper set-up. It's a bit of a jack of all trades, and very structured - so development is quick, easy to read, and semi-easy to debug.

Are any of these better than the others? (Yes!) No.. they are all tools that are good for certain uses. C++ is great if you are going to write programs that you want to run fast, and are generally cross platform (assuming you arent using COM or the windows API, or any of the Linux specific commands). However, you need to be good at writing C/C++ and understand memory management and how computers run software (such as being aware of the heap and stack, and how data is moved while it's processed). Otherwise, you get funky results or crashes or memory leaks, or... the list goes on and on...

C# is wonderful if you use .NET, and want good memory management, but it's not generally cross platform. C# is more of a Windows environment language, JAVA is for Linux.. it's just slow... (both of them).

Perl.. cant answer.. it's secure from what I understand, but it's hard to use/write/read.

PHP is great for web development. All aspects of it. If you want to develop a web-platform application, PHP is the best I can think of other than a custom server.... except...

Python. Which is fast, efficient, easily maintained (because it's all written the same), and the great Motto: "There is only one way to do it right!" However, it's not "easily" compiled (so your source code is potentially exposed for stand alone apps), it's only cross platform if the system it's running on has python installed (and, at the moment, the right version installed as 2.x and 3.x are completely incompatable). These things are not impossible, though... but the necessity for the VM makes some compiled programs uneccesarily bloated.

I hope that helps answer your question.

Python has a variant called PyPy that translates Python code to C which can then be compiled. The resulting C code is highly optimized and in many cases faster than "standard" C code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.