[Pharo-dev] [ bloc ] I do not understand why some behavior is not in the right place
siguctua at gmail.com
Mon Apr 4 17:30:17 EDT 2016
On 4 April 2016 at 23:21, stepharo <stepharo at free.fr> wrote:
> Hi igor
> I like your feedback.
> Could you summarize it based on the latest alpha version and now that you
> saw the code?
> My biggest source of concern, when i look at it is attempt to funnel
features of Athens to obfuscate it down to the point that only simple,
prescribed and rigid constructions will be possible.
Athens is not perfect. As nothing is perfect. More than that: it proposing
a quite limited subset of features comparing to other modern graphical
That's why i really surprised to see how people want to 'simplify' it even
more, down to simplest possible constructs and throwing away the plethora
of other possibilities.
What was the point to make all those features, if you don't want to expose
them to user? Or exposing them in a way, that most of them become hardly
You cannot have a richer feature set than base engine provides, especially
by shrinking that base.
> In the bloc version you discussed with alain (in the house I was
> renovating) an element had a view that were responsibe of the rendering
> but it was not good.
> I don't remember. The only view as a concept i can think of, we were
discussing was a so-called 'viewport'. Is like defining a physical area on
screen which are controlled by GUI, while other areas can be occupied by
something else (be it other GUI kind, or 3D application etc).
But in usual desktop, desktop covers whole screen and there seems like no
huge outcry 'we need special views', so i would put it into 'good to have
but not absolutely necessary' box.
> Le 4/4/16 20:51, Igor Stasenko a écrit :
> Some more bashing today.. (don't take it personal, i may be wrong)
> BlPath hierarchy.. and BlShape.
> Why you redefining what is shape and what is path?
> Of course, you are free to do it in Bloc..
> But in terms of Athens, all of BlPath are actually - shapes..
> And BlShape is some kind of encapsulation of shape, paints and transform.
> It is a dumb state holder without any extra logic.
> My rule of thumb: do not produce dumb state holders. They has to be smart,
> else it makes no sense in creating separate entity and designating it as
> something else than any other bunch of data thrown into single clump,
> sitting there deaf, blind, dead and silent until someone else will grab it
> and start using it for own purpose.
> Sure, i could understand, why you potentially may want such object(s)
> but it is not shape anymore and i wouldn't call it like that. Because shape
> are shape, and has nothing to do with paints and transform,
> it don't knows and don't cares whether it will be filled or stroked or
> and how many times, and if there will be single paint or thousand.
> Such kind of properties is simply orthogonal to what shape existing for,
> because it exists only to define geometry.
> I think all of that came from not understanding the roles of objects and
> how they interact in Athens.
> Shapes define geometry.
> Paints define how that geometry will be filled/altered.
> The shapes and paints are related in a way that paints are used to fill
> shapes. But there's nothing tells that single shape can be filled only
> once with prescribed paint, and only then stroked.. or vise versa.
> The order and amount of operations, combinations and effects are up to the
> user. And they have to stay like so, if you don't intend to shrink feature
> set and hardwire, what users can do and what they cannot.
> I really hoping that you had no such intent.
> Be on your place, if you want to have a number of commonly used shapes,
> just make a
> factory class, so i can tell:
> CommonShapes rectangle: a at b to: c at d
> except, that Rectangle is a shape already.. and wrapping it with own class
> just adds more complexity, creating one extra beloved dumb state holder
> and nothing else.
> But i would imagine i could have:
> CommonShapes circle: 100 at 100
> CommonShapes roundedRectangle: 100 at 100 radius: 5
> in any case, since there could be infinite number of 'possibly useful
> when we talking about geometry.. your BlPath hierarchy will tend to grow
> and grow over time, ad infinity.
> Well, people love when there's order, like in that comic where guy painted
> 'cat' label on his cat, 'car' label on his car.. and all around in same
> Can't blame for that.. So, maybe. Whatever..
> But your examples demonstating insane amount of bloat..
> For example:
> self new
> layoutStrategy: BlLinearLayout horizontal;
> layoutParamsDo: [ :lp |
> lp horizontal wrapContent.
> lp vertical wrapContent ];
> addChild:(self new
> layoutParams: BlLinearLayoutParams new;
> (BlShape new
> fillPaint: (BlColorPaint new color: (Color blue alpha: 0.5));
> (BlStrokePaint new
> paint: (BlColorPaint new color: (Color green alpha: 1));
> lineStyle: BlStrokeLineStyle new;
> width: 5);
> path: (BlLinePath new));
> extent: 400 @ 200);
> Guys, are you serious, you will find happy users, that is forced to
> produce so much
> code in order to draw a single, simple line on the screen?
> You must be kidding.
> I see that it is indeed comes from the requirement that BlElement can
> hot-swap its shape on the fly.. And so, you are forced to define all the
> and construct all the things in place.
> But there should be some sanity limit, where you should stop asking user
> so much details.
> But if you want to go to such extreme, then all your examples would look
> like that:
> BlElement new
> content: (MyFancyPony new);
> Where MyFancyPony, is a content - an object that defines shape, and knows
> how to render itself and so on. A smart object, that knows how to behave
> and draw itself. Not just holding state.
> And number of properties and/or behavior
> is then up to the user. And he is free to use anything fancy or not to
> deliver content on the screen.
> That would be much better. But then it will duplicate the features of
> BlElement (or at least a significant subset of it) - being able to render
> But still.
> P.S. Now i see BlElement.. why nobody said that it is replacement for
> I was thinking that in addition to BlMorph, you have BlElement :)
> Sure, you don't need two compositions. As long as there one thing that
> represent UI elements, that can form hierarchy its ok.
> So, i retract my comments about Elements.. And apologize.
> Best regards,
> Igor Stasenko.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev