POV-Ray : Newsgroups : povray.off-topic : All bow to the mighty Python : Re: All bow to the mighty Python Server Time
4 Sep 2024 13:22:14 EDT (-0400)
  Re: All bow to the mighty Python  
From: Invisible
Date: 21 Apr 2010 08:50:20
Message: <4bcef48c@news.povray.org>
>> Actually it's pretty logical. You might argue that requiring the 
>> programmer to manually type a semicolon at the end of each line when 
>> it's obvious that each line is a seperate statement is illogical.
> 
>   You don't type a semicolon at the end of each line. You type it at the
> end of each statement. There may be more than one statement in a line, or
> a statement may be split into several lines, and for example function
> definitions are not ended with a semicolon.

Sure. But in reality, almost everybody writes one statement per line. 
Sometimes you might put several on a line, but usually it's just one.

(Again, I can't comment on Python, but in Haskell you *can* in fact 
still put multiple statements on a line, or spread one statement over 
several lines. It's really not stopping you from doing that.)

>   Anyways, semicolons are seldom lost when you post a response to an online
> blog post.

Granted.

>> The only real problem with using whitespace is that it tends to get 
>> mangled in emails, forum posts, etc.
> 
>   Some editors also might convert spaces at the beginning of lines to tabs
> (or the other way around) if you are not careful with the settings. This
> doesn't really matter with normal programming languages.

I have never seen any text editor ever that converts spaces to tabs - 
although I've seen loads that convert tabs to spaces. Which is really 
fun when editing Makefiles, since they have this braindead idea of 
having tab characters as part of the required syntax. :-P *That* is idiotic.

>> And to think that I do all my programming with an editor which doesn't 
>> give me syntax hilighting *or* automatic indentation...
> 
>   Why?

Becuase no editor in existence can syntax hilight Haskell?

> Try some editor which is able to color your code, use it for a few
> weeks, and you'll never switch back.

I use a text editor which does support syntax hililghting, auto-indent 
and a bunch of other things for XML, CSS, PostScript, TeX, JavaScript 
and more. It just doesn't support Haskell, that's all. While it's nice 
to have syntax hilighting and so on, it's hardly essential. I don't 
really miss it all that much.

>   It naturally depends on the specific language, but with some languages
> syntax highlighting and autoindentation actually help to catch typos as
> you are writing your code.

Sure. If you type "fro" instead of "for", it doesn't show up in bold. If 
you're using an IDE rather than a mere text editor, it may even show you 
mistyped identifiers. I get that.

> For example, if emacs starts autoindenting in
> a completely crazy way, I immediately know that there's a typo somewhere
> (maybe a missing curly bracket or semicolon).

You're saying "if it indents wrong, you've missed a delimiter". I'm 
saying "if you indent it right, that's your delimiters". In a language 
that uses whitespace delimiters, it's much harder to miss one in the 
first place. (I will admit that it's very occasionally non-intuitive, 
and just sometimes you'll see code that doesn't compile because of an 
obscure spacing issue. But it's quite rare.)

>> (Then again, I've yet to see an editor with auto-indent which actually 
>> indents stuff the way that *I* want it to, rather than the way the guy 
>> who wrote the editor wants it to.)
> 
>   In many advanced editors you can configure how the autoindentation works.
> For example emacs has quite a lot of configuration options. (Of course that
> doesn't mean it's *easy* to configure.)

As you probably remember, I've never had much luck with either Emacs or Vi.

(Besides, Emacs isn't a text editor, it's an operating system! :-P )

>   It's just really handy when a line is wrongly indented, I just press tab
> (regardless of where the cursor is on that line currently, and regardless
> of whether the line was indented too much or too little), and emacs indents
> it just like I want.

That does actually sound quite nice. I've never seen an editor which can 
actually do that.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.