On Sat, Jan 11, 2014 at 12:07 AM, pintreo mardi <bigearl...@outlook.com> wrote:
> Hi, I've just begun to learn programming, I have an open question for the 
> group:
> Is the Python language an all in one computer language which could replace C, 
> C++, Java etc.. I only ask becuase I am starting off with python and I want 
> to learn everything in basic and advanced programming with python itself...So 
> any advice and suggestions would be more than welcome.
> Thanks!!

As others have mentioned, they're all turing-complete.  In other
words, with an infinite memory and infinite coding patience, they can
all solve the same problems.

The main distinctions, at least to my mind, are:
1) Python tends to require fewer words to solve the same problems, but
tends to be slow running.
2) C tends to be very fast running, but takes a lot of words to solve
the same problems, and is prone to hard-to-fix memory errors
3) C++ and Java aren't that different in performance today, because of
Java's good JIT.
4) Java's not great for systems programming (apparently can't detect
symlink races for example), but C, C++ and sometimes Python are.

Each language will tend to have API's (Application Programming
Interfaces) that make some classes of problems easier or harder.
API's are basically reusable code you can use to make your own
problems quicker and easier.

You probably wouldn't write an operating system kernel in Python -
it'd be too slow.  However, writing an application in Python might be
a very good use of time.

If Python proves too slow for a problem (which is uncommon), you can
rewrite small portions in C to get good performance.  Also, there is
another implementation of Python called PyPy that's much faster than
the reference implementation, which is known as CPython.

C++ and Java cover similar kinds of programming - they're both object
oriented C-like languages.  However, C++ is more prone to memory
errors than Java, and I'm told that C++ has many incompatible
implementations of fundamental things like strings.  For these
reasons, I'd recommend Java over C++ for most things (except systems
programming).

C, C++ and Java are all statically, manifestly typed.  Python is duck
typed.  These are fundamentally different approaches to program
correctness.  In C, C++ and Java, programmers tend to assume that if a
program compiles, it's working.  This is not a great assumption, but
it isn't that far off the mark, either.  Python on the other hand,
will compile a lot more programs than those that work - for this
reason, it's a very good idea to use automated tests with Python.
Automated tests are a good idea with C, C++ and Java too, just not as
crucial.

HTH
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to