comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: newbie, Spark 2014 or Ada 2012
Date: Mon, 06 Jul 2015 22:46:57 -0500
Date: 2015-07-06T22:46:57-05:00	[thread overview]
Message-ID: <mnfi3h$c6f$1@speranza.aioe.org> (raw)
In-Reply-To: mnevpv$e9i$1@dont-email.me

On 7/6/2015 5:37 PM, Björn Lundin wrote:

> Thanks, I have sorted out my issues.
> The python documentation is good.
> But - I often fall into the IndentationException trap

Worst feature of any computer language I've seen.  No closing
token such as "}" or "end", to help the programmer _visually_
see and align the end of a construct or a block around.
It depends on white spacings.

White spacing is not visible as an "anchor" to align the eyes at
as {...} or begin....end and I find I need more mental effort
to see the code arrangement and the logic when looking at Python
code due to its missing these visual anchors.

I found this so bad of a design, and so distracting, that is why
I did not look at Python after this.

> when I have rewritten some code -
> or find that I did not declare a variable

There are no variable declaration in Python. Another bad
feature of dynamics languages. Having variable declarations
at the top of the function helps in self documenting
the code as well. All of this is missing.

> where I should, so after a change,
> it is uninitialised when I read it -
> which is same as reading an undeclared variable
> and I get an exception.
> Or not str(var) when I print it.
>

Welcome to the wonderful world of dynamic languages
and duck typing.  After 60 years of software engineering,
the world has managed to get rid of all good solid programming
features al in order to make programming "easier" for newbies.

This is the first thing any one hears about Python or
any language like it, it is "so easy" to program in it.
(but wait until the bugs start showing up when the
program gets larger than 100 lines and when has to
maintain the program later.)

> I know how to resolve the errors,
> but it does not come as natural as Ada compile errors do.
>
> I find it more fragile. Or I am to bad at testing.
>

All the duck typing and loose typing languages are fragile.

But this is by design. To make it easy to just type anything
and it just supposed to know what you meant and it does it,
thanks to duck typing. Try this is Lua for example (another
one of those modern dynamic languages)

----------------------------------
>lua
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio

> a=1+10
> print(a)
11

> a=1+"10"
> print(a)
11
>
------------------------

See? It knew what to do. duck typing at its best.

We need duck typing in Ada, to make it more popular and
easy to program in ;)

--Nasser

  parent reply	other threads:[~2015-07-07  3:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  0:28 newbie, Spark 2014 or Ada 2012 nomadlite
2015-07-06  1:30 ` Paul Rubin
2015-07-06  7:04   ` nomadfate
2015-07-06  7:20     ` Paul Rubin
2015-07-06  7:50     ` Jacob Sparre Andersen
2015-07-06 18:44       ` Jeffrey R. Carter
2015-07-06  9:34     ` Björn Lundin
2015-07-06 16:19       ` Paul Rubin
2015-07-06 22:37         ` Björn Lundin
2015-07-07  1:30           ` Paul Rubin
2015-07-07  9:35             ` darkestkhan
2015-07-07 17:26               ` David Botton
2015-07-07  3:46           ` Nasser M. Abbasi [this message]
2015-07-07  8:24             ` Björn Lundin
2015-07-07  8:57               ` Georg Bauhaus
2015-07-07 18:48                 ` Randy Brukardt
2015-07-07 22:56                   ` Paul Rubin
2015-07-08 19:50                     ` Randy Brukardt
2015-07-08 22:57                       ` Paul Rubin
2015-07-09 17:59                         ` Björn Lundin
2015-07-09 20:10                           ` Paul Rubin
2015-07-09 20:22                             ` Jeffrey R. Carter
2015-07-09 20:41                               ` Paul Rubin
2015-07-09 21:59                                 ` Jeffrey R. Carter
2015-07-09 22:37                                   ` Paul Rubin
2015-07-09 22:55                                     ` Jeffrey R. Carter
2015-07-09 23:25                                       ` Paul Rubin
2015-07-10 22:12                             ` Randy Brukardt
2015-07-06 19:20     ` David Botton
2015-07-06  2:16 ` David Botton
2015-07-06  6:56   ` nomadfate
2015-07-06 19:18     ` David Botton
2015-07-10 22:49 ` nomadfate
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox