Page 2 of 2

Posted: Mon May 05, 2008 1:46 pm
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.

Posted: Mon May 05, 2008 5:55 pm
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.

Yup python is good

Posted: Wed May 14, 2008 8:32 pm
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 .

Posted: Fri May 16, 2008 10:21 pm
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.

Posted: Fri May 16, 2008 10:35 pm
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.

Posted: Sat May 17, 2008 8:40 am
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.

Posted: Sat May 17, 2008 10:53 am
by DeletedAccount
I takeback my words .... was feeling sleepy ....

Posted: Sat May 17, 2008 11:26 am
by Bughunter
edit: superfluous post because SandeepMathew realized what he posted...

Posted: Wed May 21, 2008 4:24 pm
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]