Skip to main content

Which language is best, C, C++, Python or Java?


I have used each of them for 15-20+ years. There is no best. They have different strengths and weaknesses.

C and C++ require a lot of discipline because you have to do memory management yourself.

C++ is extremely powerful but also very complex.

C and C++ are "dangerous" because, if you are not careful, your program can access and modify data that it is not supposed to touch.

Python is elegant and designed to be easy to use and read. It has the least distractions when it comes to syntax.

The syntax of C, C++ and Java look somewhat similar. Python looks different, it  uses indentation instead of {} to group code.

Python comes with "batteries includes", that means it has a lot of functionality build-in in the standard library.

In Python there is 'one way to solve a problem'. On the other end, in C++ there are way more ways to solve the same problem. This added choice can distract you form solving the problem.

Java has the best IDE support (e.g. eclipse or IntelliJ)

C and C++ are also statically typed, but the preprocessor can add a level of complexity that can make it difficult to be sure what actually happens.

In terms of speed C/C++ are fastest, but for most problems Java is very close in speed. Python can be slow, but if needed critical parts can be written in C. On modern execution speed is rarely the limit - cache behaviour, memory and disc access are the limits.

If you want to learn programming, I would learn python first, then Java, then C and finally C++.

I personally would not recommend C++ because of its complexity. However, if your are disciplined and have a strict set of rules for a project, C++ can be fantastic.

I would use C only for low level stuff, like writing device drivers.

Java is good for large projects, provided you write good APIs and you are carefully modularizing your software.

Python is good for small projects. If the team and the software gets bigger, it can become hard to maintain unless you have a very good test coverage.

Reply by Michael Scharf

Comments

Popular posts from this blog

There is no regret in Obedience

It’s a guarantee your life will never be the same again when you obey God. God is our CREATOR and our DIRECTOR meaning he knows the best way for our lives since he loves us, our role is to simply OBEY Him. Obedience is everything when we are relating to God. Obedience is the KEY ingredient in the kingdom of God. God is always ready to manifest himself in our lives when we obey Him and his word(John 14:23 Jesus Replied, “Anyone who loves me will obey my teaching. My Father will love them, and we will come to them and make our home with them.” Like 5:5 Simon Peter an experienced fisherman with a fishing business had toiled the whole night without any catch of fish and he was frustrated and tired and he was washing his nets UNTIL Jesus told him to Launch out into the deep again. Peter had a CHOICE to say YES or NO but he choose to OBEY and he said: “Nevertheless AT THY WORD I WILL LET DOWN THE NET”. The moment he chooses to obey instead of Questioning, Analyzing and trying ...

CA sounds alert on fake software

The telecommunications sector watchdog has warned companies and individual Internet users from buying fake software, saying it now offers hackers the most common loophole for executing cyber-attacks. The Communications Authority of Kenya (CA), through the National Computer Incident Response Team Co-ordination Centre (National KE-CIRT/CC), warned on Thursday that cybercriminals have changed tack and are now using third-party software to deliver threats to unsuspecting users in an attempt to compromise and steal their personal data. “Though Kenya has not been adversely affected by such attacks as at now, the trend depicts a serious concern in cybercrime management and thus a precaution should be taken when dealing with outsourced products and personnel,” said acting CA director- general Christopher Kemei in a statement. Kenyan businesses lose billions of shillings and troves of sensitive information to hackers every year. SOURCE

THE POLITICALLY INCORRECT PRAYER

When minister Joe Wright was asked to open the new sessions of the Kansas Senate, everyone was expecting the usual generalities, but this is what they heard: THE PRAYER Heavenly Father, we come before you today to ask Your forgiveness and to seek Your direction and guidance. We know Your Word says, "Woe to those who call evil good,," but that is exactly what we have done. We have lost our spiritual equilibrium and reversed our values. We confess: We have ridiculed the absolute truth of Your Word and called it Pluralism. We have worshipped other gods and called it multiculturalism. We have endorsed perversion and called it alternative lifestyle. We have exploited the poor and called it the lottery. We have rewarded laziness and called it welfare. We have killed our unborn and called it choice. We have shot abortionists and called it justifiable. We have neglected to discipline our children and called it building self-esteem. We have abused power and...