Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63753

Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?

References <18b67e59-39d1-41e2-8977-b1c449b132e7@googlegroups.com> <roy-24194C.10455311012014@news.panix.com> <cd84d9dfi4bvs8o2her0qt9ethppuvpj7o@4ax.com>
Date 2014-01-12 16:58 +1100
Subject Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5357.1389506333.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Jan 12, 2014 at 4:08 PM, Steve Hayes <hayesstw@telkomsa.net> wrote:
> So the question is, which kinds of programs is Python best for?
>
> I'm a novice at it, so it's a question that concerns me. From what I've heard
> and read, it seems to be a fairly good general-purpose language, and it seems
> to be most used for writing web applications (though that is not something I
> am particularly interested in).

Python puts heavy focus on code readability (which also means it's
easy to write). So it gains you hugely for small scripts, less so for
things that need to run millions of times a second.

Python has a variety of libraries that make it well suited to internet
applications (as server or as client).

Python, especially as of version 3.3, is superb at handling
internationalization, Unicode, and related messes - you can sort out
files of different encodings and rewrite them in something consistent
(eg UTF-8). It may seem a bit harder at first, as you're forced to
think about the meaning of bytes and what's text and so on, but it's
worth it.

Python is NOT good at massively parallel numerical calculations.... on
its own. But there are libraries that can do that sort of thing for
you (NumPy, SciPy); I've no idea how good they are because I neither
use them nor write code that would benefit from them, but they're
extremely popular and well-used.

As a general rule, if your program is likely to spend most of its time
waiting (for the disk, the network, the user, etc), then Python is
probably at least as good a choice as C, Java, or any other language,
and the question will come down to library support and such.

Python is also an excellent "super pocket calculator". The
reasonably-compact notation for aggregate operations (list
comprehensions and such) lets you work with a functional programming
style, and you can use step-by-step imperative programming in the same
way. Want to calculate the average result of rolling six six-sided
dice, and discarding any results below 14? Try this:

http://www.kickstarter.com/projects/916188323/doublesix-dice-roll-better/comments?cursor=5623335#comment-5623334

(BTW, is there no better notation than six nested for/range for doing
6d6? I couldn't think of one off-hand, but it didn't really much
matter anyway.)

The incremental execution of Python's interactive interpreter (REPL)
is extremely convenient for this. I personally like using IDLE for
this, as (unlike command-line Python) it will recall and edit an
entire suite, rather than one line at a time. Extremely handy.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? pintreo mardi <bigearl497@outlook.com> - 2014-01-11 00:07 -0800
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Chris Angelico <rosuav@gmail.com> - 2014-01-11 19:21 +1100
    Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? pintreo mardi <bigearl497@outlook.com> - 2014-01-11 02:10 -0800
      Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-11 10:51 +0000
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-11 10:47 +0000
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Roy Smith <roy@panix.com> - 2014-01-11 10:45 -0500
    Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Steve Hayes <hayesstw@telkomsa.net> - 2014-01-12 07:08 +0200
      Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Chris Angelico <rosuav@gmail.com> - 2014-01-12 16:58 +1100
        Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Rotwang <sg552@hotmail.co.uk> - 2014-01-12 14:36 +0000
          Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Chris Angelico <rosuav@gmail.com> - 2014-01-13 01:44 +1100
  Re:Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Dave Angel <davea@davea.name> - 2014-01-11 19:37 -0500
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? matej@ceplovi.cz (Matěj Cepl) - 2014-01-12 02:36 +0100
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Dan Stromberg <drsalists@gmail.com> - 2014-01-11 18:43 -0800
  Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? Grant Edwards <invalid@invalid.invalid> - 2014-01-12 18:53 +0000

csiph-web