What other Language synergizes well with Python? Need Advice [closed] - python

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language.
What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot
EDIT -
Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it.

What is wrong with IronPython or Jython? You can learn how to write libraries in Java or .Net to alleviate some of Python's speed problems. Learning to write your own Python libraries will certainly help you better understand and overcome the limitations you mentioned.

For me, the obvious choice to learn after Python is C. C is a lower level language, so you're dealing with more elemental computer concepts than objects, but it will give you the understanding necessary to write extensions to Python.
That way, it will be easy to write your programs in Python, and then migrate parts to C for speed--either by writing an extension or by using a bridge language like Cython.

If you run into performance problems (which might be an issue in game programming), C/C++ programs can be integrated well into Python scripts and vice versa:
Extending and Embedding
Python/C API
But I haven't yet seen the need to do so myself.

When you're quite comfortable with Python, Common Lisp and Scheme are good languages to learn about functional programming. I've been learning CLisp myself lately and there are a lot of "ahah!" moments that make it a lot of fun.
IronPython and Jython are great tools to learn if you plan on entering the professional world - there is tons of development right now in C# and Java - they're pretty much the hot languages of the professional world. IronPython integrates with all of the .NET languages, while Jython of course integrates with Java. So your choice there should reflect your desire to work at a .NET company, or not. Both IronPython and Jython are well matured languages.
Others have already mentioned C/C++ which are good choices if you're not familiar with them, and if ~30-40 years of programming life, and Top 3 rankings for July 2010 on the TIOBE index is not a strong enough reason to learn them... well you probably have other issues ;)
If you're looking at newer languages that haven't really been tested hard-core, you have languages like Ruby (which seems to be the new sexy), and Go by Google.
Perl is a bit like Ruby in that there is quite an overlap between Python and Ruby/Perl, and the areas they cover.
If I were to pick another language, already knowing Python, I'd go with a compiled language - maybe lower level like C\C++. I guess it really can be determined by what you want to do. If you want to work for a .NET company (which may or may not imply you really love Microsoft products), IronPython and a .NET language (C#, VB) is the way to go. OTOH, if you want to work for a company like Google (which happens to employ a certain individual), they extensively use Java and Python, so it's probably better to learn Jython.
I guess the question you need to ask yourself is, "Where do you I want to go today tomorrow?™"

Haskell or Ocaml, or maybe a Lisp dialect such as Common Lisp or Scheme.

Related

What should people new to Python know about its community and ecosystem? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm cobbling together some sort of an introduction to Python, but one that focuses on the community and the ecosystem around Python rather than just the language. With How to Think Like a Computer Scientist and other great tutorials, it's easy to get familiar with the language, but it took me a fair while before I knew what The Cheese Shop, or, err, PyPi is about, how pip and virtualenv work and why you should use them, where you should go for help, the interesting blogs that you should follow, how your code should look (PEP 8, writing pythonic code) and so on. The 'soft stuff'.
What confused you the most when you just started out with Python? Are there certain things that you would've wanted to know about, or resources you wish you would have stumbled upon earlier than you did? People to know about?
I found a few similar questions on StackOverflow (e.g. here) but nothing really close to what I'd like to hear from you guys. Hope this question doesn't feel too subjective to your tastes :-)
(And, if you'd like to help out, feel free to send a message.)
I think one of the most important thing a beginner need to know about Python ecosystem is that it's a general purpose language surrounded by specialized libs. Experienced pythonistas know them, but a newbie can't:
Don't stop to tkinter : go wx, gtk or qt.
Don't dev web code by hands : use TurboGears, Pylons, Web.py or Django.
Don't parse HTML / XML with hard tools : use lxml or beautifulsoup.
Don't make syscall to imagemagik : use PIL.
Don't make advanced maths manually : use NumPy and SciPy.
Don't access simple databases by hand : use ORM like SQLAlchemy.
Don't reinvent sysadmin wheels : use Fabric.
etc.
The main ones should be listed in a book with guidances to choose among them.
"What confused you the most when you just started out with Python?"
Rule 2 of learning Python: Any general-purpose module or framework you think you want has already been written. Several times.
The hard part is realizing that your idea is
Not unique.
Been already improved upon before you even starting thinking about it.
Already posted somewhere.
So, code less and search more. Search widely and flexibly until you find things that are similar to what you want to do.
Realize that you might have a name you think is descriptive. But other folks may call it something different. Join the community, adopt their naming. You may not like the phrase "ORM", but that's what it's called.
Realize that your idea, no matter how sound it seems, may be really poor. When you find a framework that seems to have "needless extra features", you may be missing something from your idea.
Realize that your idea, no matter how "intuitive" it seems, may be really poor. When you find a framework that seems "counter-intuitive", the problem could be yours. Learn theirs first, then compare and contrast after you've mastered theirs. Until you've mastered theirs, keep searching and learning.
A few points related to the ecosystem and indirectly the community:
I wished I had been reminded more about the Batteries included. I think people should be told to print-out the Table of Contents of the Standard Library and keep it under their pillow, for frequent reviews (that advice, I finally took, several years into it, from an online intro/beginner's video presentation!). The [relative] stability, extensive but relevant content of the Std Lib speaks to the thoughtful governance of the community leaders and its beloved BDFL.
I think newcomers can also be "warned" (the word is maybe too strong, too unfair) about the extreme variety of PiPy. This reflects the vibrant, smart and diverse (in terms of background, domain of application, interests...) collective of users and contributors. This however can be overwhelming and possibly risky as all packages in there are not "prime time ready" (But many are and "saved my life" many times over).
Even if you feel too new to Python, don't only use the libraries, do peek under the hood! This is true of many languages, but maybe particularly of Python, there's much to be learned from perusing various source code. The reasons this may be particular true for Python are intrinsic to the language itself (multi-paradigms, hi level of abstraction...) but also because of the relative uniformity of coding (and architecting) style and because of the general level of collaboration within the community.
"What confused you the most when you just started out with Python?"
Rule 1 of learning Python: Use the Source, Luke.
There are question on SO asking for "good" source from which to learn Python. The best answers amount to "read the libraries that came with Python."
One can say that the libraries that come with Python are quirky. In places. Which makes them all the better for learning from.
There's a community of like-minded people who are not clones.
Open source software is the highest-quality software you'll ever get to work with, but it's not created by paid developers who will rigidly enforce standards.
explaining what a PEP is, how it is written and who wrote them, where we can find them. PEPs give a lot of background informations about a specific feature of the language. they also are the tool which shows how fast evolving python is.
(i wish i had read some PEPs earlier, but i was not really aware of them, although they are frequently linked in the manual)
From PEP 20:
import this
(aka, the Zen of Python)
developing a python package that can be installed with easy_install etc... I consider it equivalent to developing a jar or dll etc....
on the same token, developing said package(s) with virtualenv or buildout
If I would have known those things sooner, I would have probably used python for more than just scripting way back when I first started using it.

Alice vs Python for someone with zero experience [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
My brother would like to learn some programming to find out if he'd enjoy doing it. He's 16 and doesn't know much about computers in general and knows nothing about programming in particular.
I'm thinking about picking either Alice or Python. I see Think Python is the often recommended read, but isn't it a bit too much (size-wise) for a beginner? It's certainly not too complicated, but I'm not that optimistic about my brother... :) Anything else he could try that would be smaller and VERY simple?
Also, has anyone had any experience with Alice? I myself wouldn't really want to start programming this way, but I can see why the visual aspect might be more attractive to certain people. I'm just not sure how limiting it is and if the time used learning the pseudo language wouldn't be better spent learning a real one.
EDIT: Thank you for your replies. I guess we'll go with Python. However, as I mentioned above, isn't "Think Python" a bit too extensive for a complete "newbie"? Any other, but simpler Python programming introductions you could recommend?
The advantage of Python is that - should he be bitten by the bug - there's massive a community and lots of resources to drawn on and explore.
If he's not bitten by Python, then programming might be a hard sell anyway, so I don't see the advantage of starting on logo-likes, even 3D ones like Alice. Alice can of course be fun, as can writing Lua scripts to extend a mainstream game title. But all the hardcore programmers in their thirties now seem to have started on Turbo Pascal or even assembler when they were around 16, and Python offers an approachable modern-day equiv.
Use Python. It's very simple. It will let you make "Hello World" in one line, and also let you do any range of powerful things down the road.
It's great for beginners because of the minimalist syntax, and it also forces you to indent your code properly.
Even a non-programmer can understand Python:
print "hello world"
you = True
if you:
print "I bet you think this program is about you, don't you, don't you?"
a = 1
b = 1
c = a + b
Another nice thing about Python is it is interpreted, so you can open up a terminal and just play around.
I've never used (or even heard of) Alice, but I second your thought that it's better spending the time learning a real language.
Rather than going through a whole book, he may prefer to do something practical. One great possibility is PyGame, a whole framework for producing games in Python - that might appeal to him and get him interested.
My wife Anna, who's very skilful and experienced in training people (especially newbies and kids) as well as a Python semi-guru (I'm the other half, but not a training expert), hotly recommends the book "Hello World" -- I haven't read that book myself (nor do I know much about training newbies or kids, I've only taught professionals, engineering students in college, etc) -- but I've seen her going through it with a highlighter (using it heavily while nodding her head vigorously and making approbatory remarks) and many enthusiastic comments have emerged from her about it.
Alice seems a bit young for a 16 year old guy... I (being a 16 year old guy) would not want to learn in a way that seems patronizing... lol.
A lot of people start with Python, and its a great way to get into programming. When I was 14, I started with web development, which lead to PHP, which lead to javascript. Then I branched off and learned C for memory management in a lower level language, and then Ruby + Python to learn another interpreted language then Scheme to learn the functional paradigm, then Objective-C and then Java, C++ and C#. So it depends what he wants to focus on. If he wants to do web work, I suggest he learn HTML (it is a great way to get into computers without being a real "language"), then PHP (even though a lot of people here don't like it, its a good first language) and then javascript and possibly Ruby. If he wants to get into Windows programming, I suggest he learn C, C++ and C# and Python, starting with Python (or C if he daring...). If he wants to learn Mac Programming, learn C, Objective-C and either Ruby or Python. Then you can branch off from there. Some people recommend Java as a first language... I'm not a huge java fan, but it is a very good candidate.
I found that a fantastic way to learn (especially when your younger) is through video tutorials. I learned PHP through Lynda.com tutorials. They are great and cover the basics and beyond. You can get a free trial (http://www.lynda.com/promo/freepass/Default.aspx?lpk35=240) and try it out. I think that is one of the best ways to go IMHO. Once you know the basics through the video series, you can go on to reading manuals for other languages (like Python), but manuals can be daunting if its your first time. Depends what kind of learner he is.
You can learn some bad practice in PHP, so its best to watch the series to get some programming basics, then go on to read about another languages.
If he'd rather learn C first (some people prefer learning it first) http://vtc.com/ has a great C series of video tutorials.
Good luck!
If you don't mind spending some money on a book (about $20 from Amazon.com), you could try Python Programming for the Absolute Beginner by Michael Dawson. I have skimmed it (a coworker's copy) and it is extremely basic, assuming no programming experience. It's written in an approachable, casual style; and builds up gradually to games with Pygame. Obviously it's best if you can find it at a brick-and-mortar store to check it out yourself.
Quick general recommendation in case you haven't already thought of it: Use Python 2.x rather than 3.x. The book I mentioned, and probably 98% of all other existing books, tutorials, and third-party modules (including, crucially, Pygame) have not yet switched over to 3.x, and probably will not for at least a few more years.
[Oh, and I was just reminded of another beginner book candidate while checking out the Pygame site to confirm that it doesn't work with Python 3.x: Hello World!
Computer Programming for Kids and Other Beginners by Warren D. Sande and Carter Sande. I have not personally seen this book at all, but Guido van Rossum himself has reviewed it. It strikes me as a bit too kid-focused for a 16-year-old, but it may be worth checking out.]
Having gone through the Alice website, I wouldn't be too hopeful, it seems like a platform for a bunch of people to charge for texts, and workshops. Really, python has a billion beginner tutorials and that'll pay off. While Alice will remain relatively unknown. Much depends upon what your brother, not you, want to accomplish. Does he want to 'learn' programming? Or maybe he sits on facebook all day, and would benefit from learning php so he can do things against the facebook API, or what have you. I would worry more about the activity, than the language he starts with. Assuming, he's got someone to ask questions.
And about the best thing you can do is have some confidence in him, and encourage your brother.
I think programmers are the last group of people you should ask for such advice. Mostly because you'll get fairly predictable responses about how Alice and the visual interface seems condescending, and why would one not just learn how to do it the proper way. I've often used the "python as executable pseudocode" line myself. But, beleive it or not, there are many, many people out there who don't grok pseudocode all that quickly and give up on programming. To a large degree, most people on this forum are programmers because they "got it" pretty quickly.
You know your brother best, and might choose or tailor an approach best suited to the way he grasps ideas, concepts, etc. In evaluating Alice, you should at least consider the actual studies and papers written by educators:
http://www.alice.org/index.php?page=publications/publications
Also see the answers by John Y and Alex Martelli, which consider the opinion of other educators.
(Incidentally, one of the people behind Alice was the late Randy Pausch of CMU, who made headlines a while back based on his "last lecture".)
Alice is python underneath (from here). There are people who use both together. So it's a double head fake.
"The head fake is that they're learning to program, but they just think they're making movies and video games" -Randy Pausch
For those who want to program and/or recognize that Alice is programming, they don't know they learned some of a useful programming language which they might have thought was boring if presented by itself.
AUTHORING ALICE PROGRAMS
Alice programmers write in Python
[PYTHON], a high-level, interpreted,
object-oriented language. Python
supports high level datatypes such as
lists and hash tables as primitives in
the language.

Newbie teaching self python, what else should I be learning? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm a newbie to programming. I had 1 semester of computer science (we used java). I got an A in the course and was able to do everything assigned, however I'm not sure I really understood it. I ignored the text and learned by looking at sample programs and then trial and error. I was ahead of the class except for two guys who came in knowing java or another OOP language.
I'd like to learn Python. I'm also going to build a second PC from extra parts I have and use linux. Basically, I want to enhance my knowledge of computers. Thats my motivation.
Now on learning python are there any good programming theory books that would be useful? Or should I read up on more on how computers operate on the lowest levels? I don't think I know enough to ask the question I want.
I guess to make it simple, I am asking what should I know to make the most of learning python. This is not for a career. This is from a desire to know. I am no longer a computer science major (it also would not have any direct applications to my anticipated career.)
I'm not looking to learn in "30 days" or "1 week" or whatever. So, starting from a very basic level is fine with me.
Thanks in advance. I did a search and didn't quite find what I was looking for.
UPDATE: Thanks for all the great advice. I found this site at work and couldn't find it on my home computer, so I am just getting to read now.
My recommendation is always to start at the high level of abstraction. You don't need to know how logic gates work and how you can use them to build a CPU -- it's cool stuff, but it's cool stuff that makes a lot more sense once you've messed around at the higher levels. Python is therefore an excellent choice as a learning aid.
How to Think Like A Computer Scientist: Learning With Python is available on the Internet and is an excellent introduction to the high-level concepts that make computers go. And it's even Python-specific.
If you're looking to have your brain turned inside-out, SICP will do a good job of it. I don't recommend it as a first text, though; it's heavy going.
Both of these books are high-level. They won't teach you anything about the low-level details like memory structures or what a CPU actually does, but that's something I would reserve for later anyway.
D'A
Specifically for the Python part of your question I can highly recommend http://www.diveintopython3.net/ by Mark Pilgrim. That's free and pretty well structured.
Python is a nice choice, you will have fun!
http://www.pythonchallenge.com/
I think this Challenge is perfect to get in touch with major python strengths and there is a nice forum with a lot of interessting Python Threads for each Level.
A lot of this depends on what your overall goal is for learning Python. Are you viewing it as learning a second language or getting a better understanding of computers and how to effectively use a programming language?
From what it sounds like you want to gain a better understanding about computers and be a better programmer. Learning a new languages such as Python will probably not help you in this respect. I still recommend learning Python if you're interested, but once you have learned one programming language, much of learning a new language is getting familiar with the syntax and data types (usually).
You had mentioned you were unsure about understanding the material in the class you took. If you feel you don't understand fundamental concepts (such as loops, classes, etc), then learning Python will help your understanding of programming as most books/guides revisit these concepts (Learning Python, 3rd Edition should help with this). If you understand these concepts, but you are unsure of how to apply these concepts, then my recommendation would be to learn about data structures and common algorithms (e.g. sorting, searching, etc).
Speaking from personal experience, I didn't know how to apply what I learned from the introductory programming class to personal programming projects. Learning about data structures from a class helped solidify those concepts I had previously learned by providing algorithms/data structures that build off of this previous knowledge. This class also allowed me to think differently about problems in terms of using these data structures.
To learn about the different types of data structures, see: http://en.wikipedia.org/wiki/List_of_data_structures. Usually, each data structure is useful for a specific purpose (e.g. binary search trees are good for searching sorted information). Unfortunately, I don't have any book recommendations (our class didn't use a book). Googling "Data Structures" should be a good starting point.
Data structures also got me to think about how efficient an implementation is. The "complexity" of an algorithm determines how long a given piece of code takes to run. This makes it easy to compare other implementations and determine which is better.
I would also like to comment that when it comes to learning computer concepts, the best way to learn is by doing. A book/class can only explain so much, and the rest you have to learn on your own. Each person learns differently, and programming is a way of taking the material you read about and think about it in a way that is best understood by you.
I hope I answered your question. At this point, you don't really need to worry about the underlying hardware. This is useful to know if you plan on doing this as a career (which you aren't), or want to make optimizations specific to the hardware you're running on (in which case, you wouldn't want to use Python). Python is a good choice to learn about data structures as it implements a lot of them for you, but it's important to know what they are used for.
If you are still in school, take a data structures class and see what you think of it. If you like it, I'd advise reconsidering the role of programming/CS in your career. You don't have to major in it, but consider a minor or at least a position that makes use of these skills you are learning. I say this because despite this not being your major, you are interested in understanding how a computer works and taking initiatives such as learning Python, building your own computer, and installing Linux.
If you have any further questions, feel free to ask. Good luck!
Python is a high-level language, so it wouldn't give you much direct benefit to learn how computers operate at the lowest levels.
Don't get me wrong - I do strongly believe that the low-level operation of a computer, e.g. assembly language and hardware, is something that every good programmer should be familiar with, because it does help you program more effectively in whatever language you are using, high-level or low-level. But it won't make much of a difference in your Python coding until you've gotten quite a bit of experience. If you're just starting out with Python, I would suggest staying away from the low-level operation of computers and concentrating on the basics of Python for now. Once you're comfortable with that, you can move on to something like C and then it might be appropriate to start looking at some lower-level stuff.
As for what you should know... not much, I guess. Python is a great language to start out programming in. It keeps simple things simple but it's rich enough to let you work your way up to a high level of complexity. I'd suggest probably looking at a tutorial; the one I happen to know is on the Python website, but I'm not claiming it's necessarily the best one for you. A Google search should give you plenty to get started with.
I started Python (as my first programming language) few months ago. I would recommend Learning Python, by Mark Lutz to begin with. But keep in mind that the key to learn well is to be open-minded, patient and willing to work and look up for things you don't understand.
Have fun!
I would suggest looking at the online book at http://www.diveintopython.org/ to learn python.
As for python projects, I would try learning the Django Framework. It is a framework for building web applications. They have a great tutorial for getting started with it. This would also give you experience building a webserver on a Linux box.
enhance my knowledge of computers
Well, what do you exactly mean by that? Python, or any other high level language, are designed to actually hide all the nasty details. That's one of the reasons, why it's apt for non-pros like (e.g. scientist).
If you want to know how stuff actually work, you should learn pure C. But then again, if you're not planning to have any career related to SC, there's not much point to it. Learn some more advanced algorithms and data structures instead. That'll result you more interesting, useful and is platform- and language-agnostic.
Short answer: all of them
Long answer:
Learning your first language is always a challenge, and after your Java experience, a lot of other languages will seem a lot simpler. That said, the real challenge in learning programming languages is learning when to use a particular language -- you can find decent docs for whatever you choose when the time comes.
As a concrete start, hop over to wikipedia and browse their categorical list of programming languages, click on all of the names you've ever heard (and anything else that catches your eye) and if the article has a code example, give it a minute or two to sink in (the rest of the article will help, of course). The point here is not to master every single language (which is (1) pointless and (2) impossible), but to get a handle on what is out there. For any language, there is a handful of other languages like it, and if you can at least read one language in most of those categories, you will have mastered a fairly large chunk of the programming universe. When a new project comes up, and something about it reminds you of some language you found, you can just learn that language as part of doing the project. It may sound like a lot of work, but after, say, your fifth big language, you completely lose count and just accidentally learn new ones all the time without noticing.
When you stop relating to one language as your home-language, you'll be able to learn from examples in other languages even if you've never programmed in them. Personally, I've only written a few Haskell programs, but being able to read Haskell has exposed me to a lot of ideas that I could recycle in more practical Scala and Python programs (oh yeah, after you learn Python, give Scala a browse and you'll probably never use Java again)
Even finding the best language for the job isn't the whole story. Having a lot of tools in your toolbox lets you throw together amazing stuff in short amounts of time by writing each piece of your project in the easiest language your could. This may not be appropriate for all projects, but, boy, can you make some impressive demos.
It takes many years to get to the point where no programming language is totally foreign (or at least foreign for more than a day of hacking), but I think it is a very healthy and realistic long-term plan to attempt to conquer a representative sample of each rough category. Good luck!
Since Python wasn't my first language, I found the Python Cookbook helpful for learning
What Python was capable of
The idiomatic, of "pythonic," way to do something.
Programming language teaching has always been associated with a cliche statement while learning. "Write programs to learn programming". I too would suggest the same.
If you are going to start from basics. This is of course, the most suggested starting point. It is lengthy, but it is worth all the time. http://www.diveintopython.org/
Because you are into some Java, this might be even better for you. http://www.swaroopch.com/notes/Python. Start either python 2.x or 3.0. Me personally am a fan of python 3. But for a starter it could be hard to get samples, and references to programs online. So for you 2.x might be better. But I leave it upto you.
Like I started "Write programs..". You can start here.
http://www.spoj.pl/ - a programming challenges site, where you can choose from a wide variety of topics, mostly algorithms and has huge question database. Of course the choice of programming languages is upto you.
http://projecteuler.net/ - a mathematical questions site, here you just have to submit an answer, cheating is allowed here, so be free to borrow logic from others, but try writing the program yourself.
After you think you have gained sufficient proficiency in python, you can try recipes in this book python cookbook http://www.amazon.com/Python-Cookbook-Alex-Martelli/dp/0596007973.
For application development, after you think you can handle it, start on wxPython or PyQt. I personally would suggest PyQt. It is responsive, fast, and has decent development cycle, I have not used WxPython for long, but few programs I wrote, long back, didn't feel so great. Yet again, its upto you.

I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
There is no advantage to be gained by switching from Perl to Python. There is also no advantage to be gained by switching from Python to Perl. They are both equally capable. Choose your tools based on what you know and the problem you are trying to solve rather than on some sort of notion that one is somehow inherently better than the other.
The only real advantage is if you are switching from a language you don't know to a language you do know, in which case your productivity will likely go up.
Python does not have Junctions. In fact I think only Perl has Junctions so far. :-)
In my opinion, Python's syntax is much cleaner, simpler, and consistent. You can define nested data structures the same everywhere, whether you plan to pass them to a function (or return them from one) or use them directly. I like Perl a lot, but as soon as I learned enough Python to "get" it, I never turned back.
In my experience, random snippets of Python tend to be more readable than random snippets of Perl. The difference really comes down to the culture around each language, where Perl users often appreciate cleverness while Python users more often prefer clarity. That's not to say you can't have clear Perl or devious Python, but those are much less common.
Both are fine languages and solve many of the same problems. I personally lean toward Python, if for no other reason in that it seems to be gaining momentum while Perl seems to be losing users to Python and Ruby.
Note the abundance of weasel words in the above. Honestly, it's really going to come down to personal preference.
Perl is generally better than python for quick one liners, especially involve text/regular expressions
http://novosial.org/perl/one-liner/
Python has one huge advantage: it's implemented, there's a rather stable compiler for it.
Perl 6 (renamed Raku in 2019) is a rather visionary language, with a stable compiler and test specification released in 2015. It has a set of very cool features, among them: junctions, grammars (yes, you can write full parsers with Raku "regexes"), unicode handling at the grapheme level, and lazy lists.
In your particular case when you know Perl 5 you'll get familiar with the Raku (née Perl 6) syntax very quickly.
For a more comprehensive list of what cool features Raku has, see https://raku.org/ or alternatively, the FAQ.
Python has a major advantage of being available in a production-ready format today.
Python has Jython and IronPython, if you need to work closely with Java or the .net clr.
Perl 6 has the advantages of being based on the same principles as Perl (1-5); If you like Perl, you'll like Perl 6 for the same reasons. (There's more than one way to do it, etc.)
Perl 6 also has an advantage of being only partially implemented: If you want to hack on language internals or help to define the standard libraries, this is a great time to get started in Perl 6.
Edit: (2011) It's still a great time to hack on the Perl6 internals, but there is now a much more mature, usable Perl6 distribution, Rakudo Star. If you want to use Perl6 today, that's a great choice.
You have not said why you want to move away from Perl*. If my crystal ball is functioning today then it is because you do not fully know the language and so it frustrates you.
Stick with Perl and study the language well. If you do then one day you will be a guru and know why your question is irrelevant. Enlightment comes to those to seek it.
You called it "Perl5" but there is no such language. :P
IMO python's regexing, esp. when you try to represent something like perl's /e operator as in s/whatever/somethingelse/e, becomes quite slow. So in doubt, you may need to stay with Perl5 :-)

Best online resource to learn Python? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?
[Response Summary:]
Some Online Resources:
http://docs.python.org/tut/tut.html - Beginners
http://diveintopython3.ep.io/ - Intermediate
http://www.pythonchallenge.com/ - Expert Skills
http://docs.python.org/ - collection of all knowledge
Some more:
A Byte of Python.
Python 2.5 Quick Reference
Python Side bar
A Nice blog for beginners
Think Python: An Introduction to Software Design
If you need to learn python from scratch - you can start here: http://docs.python.org/tut/tut.html - good begginers guide
If you need to extend your knowledge - continue here http://diveintopython3.ep.io/ - good intermediate level book
If you need perfect skills - complete this http://www.pythonchallenge.com/ - outstanding and interesting challenge
And the perfect source of knowledge is http://docs.python.org/ - collection of all knowledge
If you're a beginner, try my book A Byte of Python.
If you're already experienced in programming, try Dive Into Python.
I think Python Challenge is great.
It's not about learning Python (syntax) but presents you small and fun riddles. Solving the riddles is based on Python but you can use whatever fits (your calculator, bash scripts, Perl...). After you solved one, you get to see how others have solved it and can discuss the pros & cons of the different ways.
Very nice to get a feel for how things could be done (smart) in Python. This site works especially well if you know a bit about other scripting languages or the commandline, etc.
The tutorial at Python's homepage is a good place to start. Also, there are some screencasts here.
These are unvaluable online reference tools:
Python 2.5 Quick Reference
Python Side bar
Other online resources for beginners:
A good python blog for beginners: http://www.learningpython.com/
Python Video at Google Code
Think Python: An Introduction to Software Design
The Python tutorial is actually pretty good.
There's also a video series on showmedo about python.
Between those two resources, you should have more than enough to learn the basics!
You can look at Building Skills in Python, also. It presumes some level of experience in programming.
If you're really new, try Building Skills in Programming. It includes a lot of background and fundamentals.
Google's Python Class
Welcome to Google's Python Class --
this is a free class for people with a
little bit of programming experience
who want to learn Python. The class
includes written materials, lecture
videos, and lots of code exercises to
practice Python coding. These
materials are used within Google to
introduce Python to people who have
just a little programming experience.
The first exercises work on basic
Python concepts like strings and
lists, building up to the later
exercises which are full programs
dealing with text files, processes,
and http connections. The class is
geared for people who have a little
bit of programming experience in some
language, enough to know what a
"variable" or "if statement" is.
Beyond that, you do not need to be an
expert programmer to use this
material.
There are some screencasts on http://showmedo.com
I learned from the Python Tutorial!
+1 for Dive Into Python
The python manual
Its a bit long winded sometimes but it tells you all you need to know to get going.
PLEAC , has a Python Cookbook , which is very helpful .
Learn Python in 10 minutes
The Cookbook is absolutely essestial if you want to know idiomatic python.
I consider ActiveState's Python community to be a great resource. Also
DZone Snippets can be useful.
I first ran across Software Carpentry looking at lists of python tutorials.. but its a lot more than a tutorial on python. turns out what I really learned was how to use subversion, and that none of my projects are better suited to python than to perl... yet.
Also consider [Hands-On Python](http://www.cs.luc.edu/~anh/python/hands- on/). It is used as a primary text for Computer Science 150 at Loyola University. It is concise intro to Python while emphasizing good programming style and design.
The Hazel Tree
Python Cookbook is very useful.

Categories