[CentOS] OT: programming language for morons (newbie friendly language in Open Source world)

Les Mikesell lesmikesell at gmail.com
Tue Dec 14 17:04:33 UTC 2010


On 12/14/2010 10:46 AM, m.roth at 5-cent.us wrote:
>
> Yup.
> <snip>
>> yet-another-syntax for config files.   But, it is somewhat hard to scale
>> and maintain because people write in different styles and things that
>> start small tend to have a lot of global variables that are hard to
>> remember as the code grows.  And perl is not great for GUI programs.
>
> *snarl*
> There is *no* excuse for lots of globals. Pass your stuff. The most
> complicated programs I've ever written in perl (I guess that was the
> billing system for a very small telecom, 600-700 lines or more) had less
> than 10 globals, and maybe less than five (it's been 6 years since I was
> there, so I don't remember). Using globals is *lousy*, *lazy* programming,
> and I wouldn't trust folks that write anything more than a 20 or 30 line
> script to program *anything* until they'd gone back and internalized
> modular coding. And then I'd review their code for the next six months....
> <snip>

Keep in mind that you can do some amazing things with a 30 line perl 
script that uses an assortment of modules to to the real work (try 
something like breaking email attachments out into files with some other 
approach to appreciate it).

But, there is a line of thought that says programming (perhaps not 
including text munging...) is really all about designing data structures 
and after that the code is obvious.  I don't have a problem with the 
concept of globals in general. Perl's namespaces aren't really private 
after all, but for practical reasons you would usually want to put 
things in an array of hashes or some similar arrangement that you can 
loop over instead of having a bazillion variable names.

-- 
   Les Mikesell
    lesmikesell at gmail.com



More information about the CentOS mailing list