Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Not A Rockstar File Manipulator Today

by koolgirl (Hermit)
on Nov 15, 2008 at 16:17 UTC ( [id://723803]=note: print w/replies, xml ) Need Help??


in reply to Re: Not A Rockstar File Manipulator Today
in thread Not A Rockstar File Manipulator Today

You have a very good point about my code needing to be less verbose, however, just for future reference, because in all of my write-ups this point usually comes into discussion, Perl is my first programming language. Because of this, I lack the structure most programmers have, because I've yet to work with a strongly typed language. When you have a skill, it's perfectly understandable, to omit it when helpful or unnecessary, however, if you are trying to learn a skill (such as coding with structure and discipline), using it even when not absolutely necessary, helps develop good programming habits.

In short, my code is always going to be verbose, because I am trying to teach myself good habits, as well as be careful not to learn bad ones, such as getting used to using lots of short cuts and having bad structure, or rather, lose structure, because my research, as well as my fellow programmer's, have shown me that Perl being your first programming language, can cause lots of problems unless you are careful.

I suppose perhaps ya'll might think I go over-board, but I'd rather do that, than become a messy coder, and wind up having serious issues when I begin learning strongly typed languages in school this spring. However, I do realize it's just as important to learn the short cuts and usefulness of Perl as the discipline, structure, good habits, etc., so I do appreciate the other monks pointing these things out, so my knowledge expands in those areas as well, I just believe, for now, until I become seasoned as far as other languages are concerned, the discipline of being very structured and verbose in all the code I write, is something I will stick with, in an attempt to become a Rockstar Programmer ;)

  • Comment on Re^2: Not A Rockstar File Manipulator Today

Replies are listed 'Best First'.
Re^3: Not A Rockstar File Manipulator Today
by mpeever (Friar) on Nov 15, 2008 at 19:47 UTC

    Don't fret too much about style and clarity. It's not that there's no such thing as ugly code; but a learner has a lot of trouble knowing which is which. To be honest, even among the Enlightened, "clean code" is not a universally agreed-upon standard. And academic computing (i.e. what you learn in school) isn't what you do in industry. I work at a university, and what they teach the students varies significantly from what actually keeps the system running.

    If you take the advice here, you'll have clean code for some acceptable value of "clean". The Monks aren't infallible, but they seem to have reached concensus on important points.

    Whatever you do, don't let the urge to write "clean" or "maintainable" code lure you into writing some ugly abomination of brain-deadness. Don't be afraid to write good code just because it might be hard to understand. "Easy to maintain" is confused far too often with "grossly inefficient and overly verbose", especially in academic circles. Far too many people are scared off by map or grep, because they wrongly consider it obscure. Good code is frequently not immediately transparent: that's not a bad thing. If you set out to write beautiful code, you'll find it's both clear and efficient, for acceptable values of "clear" and "efficient".

    And Perl's more strongly typed than people seem to think. We just blur the issue with "contexts" and limit the types to scalars, lists, hashes, functions, etc. Lisp, sh, and Forth are loosely typed: Perl is somewhere between them and Java.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-25 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found