python..

Programming, for all ages and all languages.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

I was playing around with Python about a week or so ago. I had just been using C++ for awhile before hand, and coming from that, there wasn't as much of a jump as I thought there would be. It had some nice syntax pleasantries and such, but nothing that made me gawk. Even the string handling wasn't too spectacular. (Compared to Perl's somewhat innate string workings, it was terrible.)

Maybe I didn't really use it long enough, or get deep enough into it, but I wasn't too impressed.
C8H10N4O2 | #446691 | Trust the nodes.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

The list comprehensions and iterators are my favourite Python features, and in the time I've been learning it I have found it to be really powerful.

The first time I used Python I pretty much wrote C style code (for i in range( 0, len( mylist ) )), until this year where the course I'm doing at uni used Python as the language of choice :D.
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Yup python is good

Post by DeletedAccount »

Yes , I agree that python is a good language . But i also code in Python the C style ... though Python has many lisp style constructs . ( we not learn python or lisp in our uni! , just C , C ++ , Java . I will learn lisp shortly and write my own intrepter for it .
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

I was playing around with Python about a week or so ago. I had just been using C++ for awhile before hand, and coming from that, there wasn't as much of a jump as I thought there would be. It had some nice syntax pleasantries and such, but nothing that made me gawk. Even the string handling wasn't too spectacular. (Compared to Perl's somewhat innate string workings, it was terrible.)

Maybe I didn't really use it long enough, or get deep enough into it, but I wasn't too impressed.
At first I came from the same C++ background and I realized that yes, Python is very similar to C++. However, I've come to realize that if you're doing any string handling or things that need a bunch of lists or anything high-level you're better off using python. Perl no doubt has its advantages(I have quite a lot of perl experience) but Perl is not as object-oriented as python is. Also, python has some really great libraries. Finally, development is simply quicker and everything is so orthogonal. It just makes simple things a lot easier.

For a major app I'd use C++ or C but for a tool or utility that I don't want to spend time on or that I plan to extend later, I would use python cuz it's simply easier.

One last thing, since python has a lot of bindings to C/C++ libraries, I find it very convenient to fire up the python interpreter to test things before I write something in C. The interactive python console allows for quick calculations too.
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post by JackScott »

iammisc wrote:One last thing, since python has a lot of bindings to C/C++ libraries, I find it very convenient to fire up the python interpreter to test things before I write something in C. The interactive python console allows for quick calculations too.
Why rewrite it in C? Python is almost as fast.
User avatar
Bughunter
Member
Member
Posts: 94
Joined: Mon Dec 18, 2006 5:49 am
Location: Netherlands
Contact:

Post by Bughunter »

Yayyak wrote:Why rewrite it in C? Python is almost as fast.
That of course depends on what you are trying to do with a language. Generally, lower level languages are faster.
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Post by DeletedAccount »

I takeback my words .... was feeling sleepy ....
Last edited by DeletedAccount on Sat May 17, 2008 11:51 am, edited 4 times in total.
User avatar
Bughunter
Member
Member
Posts: 94
Joined: Mon Dec 18, 2006 5:49 am
Location: Netherlands
Contact:

Post by Bughunter »

edit: superfluous post because SandeepMathew realized what he posted...
Last edited by Bughunter on Wed May 21, 2008 4:56 pm, edited 2 times in total.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

Why rewrite it in C? Python is almost as fast.
Well I usually program quite low-level stuff like virtual machines, operating systems, and libraries that need to be really fast so I value speed. However, you're right. When I write something like a utility or almost anything with a GUI, I use python for simplicity. If I needed the speed, I could just use a C module.[/quote]
Post Reply