[erlang-questions] Re: erlang improvement - objective c (or smalltalk) syntax

Steve Davis steven.charles.davis@REDACTED
Fri Jun 5 00:56:20 CEST 2009


It would be interesting to see whether 100-200 lines of code transcribed 
to this style would be more or less confusing than the original.

For sure, it would lead to a whole lot more typing of RSI-producing 
boilerplate.

Personally, I think the problem would be better solved with an IDE that 
when you hover over the function name in question it shows up a tip such 
as "do_something(Scale, PreserveAspect, Width, Height)" ...  a bit like 
in Eclipse/Java. This would address the real problem for me, which isn't 
the ambiguity of the code (it's not ambiguous), but rather the limited 
capacity of our unenhanced biological brains.

regs,
/sd



Tony Arcieri wrote:
> On Thu, Jun 4, 2009 at 4:24 PM, Steve Davis 
> <steven.charles.davis@REDACTED <mailto:steven.charles.davis@REDACTED>> 
> wrote:
> 
>     But then -- won't you now have to remember (or consult the docs for)
>     the valid tagnames?
> 
> 
> Yes, to which I responded:
> 
> "Personally I think it's a lot easier to remember text labels for 
> arguments than it is specific (and inconsistent) orderings."
>  
> 
>     Also, taking a looking at the example given:
> 
>     string:substring(Str, I, J)
> 
>     ...isn't this a straw man with intentionally badly named variables?
> 
> 
> Yes, that's true when you're passing variables.  That's why I gave an 
> example with values instead.
> 
> With my example:
> 
>   do_something(true, true, 360, 120)
> 
> you *COULD* get the same effect by binding to throw-away variables:
> 
>   do_something(_Scale=true, _PreserveAspect=true, _Width=360, _Height=120)
> 
> but oh my is that tedious and ugly compared to:
> 
>   do_something(scale:true preserve_aspect:true width:360 height:120)
> 
> which has the added benefit of arbitrary argument ordering.
> 
> -- 
> Tony Arcieri
> medioh.com <http://medioh.com>



More information about the erlang-questions mailing list