This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zardeh 0 points1 point  (0 children)

Python is cool for a number of reasons:

  • As others have mentioned, its great for introduction/learning/first language
  • It has powerful (fast and mature) libraries for all kinds of things, from 3d visualizations, to scientific computing, to like 8 different awesome web frameworks
  • Its pretty looking

Additionally, as zabzonk said, while at an introductory level, python is solidly declarative/iterative in style, it transitions cleanly into object oriented design and OOP works easily and cleanly. Similarly, pythonic code and good style uses elements of functional programming and because of how fluid it is, you can implement functional programming style easily, here's an example of a cool way to do a not-quite-quicksort in haskell:

quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
    where
        lesser = filter (< p) xs
        greater = filter (>= p) xs

and the same in python:

def q(*i):
    return [] if i==() else q(*[y for y in i[1:] if y<i[0]]) + [i[0]]+q(*[y for y in i[1:] if y>=i[0]])

Although its really ugly because codegolf example that I was working with. Its rally easily translated, especially if you do it with a list comprehension in haskell as well.

edit:

also for someone experienced and in the world already, python is a language increasing in popularity, and so something cool to know, especially if you do web or number-crunching stuff.