http://www.perlmonks.org?node_id=695162


in reply to What do you write when learning a new language?

I program because I have problems. (No, not that kind of problems.) There is some task I can make the computer do for me, so I start programming. Picking the programming language comes after having a problem to solve. Most often it's Perl, since it's a pragmatic programming language and available on most computers I have access to (including in particular $work). Sometimes I pick C if I need better access to hardware or libraries or manual memory control. Sometimes I pick $functional_language[rand @functional_language] because the solution may be more easily expressed in it. Sometimes the environment the program must execute in limits the choice (e.g. Javascript).

Of course, this kind of an approach presupposes that you know the programming language very well, or at least are familiar with a wide range of different concepts.

When I was still taking first steps into programming in Pascal and C, I used to write a program that queries the user for a radius, then prints the circumference and area of a circle or sphere. But that was a decade ago.

I mean no offence, but "learning how to write a subroutine or function" in a new programming language sounds silly. It's a matter of syntax, if the programming language has some form of functions or goto. (If it doesn't, this is an interesting problem, but it was already solved in 1950s.) It's much more worth your while to learn a new concept through exposure to a new programming language.

--
print "Just Another Perl Adept\n";