Choose the Best Programming Language for You

In summary, Python is a very elegant, simple language that can be learned relatively quickly. Java is a resource hog, but Python really has little advantage, if any, on resource consumption.
  • #1
thomate1
1,346
0
I am a physics student. I am very much interested in computers.I have already studied C++. I would like to study Java also. But some friends told me that Python is far better than Java. Can u please help me to choose one of them?
 
Computer science news on Phys.org
  • #2
I come from a C/C++ background and I've tried java a couple of times but never found it compelling enough to learn. Its very clunky and consumes lots of memory (8-16MB min). Python on the other hand is a very nice language. It has very clean syntax and programs can be developed quickly. It also has a small memory foot print and you can include C/C++ modules in your code to speed up execution.
 
  • #3
I'm avoiding discussing about which of them is the best to learn, but you should know that moving from C++ to Java is much easier (may take just weeks) than moving from C++ to Python. So you can learn a few additional things about Java (especially multithreading) and go on with Python.
 
  • #4
dduardo,

Python often has a memory footprint similar to Java, and Python is usually quite a bit slower. Compared to C++, Java is a resource hog, but Python really has little advantage, if any, on resource consumption.

The advantage of Python is that it's a very elegant, simple language.

I would advise learning Python over Java for one simple reason: You will learn more about computer programming in general by learning a language distinctly different from the one you already know. Syntactically and conceptually, Java is similar enough to C++ that I consider them related languages. Python, on the other hand, is radically different (and better) than both in many ways.

Go with Python.

- Warren
 
  • #5
Thank you for your answers. But I wan'ts to know which is beneficial for future than which is easy. Can you help me please.
 
  • #6
The future is not known. I would venture that Python has a wider scope of applicability, though, and it's growing fast.

It doesn't really matter, though -- once you learn a couple of languages, it only takes days or weeks to pick up another. You're not going to limit yourself by picking either.

- Warren
 
  • #7
I just started programming and I just did simple programs so far, like graph functions and search for things and what not, but it's all cool stuff anyways.

Using the same algorithm for finding primes, I found Java is much faster than Visual Basics .NET.

My question is... is C or C++ much more faster than Java?

That would just be sick if that was the case.

Once I get a good algorithm going, I'll buy a computer that will simply run all day finding a nice ordered collection of primes that can be useful for encryption/decryption.

Also, I will use the computer for other things, but I have to keep that project secret. :D

I have never heard of Python, but I seem pretty content with Java and Visual Basics .NET. I prefer Java, but will most likely move onto C or C++ just for fun. Some programs may have advantages of others. For example, Visual Basics is good for a quick "bing badaboom bada bing" program. :)
 
  • #8
Here's why I learned Python: http://www.vpython.org
...It's the quickest way for me to produce animated visualizations for physics.
(A few years back, I was frustrated with Java+VRML and Java3D. Then, I found VPython.)
 
  • #9
JasonRox said:
My question is... is C or C++ much more faster than Java?
For algorithms (searches, sorts, etc.) no, it's roughly the same speed as C++. For windowing and graphics, there are much faster C++ implementations.
I have never heard of Python, but I seem pretty content with Java and Visual Basics .NET.
http://www.python.org

I suggest a book like "Programming Python" from O'Reilly to really learn the language.

I strongly suggest you give up on Visual Basic, and try Python. Visual Basic and Python are both aimed at rapid prototyping, but Python is suprisingly even easier than VB.NET, and it's portable everywhere.

- Warren
 
  • #10
I say learn them both Python and Java. Having to do with C++ it's a pity not to learn a few things about Java, as the latter combines most of the features of today's modern languages (the event handling model, the exception model, streams, multithreading, easy networking with sockets, serialization, built-in libraries and data structures, portability, pure object-orientation, interfaces, huge support for security, applets, high-level, interpreted, and so on, and so on). You will learn both a language and a set of important concepts that you will surely need in the future. After all it won't take you that long to learn this language.
 
  • #11
I'll go out on a limb and recommend Lisp.

I'll also add that if you allready know C++, continuing with Java doesn't make sense to me. They are to similar, and will not really widen your horizon. Learning Java will mostly just teach you new syntax.

Guess it depends on what your goals are. Knowing Lisp will probably not land you that job with company X. It will however teach you a radically different way of approaching programming.
 
  • #12
Thanks for your advice
 
  • #13
LISP and its popular implementation Scheme are very powerful languages for introducing certain algorithms, and modelling purely theoretical problems in computer science. You can do a lot of really neat things in Scheme in LISP in one line that would take you 20 lines in C++ or Java. Unfortunately they do not have the API support for things like graphics, database connectivity, etc. that Java and even Python do. Recursion, which functional programming languages are heavily dependent on, is pretty inefficient unless its made properly tail recursive and the compiler optimizes functions who satisfy this property. The automatic garbage collection and extremely weak typing system also makes them pretty unwieldy for production use, although Phillip Greenspun would have you believe otherwise. Self-modifying code also is a lot more difficult to debug, and by extension a lot more difficult to make secure.
 
  • #14
Your points are good, so-crates, but they all have obvious refutations:

1) Yes, Lisp is well suited for a number of algorithms of mainly academic interest, including aritificial intelligence, natural language processing, and so on. The lack of API support or inter-language interfacing makes them unsuitable for probably 90% of the projects done in the real world.

2) Recursion is one of the most difficult constructs for programmers to write (and maintain) properly, so most programmers advocate never using recursion except in very simple cases. Strong software-engineering methodologies like Cleanroom also discourage recursive coding. There are only a small class of algorithms that require recursion; the rest would be better coded with other techniques.

3) It's an outdated belief that strongly typed languages result in less-buggy code. The idea was that strong typing finds errors at compile-time, while weak typing let's the errors stand until they are detected at run-time. The problem with this logic is that a large majority of bugs in strongly-typed language occur in code that converts data from one type to another. It turns out to be better to build type conversion into the interpreter/executive/virtual machine than to force every programmer to ad lib it each time it's needed.

There is a great deal of academic and commercial evidence, growing daily, that Python programs are less buggy than equivalent C programs. In addition, Python programs are much easier to read, maintain, refactor, and update.

And, you know, I've never once seen any self-modifying code in a production environment. Have you?

- Warren
 
Last edited:

1. What are the factors to consider when choosing a programming language?

When choosing a programming language, some important factors to consider include the purpose of the project, the requirements of the project, the availability of resources and support, the learning curve, and the compatibility with other technologies.

2. How do I determine which programming language is best for my project?

The best way to determine which programming language is best for your project is to first understand the goals and requirements of your project. Then, research the different programming languages and their features to see which one aligns best with your project's needs.

3. Can I learn multiple programming languages at once?

While it is possible to learn multiple programming languages at once, it is not recommended for beginners. It is better to focus on mastering one language before moving on to another, as each language has its own unique syntax and structure.

4. Which programming language is the easiest to learn?

This is subjective and can vary depending on the individual's learning style. However, some popular programming languages that are known for being beginner-friendly include Python, JavaScript, and Java.

5. How do I stay updated with the latest developments in programming languages?

To stay updated with the latest developments in programming languages, you can follow industry blogs, attend conferences and workshops, participate in online communities, and continuously practice and learn new skills.

Similar threads

  • STEM Academic Advising
Replies
12
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • Computing and Technology
Replies
2
Views
717
  • Programming and Computer Science
Replies
8
Views
865
  • STEM Academic Advising
Replies
3
Views
906
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Science and Math Textbooks
Replies
4
Views
1K
  • Programming and Computer Science
2
Replies
54
Views
3K
  • Programming and Computer Science
Replies
16
Views
1K
Back
Top