Is the Perl programming language useful?

Click For Summary

Discussion Overview

The discussion revolves around the usefulness of the Perl programming language in the context of physics work, particularly for beginners in programming. Participants explore alternatives to Perl, such as Python and C++, and share their experiences and recommendations regarding programming languages suitable for physics applications.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions the utility of Perl in physics, suggesting it may not be suitable due to its text-based nature.
  • Another participant recommends Python over Perl, citing its availability of physics-related modules and ease of use for computations.
  • A different participant mentions that while Perl is good for text-like data sets, Python is cleaner and easier to learn, making it more suitable for physics applications.
  • Some participants express that Perl has special capabilities but argue that Python is more widely supported in physics and engineering contexts.
  • There is a suggestion that C++ may be useful for computationally intensive tasks, but it is viewed as a larger investment in terms of learning compared to Perl or Python.
  • One participant shares a personal anecdote about the complexity of Perl and how it can lead to bad programming habits, contrasting it with the simplicity of Python.
  • Another participant echoes the sentiment that Python has been a positive programming experience and highlights the quality of its online documentation.

Areas of Agreement / Disagreement

Participants generally agree that Python is a better choice for physics applications compared to Perl, but there is no consensus on the overall utility of Perl itself. Some participants express a preference for Perl in specific contexts, while others advocate for Python or C/C++ based on different criteria.

Contextual Notes

Participants express varying levels of familiarity with programming and its applications in physics, leading to differing opinions on the best language to learn. There are also mentions of specific resources for learning Python, but no definitive recommendations for learning Perl.

Who May Find This Useful

Individuals interested in programming for physics, particularly beginners looking for guidance on which programming language to learn for computational tasks.

The_Z_Factor
Messages
70
Reaction score
0
Hello all, I was wondering, since I read in a document that programming is used a lot in physics work, if Perl programming was any use? I don't know much about programming or even computers for that matter all I know is that Perl is mostly a text based programming system and I assume that its not used because its not binary? I picked up a few Perl books and that helped me understand the basics, I didnt get too far into it before sending it back to the library, too much work going on at the time. But if I was to pick up a book at a library that would help me with later physics work in college, to get a basic idea, what type of programming should I try and learn? C++ or C? Any tips?
 
Technology news on Phys.org
I would probably recommend Python over Perl for physics. Python has a number of physics-related computation and visualization modules available, such as SciPy and VPython. It would be worth learning one of C(++) or Fortran for extremely computationally intensive tasks, but for most quick and dirty computations, Python should suffice.
 
Ah, thanks, any idea where I could find a book that could teach that? The only books my library has are JavaScript and Perl and C(++).
 
The o'reilly book learning python is pretty good.
Or the online tutotrials http://docs.python.org/tut/
For maths there is a (free) heavy duty numerical add-in http://numpy.scipy.org/

Python is as easy to use as Perl but has rather clearer and less confusing syntax.
 
Not so sure if I would say easy personally, haha. But thanks for the links, I'll definitely check them both out.
 
I'm going to echo these guys on the basis of personal experiences & preferences. "Serious stuff" ~ Python (which don't require or for some reason want to do e.g. with C++ or something related)(Python is being used & taken into use all over the place with respect to physics appls), "misc scripting, data processing etc." ~ Perl. Would also highly recommend to make sure you get a compiled language like C++ to your repertoire.
 
The_Z_Factor said:
I don't know much about programming or even computers for that matter all I know is that Perl is mostly a text based programming system and I assume that its not used because its not binary?
Perl has special capabilities that make it especially good for dealing with large text-like data sets; however it can work with "binary" and mathematics just the same as any other programming language. The difference is mostly a matter of what features of the language get the most focus.

Although I have used Perl for many years and am very fond of it, I must second (third?) the recommendation that you would be better off using Python. Python has many of the same advantages as Perl, but it is "cleaner". Perl has a lot of special rules that make it very quick and natural to use when you are writing small tools-- but, when you try to write large structured programs these special rules mostly get in the way. Also Perl is hard to learn, because the special rules make it so complicated, and it will teach you bad programming habits. Python on the other hand makes everything simple and clean and easily-organized. Python is also a good pick if you are going into physics simply because from what I hear Python has a lot of institutional support in the areas of Physics and Engineering. (Although for some reason Perl seems to be popular with Biologists!)

I DEFINITELY think that Perl/Python are better for your uses than C/C++. Those languages are a large investment, so to speak, and the ways in which that investment pays off will not be very useful to you personally. Perl and Python hide a lot of low-level things about programming from you, whereas C/C++ make those low-level things front and center. If you try to learn C/C++ you will probably spend all your time learning to be a "programmer" and very little actually getting anything done.

I don't know how best to go about learning Python though, sorry! But I have found that O'Reilly books are almost always good. If you go with O'Reilly though be careful though to get the "learning python" (is that the name?) book and not the "programming python" book, because the "programming python" book is all about advanced techniques assuming you already know the language. (I made this mistake once myself...)
 
I don't know a thing about physics programming, so maybe I should be ignored. On the other hand, maybe not, since I'm just echoing what's already been said.

There's some quote about Perl that I just can't seem to find that basically says that the problem with Perl is that if you write a program with it and then come back to look at it the next day, you won't have a clue what its supposed to do.

Programming in Python has been one of the best experiences of my programming life. It seems to make everything easy enough and the online tutorial/documentation is great. I would definitely use it for everything if I were still programming.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
1K
Replies
86
Views
3K
  • · Replies 43 ·
2
Replies
43
Views
8K
Replies
38
Views
4K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 397 ·
14
Replies
397
Views
22K
  • · Replies 102 ·
4
Replies
102
Views
4K
  • · Replies 59 ·
2
Replies
59
Views
9K
  • · Replies 8 ·
Replies
8
Views
3K