POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: (And in Haskell. Obviously.) Server Time
1 Oct 2024 05:19:34 EDT (-0400)
  Re: (And in Haskell. Obviously.)  
From: Warp
Date: 20 Sep 2008 06:44:06
Message: <48d4d3f6@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> I really can't figure out what everybody finds so confusing about 
> Haskell. Is it just that it uses different syntax to other "common" 
> programming languages? (E.g., no curly braces, no function call 
> brackets.) Or is it something deeper?

  There are many things. For example, in what seems to be a common
Haskell style of brevity, the lack of clear delimiters is confusing.
Often everything you see in a line of haskell code looks like this:

    a b c . d e f . g h

and there's no way of visually telling what they are. The role of each
element may be wildly different, and from a layman's point of view,
completely arbitrary. It's often even hard to see where a command or
definition or whatever *ends* and where a new one starts. The lack of
clear delimiters makes it very confusing.

  If it had some clear delimiters, it *might* become a bit easier to grasp
what exactly is going on. For example something like this is much easier
to start thinking about:

a { b(c, d, e); f(g, h); }

  Even without knowing what is a keyword and what is a type or function
name, it's already much easier to even try to understand how the code
is structured, and what might be being executed before what else.

  For example let's take these lines:

     "+" -> binary (+) stack
     "-" -> binary (-) stack

  There's no ending delimiter for those commands. The only way we could
deduce where the commands are supposed to end is by trying to deduce
from the lines being similar. If you had used whitespace completely
differently, it would become very confusing, for example:

     "+" -> binary
     (+) stack "-"
     -> binary
     (-) stack

  I don't know if that's still valid, but I assume it is. Now it's very
hard for a layman to understand what is going on. And the only thing I did
was to add a few newlines and spaces, nothing more. It became an almost
incomprehensible blob of code, with no clear blocks, command ends or
overall structure.

  Moreover, in Haskell, from a layman's point of view, you are not even
guaranteed that you can read from left-to-right and get a concept of how
the code is being executed. Sometimes code is executed left-to-right,
sometimes right-to-left, sometimes in a wilder order, and seemingly very
arbitrarily. It becomes very hard to follow what is going on there.

-- 
                                                          - Warp


Post a reply to this message

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