Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Learning by Doing

by jweed (Chaplain)
on Jan 07, 2004 at 05:57 UTC ( [id://319376]=perlmeditation: print w/replies, xml ) Need Help??

My journey through perl at this point has been purely theoretical. Read the Camel, read the Ram, examined favorite modules, helped at perlmonks. But now, I feel that there is a next step that I need to complete to truly increase my perl capabilites.

I need to solve a real world problem.

I am really of the opinion that an essential part of programming is the examination of a situation, coming up with an analysis of the problem and finally beginning to undertake a solution. My life does not allow me to earn money by solving problems with perl; jobs which many of you are lucky enough to have. I think that I'm at a dead end, and I suspect that their are other novices of perl who feel stuck at this particular point.

Certainly, I could make up a problem for myself and solve it, but this always seems like "practice" to me for when the real problems actually come. But they never do.

A concrete example might help. When I earlier was examining the node Summarizing an array of IP's I said to myself, You could probably write a script/module which would handle the general case of this problem which would create a cute little organized data structure for input like this. And while such an excercise might be wholesome, it would still be just that, an excercise. Never would anyone have a need for this type of functionality, and it certainly wouldn't make the world a better place. And if it was something that was interesting or useful, someone would have undoubtedly put it on CPAN already.

My question, then, is how can I get unstuck and begin to "learn by doing"? I'm getting past the point where I can do excercises for the benifit of learning a new construct, but I'm not experienced enough to begin to solve real-world problems which haven't been already solved by the much more accomplished. Can we novices hope to find a niche to test our new-found teeth on some real programming? Or are we doomed to a life of Comp. Sci. 101 excercises until we get us a nice computer job?




Thanks for the input.


Who is Kayser Söze?
Code is (almost) always untested.

Replies are listed 'Best First'.
Re: Learning by Doing
by BUU (Prior) on Jan 07, 2004 at 07:53 UTC
    I think I can summarize the majority of the future responses by saying "Find an itch you have that needs scratching and scratch it". In other words, find some job that you really wish you could automate or some nifty tool you wish you had or something of that nature and then do it.

    Working on other peoples projects is rarely inspiring enough to persuade you to actually finish it, but if you really wanted to you could always browse the help wanted section on sourceforge.

    One last note, there is actually a project somewhere around thats supposed to provide experience for semi-newbie perl programmers, the project is writing test cases for a bunch of modules on cpan but I don't have the link and can't find it, so hopefully somone will reply with the link.
      Do you mean the phalanx-project? At least they are writing tests, but I couldn't find anything regarding the semi-newbie status.
Re: Learning by Doing
by Aragorn (Curate) on Jan 07, 2004 at 11:36 UTC
    I think you're a bit too focused on the "Real World Problem" part. If I can automate something with Perl on my home machine, I'll do that. An application to gather some statistics on my mail or something else: a nice little project. Are those important in the grand scheme of the universe? Of course not, but it helps me in a number of ways: saving time by letting the computer do what it does best, generating potentially useful information and honing my Perl skills.

    On the subject of Summarizing an array of IP's you write:

    "You could probably write a script/module which would handle the general case of this problem which would create a cute little organized data structure for input like this."
    You know what? You probably could. And you would learn an awful lot about IP addressing in the process. Most of the time, you learn more about the problem domain of the problem you're solving than about programming. Remember, a programming language is a tool to get something done. Most of the time, it is not an end in itself (altough Perl can easily be ;-).
    And while such an excercise might be wholesome, it would still be just that, an excercise. Never would anyone have a need for this type of functionality, and it certainly wouldn't make the world a better place. And if it was something that was interesting or useful, someone would have undoubtedly put it on CPAN already.
    I work for an ISP and I think that this type of functionality could very well be useful. Most of the time, you aren't programming to make the world a better place, but just to get the job done.

    Don't let the fact that someone already has done something similar be an obstacle for you to learning something new. As a novice, you're bound to do things that other people have already done. That's part of the learning process. And the fact that something similar is on CPAN doesn't necessarily mean that it's very good. Maybe you can come up with a much better way.

    Arjen

      In Phylosofy there are 2 types of science:
      • Applied Science
      • Pure Science
      • Guess what is the one used in the great inventions of our times? Pure Science: that is when you enjoy trying things, just for the joy. When there is no real need of doing it. It is also said that those inventions use to come from rebels or crazy living.

        Anyway, there are things that would be very useful if someone does them. For example, I actually don't have time to do a very useful thing: I need to classify all the incoming emails by the pop server that provides them. That is, having several email accounts, it would be very useful to have a detailed list of the addresses that emailed me at least once through each of these accounts. It is useful when you don't use that email acount any more and need to send your new address to every people that used that old one.

        I am planning to do this simple job by using the data that collects my spam server: PopFile that works in perl.

        I am also planning to offer that script to all the comunity that uses the same server. It might some day be an added service to that great application.

Re: Learning by Doing
by liz (Monsignor) on Jan 07, 2004 at 12:05 UTC
    Certainly, I could make up a problem for myself and solve it, but this always seems like "practice" to me for when the real problems actually come. But they never do.

    If you think of programming as an "art", then you could consider yourself an "artist".

    If you try to make a living as an "artist" (in whatever art), you're always balancing between doing the things you like, and doing the things your clients ask you to make.

    A case in point: I've written a lot of thread related modules. Why? Because when 5.8.0 was about to come out in the late spring of 2002, there was nobody really testing it as a "user". And I found a lot of things missing. And I had a lot of time on my hands. And I found it intriguing.

    However, I'm not using threads in _any_ production environment myself and not for _any_ client to this day. The same for my forks module (although I must admit I will probably start using that in production for a client before the end of the month).

    So in my case, you could say I made up a problem for myself and tried to solve it. And I learned a lot of things along the way. Probably more than when if It had been constrained by prerequisites of a project of a client.

    Liz

Re: Learning by Doing
by nimdokk (Vicar) on Jan 07, 2004 at 11:16 UTC
    I will say that the idea of "learning by doing" applies elsewhere as well. I had to learn our system in a hurry doing just that when the administrator walked in one day and said he would be gone for three months because he was having a quadruple by-pass heart surgery the following week. Nothing like learning with trial by fire.

    I also recall a Chinese Proverb:
    Tell me, I forget
    Show me, I remember
    Involve me, I understand.

    I think some of that might apply here :-)


    "Ex libris un peut de tout"
Re: Learning by Doing
by flyingmoose (Priest) on Jan 07, 2004 at 15:51 UTC
    There are two things I always do after "Hello World" in a language I care about.

    a) implement Conway's Game of Life. Optimize as best as possible. Make it look shiny. For some reason, I like to try graphics development rather than SysAdmin type scripts first...gives you a sense of gratification. In Perl, play some with Perl/Tk or maybe explore some other GUI things.

    b) implement some random game. Games have tons of seemingly impossibly hard problems to solve, and they'll end up creating problems you don't know how to solve initially (that you'll have to think about for a good while). Plus, games are fun, better than itch scratching. I typically try for hard things, like a clone of "RC Pro AM" in 3D, an AI for a board game like "Abalone", or a game like "Civilization" or "FreeCiv". In each of these areas, there are challenges that cannot be immediately grok'd and you have to bend your ways around the language to find good clean solutions. Plus, you'll never finish. Games can be expanded and improved forever.

    You might never finish B, but every time I start a program that I don't finish, I learn a lot along the way about how I should have started instead. That is, learning by making mistakes, redesigning, finding new tools, new optimizations, etc.

    Anyhow, someday, I'll make a nice game that everyone will want to play again. I haven't had that success since I wrote an excellent version of MineSweeper for my TI-85 calculator in 1996. But hey, that's how I learned to write for the '85, and that helped out a lot for Calculus and Physics (which needed real world programming on that calc), paving the way for me to pick Computer Science as a field. I may write boring apps at work, but occasionally I'll start a nice game project, and I'll feel that love for the art again...and I'll learn new things.

    Just doing it for a job doesn't mean you'll learn it, you often get caught in the same old ruts. Rinse, lather, repeat, you know? Push the envelope.

Re: Learning by Doing
by jbware (Chaplain) on Jan 07, 2004 at 13:27 UTC
    Like most of the above responses, I'll say "you need to make your own opportunities." My job doesn't afford me much perl time, but I'm gradually working it in as I can. I mean, how can the boss argue w/ increased efficency due to my quick scripts? But when I can't do that I look close to, literally at, home. Your needs at home are certainly real-world, perhaps more than you realize. You don't need to write a 10k+ line app to learn real concepts and obtain real usage. Sometimes its the 10-20 liners at home to make your tasks easier that you find more helpful than you currently imagine. What others call an "over-engineered home network" I call my own personal university...
Re: Learning by Doing
by exussum0 (Vicar) on Jan 07, 2004 at 11:52 UTC
    Can we novices hope to find a niche to test our new-found teeth on some real programming? Or are we doomed to a life of Comp. Sci. 101 excercises until we get us a nice computer job?
    For one, you can continue reading the site. The IP question was simple, yes, but there are also more in-depth questions like, should i use MVC with HTMl::Template, Mason or something else. Learn the technologies and do easy large things to get the gist of what to do, what can be done.. and so on. The difference between a real world problem and a scienific one is just vested interest.

    For instance.. writing a GPA calculator might be a silly exercise, but a lot of college sites have them. Would a GPA calculator be easy to write? Sure. You take in a bunch of inputs, you do some math, you pop out a number. You validate and do a bit of checking... it can't be more than 50 lines long.. maybe 100. But point is, someone will ask for it.

    Now think of something that queries a database, formats the information into a pdf (nicely) and puts it on a server somewhere. Companies do this every day for reporting purposes.

    The only thing that makes real world problems hard, are those little things that make people happy. "I don't like how long this takes." "Can you make this do this behavior instead." It's not limited to perl either. Knowing how to do anything in any language adds to your toolkit of things you can do. Just a matter of knowing how to tweak those things to make people happy.


    Play that funky music white boy..
      Actually a GPA calculator is not as trivial as it sounds at first.

      One of my projects at a mid-size 4-year regional school was to transition our paper transcript system to an electronic one. The old system had everyone's transcript on paper. New grades were printed on sticky labels every semester and each transcript had the label stuck to it by hand. If a grade was changed the records clerk used white-out and a typewriter to alter the transcript and a calculator to redo the GPA.

      When I went about creating the GPA module, I ran into all the wierd "what ifs" that occur for the 1% of the students. For instance, if a student graduates with an undergrad degree, comes back and takes more classes but is not in grad school, does their overall GPA start over with the new classes or does it include the undergrad degree courses? Scary answer: different clerks in the office did it different ways!

      The lesson? a) Rarely is anything as simple as it seems. b) Solving a problem requires that you understand it FULLY, including all the crufty parts people like to avoid. It is these two items which make "Learning by Doing" so powerful!

        Can we novices hope to find a niche to test our new-found teeth on some real programming? Or are we doomed to a life of Comp. Sci. 101 excercises until we get us a nice computer job?
        You see, the poster isn't talking about systems analysis and design, finding out what the user wants and implementing it. He's simply asking about where can he find non-examples.. full applications to write.

        You see, you wrote code for something w/o a spec. The basis of a GPA calculator is really simple. Do a few multiply's, a few adds, and a divide, and you have a gpa. Designing an interface on top of it, checking inputs and what not into an application is more of a challenge. What you ran into, was creating a simple application, and not passing user acceptance testing. :\


        Play that funky music white boy..
Re: Learning by Doing
by rinceWind (Monsignor) on Jan 07, 2004 at 13:53 UTC
    jweed, I like and fully endorse everything your node title implies.

    Previously, to people who have been looking for inspiration in things to write in perl, I have given advice here and here. However, these people were employed.

    In terms of using your Perl skills to get a job, it is essential that you move from the theoretical to the practical. In order to do this, pick an application that tickles your fancy, and go and write it. Get it working, upload it to CPAN and get a name for yourself. Unfortunately, this does not get you immediate money.

    What you do have is Copious Free Time. Use it well, and use it wisely. Unlike Java, which costs $$lots to get trained and certified before anyone will take you seriously, the Perl world is much more of an open community, free both in the sense of beer and as in speech.

    In terms of where to start, try and choose something you want to do - something you are interested in. If you have a website (or if you have a rich friend who does have a website), you could develop some CGI scripts to provide services. If the web does not appeal, think about text munging. This is what Perl is supremely good at.

    Hope this helps

    rinceWind

    --
    I'm Not Just Another Perl Hacker

      Unlike Java, which costs $$lots to get trained and certified before anyone will take you seriously . . .

      Sorry, can't agree with that. I've done some Free Software programming in Java, and if there was any reason why I wasn't fully accepted by the other project members, it was because of my tendency to have tons of ideas that were left unfinished, not any particular lack of certs.

      Admittedly, I've never been paid for a single line of Java code, but have been paid for most of my Perl code (including a few CPAN releases).

      ----
      I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
      -- Schemer

      : () { :|:& };:

      Note: All code is untested, unless otherwise stated

Re: Learning by Doing
by coreolyn (Parson) on Jan 07, 2004 at 14:11 UTC
Re: Learning by Doing
by MADuran (Beadle) on Jan 07, 2004 at 16:37 UTC
    Doing something that is already been done is not an empty exercise. It is real life learning. Re-implementing a CPAN module is an opportunity to understand how someone can get to a solution. And if you don't "cheat" (Look at source of the original module) you can test your solution against a (hopefully) known working solution

    This will allow you to work to a solution, which in my mind is more important then being original at this time. Everyone wants to be unique, but what most employers are looking for are people who can finish a task.

    Other options mentioned, such as the Apprenticeship site and finding repetitive task you do at home are very good. But you need to show follow through and finish what you start.

    MADuran
    Who needs a spiffy sig.

Re: Learning by Doing
by johndageek (Hermit) on Jan 08, 2004 at 00:15 UTC
    Heavy sigh, your post draws 2 reactions from me.
    1) Sympathy.
    2) Shut up and program.

    I include number 2 because it is a phrase I use on me.

    You have my sympathy, because of the been there, done that situation. The "Shut up and program" comes from the need to solve writers block.

    So if I understand you correctly, you are now at a point where you feel your skills are adequately honed to take a bite out of something important, and are seeking something important to sink your teeth into.

    Remember - done before by better folks doesn't mean it can't be done better by you.

    So, now all we need to have is a problem that has enough importance to warrent the effort to :apply all the theory, not give up on the hard parts, while convincing self that it IS worth the effort to continue, even though no one is knocking down my door to have me solve the problem. That is a tough one, but perhaps the following list may light a fire under you and get you going like you want to be! Some of the following may require thinking beyond programming alone, but hey, that's half the fun.

    1) write a program that will guide a self propelled vacuum cleaner over a floor, and return it to it's starting point to recharge. - now add furniture, how about cats, and dogs, people etc.

    2) Design a 2 person game to work over the web (perhaps chess) - not as easy as you think

    3) As suggested above, Life is a fun game to write

    4) What is the highest prime number you can make your system calculate?

    5) Design a routing system that will allow an ambulace to get from point a to point b in the least amount of time. Add speed limit constraints, traffic considderations, and weather conditions.

    6) develop a G-code editor with limited options for the user. (look up nummieric controllers, see Machining tools)

    7) How would you make a cell phone network most efficient and least expensive?

    8) Program an alarm monitoring system. Select inputs, decide who to call, etc. Protect your house.

    9) Look into AI, how sould you simulate a human way of thinking? Can you program something to extend the program's experience. How many input types can you accept,evaluate and store?

    10)Write a program to parse a text version of the bible for searching and evaluating. (look at project gutenberg).

    11) Write an english question parser. Apply the question to a database and return results.

    12)Wite a program to evaluate a stock based upon various stock information as well as market indicators

    13) Write a web site on your favorite topic, now rewrite it to teach people as much as you know about that topic. Create tracks for the novice, talented and expert. Allow for experts to make additions.

    14) Write a program to compare as many methods of conveyance from point a to point b. Include Air, bus, and tarain options.

    There are endless opportunities, pick one that appeals to you. Have fun, learn a bit, and you may find while doing some research that there is a market for what you developed.

    Good luck!
    dageek ps - don't be surprised if a few more ideas crop up

Re: Learning by Doing
by husker (Chaplain) on Jan 07, 2004 at 17:16 UTC
    I need to solve a real world problem.

    My first Perl project was to analyze log files produced by the FlexLM license product for usage of some expensive CAD software we use. We needed to know if we were overlicensed on some products, or about to be underlicensed on some others. I learned a ton. In fact I joined Perlmonks shortly after starting it and quickly running into my Perl-noob limitations.

    It was a real-world problem, although not a big one. It did turn out to be harder than I first anticipated. It's a piece of code I still work on from time to time, because I've let other people at other companies use it and they've told me "It would be nice if it would do X...".

    Find something to automate. Anything. To paraphrase from the book of James: "Theory without practice is dead".

Re: Learning by Doing
by dthacker (Deacon) on Jan 08, 2004 at 06:53 UTC
    The quote below is from an interview of Tom Christiansen done by a company called Webpedia in 1999. The company appears to have been swallowed. The advice still rings true for me. I keep a copy of this interview in a file folder labelled "Why I Write Code".

    "My advice to budding programmers is to be a tinkerer. Get under the hood of your engine and find out what makes it tick. Figure out what its components are and how they fit together. Get a copy of the Bach book, the one with the V6 Unix source code in it. Realize that aesthetics matter, and most importantly abandon your nascent career as a programmer if you are doing it to satisfy economic goals. It is important that you like to play, like to tinker, like to solve problems. You must derive joy in writing a program."

    Find something you love, and apply perl to it. My example is soccer. I ran a website for a youth soccer club. I'm now building a fantasy soccer game. I suppose I could write income tax preparation software in perl, but my heart is not in it. I'd rather have some fun.

    So have some fun. Use perl to do a good deed. I believe you can use perl to derive some joy and bring some joy at the same time. And I know all the good problems haven't been taken. Good Luck!
    Dave


    Code On!
Re: Learning by Doing
by dbwiz (Curate) on Jan 07, 2004 at 23:19 UTC
Re: Learning by Doing
by mcogan1966 (Monk) on Jan 08, 2004 at 19:58 UTC
    Problems solved by "much more accomplished" programmers still need solving, to a degree. Sometimes the best way to discover exactly how a wheel works is to invent one yourself. Your own solution may be radically different from the one created by someone else. You'll build from what you know, make mistakes, and correct them. Your code will evolve from rough and clunky to smooth and sleek as you tweak performance issues.

    Every bit of Perl code I've written for 'work' could have been found elsewhere, but it wasn't. Each element was built to the specifications of the project at hand. Learning was part of that process as well. And the same help is available to anyone who codes.

    The doom that is Comp. Sci. 101 is only there until you choose to leave the classroom and explore the world on your own.

Re: Learning by Doing
by Theo (Priest) on Jan 30, 2004 at 21:22 UTC
    Do you have a favorite charity or non profit organization that has a small web site? Or that wants one? Mine is a small private school where my wife teaches. Perhaps their web master is inexperienced or a volunteer and could use some help. There are a lot of real-world applications waiting to be solved there.

    - Parse their ISP logs for error codes (404)
    - Parse their ISP logs for which pages are viewed most often (or not at all)
    - Built a small user-updatable interface for info that changes a lot
    - Maybe some of what they do could be done better from a small database

    I don't know if the possibilities are endless, but there are probably a lot of opportunities to use perl in the real world. ;-)

    -Theo-
    (so many nodes and so little time ... )

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://319376]
Approved by Corion
Front-paged by rinceWind
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-23 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found