Python and Ruby

Jonathan Gardner jgardner at jonathangardner.net
Tue Feb 2 16:49:39 EST 2010


On Feb 2, 2:21 am, waku <w... at idi.ntnu.no> wrote:
>
> for writing new code, it's not necessarily that helpful to be *forced*
> to keep with strict indenting rules.  in early development phases,
> code is often experimental, and parts of it may need to be blocked or
> unblocked as the codebase grows, and for experimentation, the need to
> carefully and consistently indent and de-indent large chunks of code
> can easily lead to a mess (blame it on the programmer, not the
> language, but still).  yes, there are editors that help you indent
> chunks of code, but see below.
>
> there are languages where indentation can be either enforced and allow
> one to omit some syntactic nuissance like braces or begin-end clauses,
> or made optional, requiring other syntactic means for delimiting
> blocks etc.  (consider f# with its #light declaration, for example.)
>

If you're writing "experimental code", you're doing it wrong. Every
line of code you write may end up on the space shuttle one day (so to
speak!) Why not write the code well-formatted in the first place, so
that any bugs you introduce are as easily visible as possible?

The only reason why you may want to write crap code without proper
formatting is because your text editor is stupid. If that's the case,
get rid of your text editor and find some tools that help you do the
right thing the first time.

>
> as long as you are limited to your own code, sure.  but if many work
> on the same bit, and use different editors and indentation policies,
> blanks-tabs indentation issues are not unlikely.  you can have blanks
> converted to tabs and vice versa automatically, but that's clearly a
> nuisance.
>

If you're text editor has a problem with indenting, you have a
terrible text editor. Period, end of sentence.

You can't screw in bolts with a hammer, and you can't level with a
saw. Don't try to write code in any language without a real text
editor that can do proper indentation. Don't let your teammates use
deficient text editors either. I wouldn't appreciate it if I delivered
precision components that my teammates tried to install with
sledgehammers.

This is the 21st Century. Good text editors are not hard to find on
any platform.



More information about the Python-list mailing list