Today's Question:  What are you most afraid of as a programmer?

#### Writing API clients in Perl and Python

I recently released a couple of API clients for the Ge.tt file sharing service, one in Perl and one in Python. (I am just a fan of the service, not an employee or contractor.) I would judge myself an "intermediate" pythonista mostly due to inexperience. It's a culture shock coming from a background of CPAN. The old joke is that Perl is just a life support system for CPAN and that is arguably true, but I am here to tell you: you may not appreciate how good Perl hackers have it with respe...

API,Perl,Python,API Writing,Pattern     2011-12-23 08:02:38

#### How to teach "Modern" Perl?

Since I started my Perl Tutorial series a couple of people commented on what and how I am teaching.Some people asked why did I show "open or die" and why not using autodie. Others recommended the use IO::All instead of open.Another complaint was the introduction of time and localtime instead of DateTime.While I was mostly writing parts of my regular training material these comments led me to think about it again. I wonder how to teach Perl in 2012?When I started to write the tutorial I still cal...

Perl,Trainning,Teach,Modern,Modern Perl     2011-11-15 08:40:18

#### A Perl Regular Expression That Matches Prime Numbers

perl -lne '(1x\$_) =~ /^1?\$|^(11+?)\1+\$/ || print "\$_ is prime"' Can you figure out how it works? I give an explanation below, but try to figure it out yourself. Here is what happens when you run it: \$ perl -lne '(1x\$_) =~ /^1?\$|^(11+?)\1+\$/ || print "\$_ is prime"' 1 2 2 is prime 3 3 is prime 4 5 5 is prime 6 7 7 is prime 8 9 10 11 11 is prime Here is how it works. First, the number is converted in its unary representation by (1x\$_). For example, the number 5 gets converted into 1x5, which is ...

Perl,Regex,Regular expression,Prime number,One line     2011-12-26 08:42:00

#### Scala, Patterns and The Perl Effect

He tried to understand that one concept for a couple of months before it made sense to him. Admittedly, partial functions are not intuitive for anyone who has been schooled in traditional programming, but still, looking at the problem he was trying to solve it seemed like James was required to expend too much effort relative to the simplicity of the problem (as he pointed out, now that he understands the concept it seems straightforward). He showed me the code, and it was basically a situa...

Scala,Perl,Pattern,Partial function,Template     2011-12-21 09:25:41

#### Why every programmer should learn Python or Ruby

If you are a student, you probably know C, C++ and Java. A few know VB, or C# / .NET. At some point you’ve probably built some web pages, so you know HTML, CSS and maybe JavaScript. By and large, it is difficult to find students who have any exposure to languages beyond this. And this is a shame because there are a number of programming languages out there which will make you a better programmer. In this article, we give some reasons why you must learn Python or Ruby2. Compared to C/C++/...

#### Perl Documentation in Terms of Tasks

The core Perl community—if you care to draw lines around a group of people who use Perl seriously and call that a community—is like many other core F/OSS communities. Real work happens on mailing lists and IRC. I unsubscribed from several mailing lists and deliberately spent as little time on IRC as possible this year, for various uninteresting reasons. (I haven't even made it to the Portland Perl Mongers meetings...

Perl,Documentation,Process     2011-12-27 09:40:09

#### Helping people find good Perl tutorials

If a co-worker comes to you and asks you: "I would like to learn Perl, where can I find a good Perl Tutorial?", I am sure your would have a few recommendations. If the same person did not know you she would have to type some search term in Google and hope she found the right learning material.Recently Christian Walde (Mithaldu) asked "How do newbies find Perl learning materials online?". Dave Cross responded by checking the top results when searching for "perl tutorial".It shows that many p...

Perl,Perl tutorial,Resource,Website     2011-11-03 13:34:33

#### Getting started with C++ TR1 regular expressions

Overview This article is written for the benefit of someone familiar with regular expressions but not with the use of regular expressions in C++ via the TR1 (C++ Standards Committee Technical Report 1) extensions. Comparisons will be made with Perl for those familiar with Perl, though no knowledge of Perl is required. The focus is not on the syntax of regular expressions per se but rather how to use regular expressions to search for patterns and make replacements. Support for TR1 ext...

Regular expression,Replace,TR1,Extension     2011-08-14 07:25:20

#### Hey, you may be happy to know these mottos about programming languages

Different programming are similar in helping people build staff work as people want them to. But they all have their own features which differentiate them from other programming languages. The language type may be different, for example Java is OOP, some may have different syntax. A programming motto usually can best describe the characteristic of the programming language. For example, "Write once Run everywhere" for Java. But today we are going to take a look at "unofficial mottos" about some p...

motto,programming language     2014-04-05 20:02:13

#### Replacing small C programs with Haskell

C is the classic go-to tool for small programs that need to be really fast. When scripts.mit.edu needed a small program to be a glorified cat that also added useful HTTP headers to the beginning of its output, there was no question about it: it would be written in C, and it would be fast; the speed of our static content serving depended on it! (The grotty technical details: our webserver is based off of a networked filesystem, and we wanted to avoid giving Apache too many credentials in ca...