in reply to Re: Re: Re: How did you learn Perl?
in thread How did you learn Perl?

I came to Perl from a long C background, so most of the syntax wasn't the issue. It was the regular expressions that I had only touched on in UN*X that was my stumbling block (and many others' since they look foreboding and yet are a godsend). Now I love them, but it took me a lot of "tough loving" to beat them into my skull.

Usually when people ask me how to get into programming, I tell them to use Python. It's a great prototyping language with similar syntax to several other common languages. It has the same logic structures and (this is the key) forces good formatting habits. It is also easy to convert Python to C code as long as you make sure that you use options that are native to both languages.

We've all dealt with bad style, and I truly believe it comes from never being taught good readable style in the first place. By forcing them to tab their logic, it teaches them readability, which is extremely important as they move to other languages without strict rules of style.

Once they have a sense of readability, they can adopt their style to the language as they read others code and find what feels natural. Then, perhaps, their code won't look obfuscated on accident.

In reality, any language can be learned first, but I like to advocate Python because I feel that they will become better programmers in the long-run. Many languages give programmers the freedom to get set in their ways before they know what their ways are, and that is a problem.

  • Comment on Re: Re: Re: Re: How did you learn Perl?