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


Groups > comp.lang.python > #78127 > unrolled thread

Python advice

Started byngangsia akumbo <ngangsia@gmail.com>
First post2014-09-22 01:09 -0700
Last post2014-09-24 01:08 +1000
Articles 11 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  Python advice ngangsia akumbo <ngangsia@gmail.com> - 2014-09-22 01:09 -0700
    Re: Python advice ngangsia akumbo <ngangsia@gmail.com> - 2014-09-22 01:14 -0700
      Re: Python advice vek.m1234@gmail.com - 2014-09-22 02:10 -0700
    Re:Python advice Dave Angel <davea@davea.name> - 2014-09-22 14:03 -0400
    Re: Python advice Chris Kaynor <ckaynor@zindagigames.com> - 2014-09-22 12:00 -0700
      Re: Python advice wxjmfauth@gmail.com - 2014-09-22 23:22 -0700
    Re: Python advice Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-22 13:39 -0600
    Re: Python advice Chris Kaynor <ckaynor@zindagigames.com> - 2014-09-22 14:59 -0700
    Re: Python advice Chris Angelico <rosuav@gmail.com> - 2014-09-23 10:55 +1000
    Re: Python advice Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-23 08:48 -0600
    Re: Python advice Chris Angelico <rosuav@gmail.com> - 2014-09-24 01:08 +1000

#78127 — Python advice

Fromngangsia akumbo <ngangsia@gmail.com>
Date2014-09-22 01:09 -0700
SubjectPython advice
Message-ID<9b76b07d-db88-4e08-9abe-10df1ac9953e@googlegroups.com>
I have learned python for some time now. I am developing apps using django. 

I need some advice.
I want to be able to write big programs using python. I have not been able to do that as of now. I need a way forward on what more free ebooks i can get mt hands on so i can accomplish my goals.

I need some advice. should i go on to learn other languages like java or c++ cos i want to be able to using all these knowledge for games, desktop, mobile and web.

i start learning java and i seem it is more real life. it looks real that python.

any advice

[toc] | [next] | [standalone]


#78128

Fromngangsia akumbo <ngangsia@gmail.com>
Date2014-09-22 01:14 -0700
Message-ID<420ceb53-761f-41fe-bc92-5d0cbea6fb6a@googlegroups.com>
In reply to#78127
PRESENTLY I AM READING A BOOK MASTERING PYTHON ALGORITHMS. IT MAKES MUCH SENSE

[toc] | [prev] | [next] | [standalone]


#78130

Fromvek.m1234@gmail.com
Date2014-09-22 02:10 -0700
Message-ID<065fb41c-8398-461d-b71f-103824160c7d@googlegroups.com>
In reply to#78128
1. Python Essential Reference, Python Standard Library by Example/Dive into Python
2. C (K.N.King), C++(Eckel), Python, Make, GCC, Lex/Yacc/Bison, Some HTML/CSS/XML/Javascript/XLTS+Python

3. I don't like Java much - never tried it.

[toc] | [prev] | [next] | [standalone]


#78173

FromDave Angel <davea@davea.name>
Date2014-09-22 14:03 -0400
Message-ID<mailman.14226.1411408859.18130.python-list@python.org>
In reply to#78127
ngangsia akumbo <ngangsia@gmail.com> Wrote in message:
> I have learned python for some time now. I am developing apps using django. 
> 
> I need some advice.
> I want to be able to write big programs using python. I have not been able to do that as of now.

Define'big'.  I could write a 25 line Python program that
 generates gigabytes of useful data. Or I could write 100,000
 lines of assembler that could have been done in 1000 lines of
 some other language. When you say you haven't been able to do
 (something), just what has been stopping you? 

> I need a way forward on what more free ebooks i can get mt hands on so i can accomplish my goals.
> 
> I need some advice. should i go on to learn other languages like java or c++ cos i want to be able to using all these knowledge for games, desktop, mobile and web.

You certainly should learn other languages.  I used about 35
 during my career.  But until you've mastered one, c++ and Java
 will probably be more confusing than helpful.  There are others
 you probably need first,  such as html, css, regex. And other
 skills,  such as a debugger,  profiler,  customizable editor.
 

> 
> i start learning java and i seem it is more real life. 

Do you mean because it makes you work harder? I've used both, 
 though not on the same project.  And java isn't the tool I'd
 reach for, for most purposes. 

> it looks real that python.

This sentence isn't.  Perhaps you intended a comma after 'real',
 or some more words at the end.


-- 
DaveA

[toc] | [prev] | [next] | [standalone]


#78180

FromChris Kaynor <ckaynor@zindagigames.com>
Date2014-09-22 12:00 -0700
Message-ID<mailman.14232.1411412441.18130.python-list@python.org>
In reply to#78127

[Multipart message — attachments visible in raw view] — view raw

On Mon, Sep 22, 2014 at 11:03 AM, Dave Angel <davea@davea.name> wrote:

> > I need a way forward on what more free ebooks i can get mt hands on so i
> can accomplish my goals.
> >
> > I need some advice. should i go on to learn other languages like java or
> c++ cos i want to be able to using all these knowledge for games, desktop,
> mobile and web.
>
> You certainly should learn other languages.  I used about 35
>  during my career.  But until you've mastered one, c++ and Java
>  will probably be more confusing than helpful.  There are others
>  you probably need first,  such as html, css, regex. And other
>  skills,  such as a debugger,  profiler,  customizable editor.


A lot of what you should learn will depend on what you want to do.

As a rule-of-thumb I'd recommend sticking to one or two high-level
languages until you are reasonably comfortable with them, then possibly
branching to other languages. As you've already started with Python, I'd
continue on it for a while. Possibly throw in Javascript/HTML/CSS for
web-development - for server-side code you could look in the to various
Python web frameworks, or learn PHP for those.

Once you are comfortable with at least one of those, you can consider
branching off into other languages as your projects need.

A few languages and their major strengths:

   - Python is pretty good base-line language. It is really good as a glue
   language to piece together other components, or for IO-bound or user-bound
   code, but will not preform well enough for many other applications such as
   games. It is good for short parts of games, but a full next-gen engine
   would be much too slow if written in pure Python, however Civilization 5
   uses Python as its scripting language. There are also libraries available
   that can provide enough performance to do basic games in Python.


   - C# is another good base-line language, although its much more limited
   to Windows (there are ways to run it on Mac and Linux, but not as easily).
   The main benefit it has is that, if you have Visual Studio, you get a nice
   UI designer built-in. Overall, this is a decent option for Windows-only GUI
   applications, and can be expanded with other libraries to other platforms,
   including many mobile platforms. Some web-servers can also run it as a
   server-side language.


   - Javascript is basically a necessity for web-based applications, as it
   is the only language that is commonly runnable across all browsers. There
   are, however, compilers that can (with some success) convert other
   languages to Javascript. (note: Javascript runs in the browser, primarily)


   - PHP is another commonly used web language, and is widely supported by
   servers. Anymore, there are also good Python libraries available for
   server-side webpages, although whether you can use them will depend on the
   server you are using. For some of the free servers, even PHP may not be
   supported, and you will only be able to do static sites (no server-side
   code).


   - C/C++ are both low level, and therefore generally harder to learn but
   provides much better performance than many other languages. I'd recommend
   putting these off until you are more comfortable with other, higher-level
   languages.


   - LUA is a commonly used scripting language for games. You'll find many
   engines have LUA support, as it tends to be very light-weight. I'd only
   recommend LUA if you want to program in one of those engines. World of
   Warcraft is one game I know of that has public support for LUA when making
   UI mods.


   - Objective-C is one of the main languages used for IOS (Apple)
   development.


   - Java is a commonly used language for Andoid development.

Chris

[toc] | [prev] | [next] | [standalone]


#78193

Fromwxjmfauth@gmail.com
Date2014-09-22 23:22 -0700
Message-ID<39cc7608-8ddf-49f6-968f-a6c5cd6b9f35@googlegroups.com>
In reply to#78180
Le lundi 22 septembre 2014 21:01:07 UTC+2, Chris Kaynor a écrit :
> 
> 
> 
> 
> A few languages and their major strengths:

> Python is pretty good base-line language. It is really good as a glue LUA is a commonly used scripting language for games. You'll find many engines have LUA support, as it tends to be very light-weight. I'd only recommend LUA if you want to program in one of those engines. [...]


Well...

http://www.luatex.org/index.html

Luckily for the end users. And luckily for "TeX".
How would it be possible with this absurd Flexible String
Representation with does the opposite (memory and
performance) of the implementation of the coding schemes
endorsed by Unicode(.org)?

jmf

[toc] | [prev] | [next] | [standalone]


#78182

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-09-22 13:39 -0600
Message-ID<mailman.14234.1411414836.18130.python-list@python.org>
In reply to#78127
On Mon, Sep 22, 2014 at 1:00 PM, Chris Kaynor <ckaynor@zindagigames.com> wrote:
> Python is pretty good base-line language. It is really good as a glue
> language to piece together other components, or for IO-bound or user-bound
> code, but will not preform well enough for many other applications such as
> games. It is good for short parts of games, but a full next-gen engine would
> be much too slow if written in pure Python, however Civilization 5 uses
> Python as its scripting language. There are also libraries available that
> can provide enough performance to do basic games in Python.

Correction: Civilization 4 used Python for scripting. For Civilization
5 they switched to Lua, I believe for performance-related reasons.

[toc] | [prev] | [next] | [standalone]


#78184

FromChris Kaynor <ckaynor@zindagigames.com>
Date2014-09-22 14:59 -0700
Message-ID<mailman.14236.1411423206.18130.python-list@python.org>
In reply to#78127

[Multipart message — attachments visible in raw view] — view raw

On Mon, Sep 22, 2014 at 12:39 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:

> On Mon, Sep 22, 2014 at 1:00 PM, Chris Kaynor <ckaynor@zindagigames.com>
> wrote:
> > Python is pretty good base-line language. It is really good as a glue
> > language to piece together other components, or for IO-bound or
> user-bound
> > code, but will not preform well enough for many other applications such
> as
> > games. It is good for short parts of games, but a full next-gen engine
> would
> > be much too slow if written in pure Python, however Civilization 5 uses
> > Python as its scripting language. There are also libraries available that
> > can provide enough performance to do basic games in Python.
>
> Correction: Civilization 4 used Python for scripting. For Civilization
> 5 they switched to Lua, I believe for performance-related reasons.
>

I stand corrected. A quick search shows you are correct, for all of Civ4
using Python, Civ5 using Lua, and the primary reason being performance.

[toc] | [prev] | [next] | [standalone]


#78188

FromChris Angelico <rosuav@gmail.com>
Date2014-09-23 10:55 +1000
Message-ID<mailman.14240.1411433702.18130.python-list@python.org>
In reply to#78127
On Tue, Sep 23, 2014 at 5:00 AM, Chris Kaynor <ckaynor@zindagigames.com> wrote:
> As a rule-of-thumb I'd recommend sticking to one or two high-level languages
> until you are reasonably comfortable with them, then possibly branching to
> other languages. As you've already started with Python, I'd continue on it
> for a while. Possibly throw in Javascript/HTML/CSS for web-development - for
> server-side code you could look in the to various Python web frameworks, or
> learn PHP for those.

Let's start with application programming languages... pick up the
other languages separately. I'd strengthen the recommendation: As
you've already started with Python, and as Python is an excellent
language, I'd recommend continuing with it for a good while. Don't
bother with PHP.

> A few languages and their major strengths:
>
> Python is pretty good base-line language. It is really good as a glue
> language to piece together other components, or for IO-bound or user-bound
> code, but will not preform well enough for many other applications such as
> games. It is good for short parts of games, but a full next-gen engine would
> be much too slow if written in pure Python, however Civilization 5 uses
> Python as its scripting language. There are also libraries available that
> can provide enough performance to do basic games in Python.

Agreed (with the minor correction re Civ 4/5 and Lua, per other
posts); but you'd be amazed how much can be done in the "slow
language". There are two common models for mixing Python and some
lower-level, higher performance language: either you use the high
performance language as the main program and then script a few parts
in Python to make them customizable, or you use Python as the main
program and use the other language to do the heavy lifting via
well-defined API calls. The latter is extremely well-suited to
heavy-duty mathematical computation - you can do enormous amounts of
work with numpy, and all the grunt-work is done in Fortran, even
though you just write pure Python code.

> C# is another good base-line language, although its much more limited to
> Windows (there are ways to run it on Mac and Linux, but not as easily). The
> main benefit it has is that, if you have Visual Studio, you get a nice UI
> designer built-in. Overall, this is a decent option for Windows-only GUI
> applications, and can be expanded with other libraries to other platforms,
> including many mobile platforms. Some web-servers can also run it as a
> server-side language.

I haven't used it extensively, but I'm given to believe that mono
means C# is reasonably viable on Mac/Linux these days. You'd have to
find an expert to be sure, though.

Personally, I don't think C# has anything above other languages, if
you're writing for desktop OSes. But mobile is a completely different
story, and if you can write one codebase that runs on Windows, Mac,
Linux, and whatever phone you're targeting, that's a huge win.
Otherwise, though, don't bother learning C#, at least for now.

> Javascript is basically a necessity for web-based applications, as it is the
> only language that is commonly runnable across all browsers. There are,
> however, compilers that can (with some success) convert other languages to
> Javascript. (note: Javascript runs in the browser, primarily)

JavaScript/ECMAScript is the One Obvious Way to script a web page.
It's also one of the easiest languages to sandbox as a means of
allowing untrusted people to script your program. (It shares this with
Lua, which is a much less powerful language.) Sadly, it's stuck in
UTF-16 land, and that's never going to change (for reasons of backward
compatibility). Learn JS if you want to do anything even slightly
fancy with web pages.

> PHP is another commonly used web language, and is widely supported by
> servers. Anymore, there are also good Python libraries available for
> server-side webpages, although whether you can use them will depend on the
> server you are using. For some of the free servers, even PHP may not be
> supported, and you will only be able to do static sites (no server-side
> code).

A few years ago, PHP was the *only* way to write server-side code for
cheap web hosting. That's changing, but given how terrible a language
PHP is, I would say you're far FAR better off filtering web hosts down
to those that let you run Python code (even if that means paying a
little more) rather than learning PHP. Don't learn PHP unless you have
a really REALLY compelling use-case... maybe there's some existing PHP
framework that does 99.995% of what you want, and the remaining .005%
just requires a tiny bit of your own PHP code. And even then, keep
your eyes open for the possibility of outgrowing that framework.

> C/C++ are both low level, and therefore generally harder to learn but
> provides much better performance than many other languages. I'd recommend
> putting these off until you are more comfortable with other, higher-level
> languages.

Agreed. The primary job of C is to write high level languages in. :)
Secondarily, it's occasionally used for other boring jobs like C
compilers, OS kernels, device drivers, and other stuff that early
programmers can completely ignore. Eventually, you'll need to learn C,
if only to understand why certain things are the way they are at the
CPU level (for instance, do you know why 2**31 is such a common
limit?), but the more you can avoid actually coding in C, the happier
you'll be. C++ has its place, but not all that much of it... or maybe
too much of it, I'm not sure which. It's trying to stretch upward into
the domain of high level languages, and stretch downward into "C but
with a few more features", and I'm not convinced it's doing a good job
of balancing the two.domains.

> LUA is a commonly used scripting language for games. You'll find many
> engines have LUA support, as it tends to be very light-weight. I'd only
> recommend LUA if you want to program in one of those engines. World of
> Warcraft is one game I know of that has public support for LUA when making
> UI mods.

Lua is a much simpler language than ECMAScript, incredibly
light-weight, and easily sandboxed. It doesn't work with Unicode (I
think its string type is eight-bit, so you have to work with encoded
bytes), which is a serious downside in my opinion. Learn Lua if you
want to work with something that embeds it. Otherwise, don't bother
for now.

> Objective-C is one of the main languages used for IOS (Apple) development.
>
> Java is a commonly used language for Andoid development.

Learn these if you want to develop for their corresponding phones.
Java has other roles, too, but IMO nothing you can't do with Python.
And thanks to Jython, you can even use Python to call on Java-specific
libraries.

So, that's application languages. What about other types of language?

* SQL is the one and only database query language you should ever need
to bother with. (You might skip SQL too, if you use something like
SQLAlchemy, but you certainly won't need any other query language -
not in 2014.) It's well worth getting to know SQL at some point;
whether you use Python, Pike, C, or any other language for the
application, your SQL code will be the same.

* HTML5 is the one obvious way to build web pages, these days. Don't
bother with XHTML, older versions of the HTML standard, or any of the
other tweaks; just put "<!doctype html>" at the top of your file and
follow the HTML5 standard. Yes, it's not fully stable yet, but the
core isn't changing, so you're safe.

* bash scripting and bash command lines are the One Obvious Way to
execute lots of commands, on any sort of POSIX system. Get to know the
shell ecosystem - the nature of bash pipelines and so on, plus the
standard POSIX tools. Combining 'find' with some other program is one
of the easiest ways to do sweeping changes to a subset of files on
your system.

* English. Yes, really. It's not a programming language, but your code
looks better if all your text strings, comments, variable names, etc
are correctly spelled. (Particularly so if they end up as part of a
communication standard. I'm looking at you, Referer!)

Not every language will be important to every programmer, but I'd say
the above four are going to be the most useful to someone who already
knows Python.

ChrisA

[toc] | [prev] | [next] | [standalone]


#78218

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-09-23 08:48 -0600
Message-ID<mailman.14265.1411483755.18130.python-list@python.org>
In reply to#78127
On Mon, Sep 22, 2014 at 6:55 PM, Chris Angelico <rosuav@gmail.com> wrote:
> Lua is a much simpler language than ECMAScript, incredibly
> light-weight, and easily sandboxed. It doesn't work with Unicode (I
> think its string type is eight-bit, so you have to work with encoded
> bytes), which is a serious downside in my opinion. Learn Lua if you
> want to work with something that embeds it. Otherwise, don't bother
> for now.

Apart from the Unicode issue, I'm curious what makes you describe it
as "much simpler" than ECMAScript.  Lua has coroutines built into the
language, stricter typing than ES (still not as strict as Python, but
at least you don't have to deal with a === operator because the ==
operator is broken), operator overloading, iterators, block-level
scoping, closure construction that binds loop variables the way the
programmer expects (unlike both Python and ES), and associative arrays
that allow arbitrary keys rather than coercing the keys to strings.

> * SQL is the one and only database query language you should ever need
> to bother with. (You might skip SQL too, if you use something like
> SQLAlchemy, but you certainly won't need any other query language -
> not in 2014.) It's well worth getting to know SQL at some point;
> whether you use Python, Pike, C, or any other language for the
> application, your SQL code will be the same.

SQLAlchemy lets you use SQL without actually writing SQL, but I would
argue that it's still basically necessary to understand SQL and what
the SQLAlchemy calls translate to in order to use it.

[toc] | [prev] | [next] | [standalone]


#78219

FromChris Angelico <rosuav@gmail.com>
Date2014-09-24 01:08 +1000
Message-ID<mailman.14266.1411484891.18130.python-list@python.org>
In reply to#78127
On Wed, Sep 24, 2014 at 12:48 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Mon, Sep 22, 2014 at 6:55 PM, Chris Angelico <rosuav@gmail.com> wrote:
>> Lua is a much simpler language than ECMAScript, incredibly
>> light-weight, and easily sandboxed. It doesn't work with Unicode (I
>> think its string type is eight-bit, so you have to work with encoded
>> bytes), which is a serious downside in my opinion. Learn Lua if you
>> want to work with something that embeds it. Otherwise, don't bother
>> for now.
>
> Apart from the Unicode issue, I'm curious what makes you describe it
> as "much simpler" than ECMAScript.  Lua has coroutines built into the
> language, stricter typing than ES (still not as strict as Python, but
> at least you don't have to deal with a === operator because the ==
> operator is broken), operator overloading, iterators, block-level
> scoping, closure construction that binds loop variables the way the
> programmer expects (unlike both Python and ES), and associative arrays
> that allow arbitrary keys rather than coercing the keys to strings.

Mainly that's based on a feeling, rather than anything specific; I've
worked with both Lua and JS from both ends (although the extent of my
experience with embedding Lua is an evaluation exercise only; the
project ended up going with ECMAScript via the V8 engine, which was
the other major choice), and Lua seems rather less featured. Partly
this might be a consequence of using a very full-featured JavaScript
implementation (V8), but it felt like embedding Lua meant doing a lot
more of the work myself. Also, from the script writer's point of view,
Lua's table type seems less powerful than the JS object, although that
may be a flawed appearance due to my greater experience with the
latter.

In any case, it fits into a very specific niche: you learn Lua if you
want to script something that offers Lua scripting. That's technically
the same as the JavaScript niche, except that there's a really big
"something" that everyone wants to script, and that's web browsers.
(Plus, node.js means you can write server-side code in JS, though
personally I wouldn't recommend it; I've seen nothing that node.js can
do that Python with a good framework can't do just as easily, and
without UTF-16 baggage.)

>> * SQL is the one and only database query language you should ever need
>> to bother with. (You might skip SQL too, if you use something like
>> SQLAlchemy, but you certainly won't need any other query language -
>> not in 2014.) It's well worth getting to know SQL at some point;
>> whether you use Python, Pike, C, or any other language for the
>> application, your SQL code will be the same.
>
> SQLAlchemy lets you use SQL without actually writing SQL, but I would
> argue that it's still basically necessary to understand SQL and what
> the SQLAlchemy calls translate to in order to use it.

What I'd say is that you have to understand database design. There are
concepts that go beyond the actual language used (figuring out what a
table's primary and unique keys are, handling joins, knowing how to
trace logical structure through a series of tables, etc) that you're
never going to get away from. With a framework like SQLAlchemy, you
shouldn't have to worry about things like the esoteric quoting rules
of different DBMSes (why, oh why, can't we just stick to the standard
- 'quoted string', "identifier", and not use backticks at all??), but
you still have to craft a sane database structure.

When I say that you won't need any *other* query language, I mean that
you're unlikely, in 2014, to use the BTrieve API calls that I worked
with in the 1990s to interface with Pastel Accounting, nor the DBase
calls that manipulate those fragile .dbf files that oh so easily get
damaged if two people try to use them at once, etc, etc, etc. You
might use a wrapper around SQL if you choose, but certainly if you
know SQL you should be able to handle any database. And that's a Good
Thing.

ChrisA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web