Monday 20 April 2009

Proposal 6: Seaside stop lying to us!

Seaside seems designed and coded intentionally in a very cryptic style presumably with a goal to make it difficult for new users to understand it and to become productive without consultancy of specialists!

Here is another argument:

There are plenty of methods with extremely misleading names and this is, apart from the totally missing documentation, a main reason why it will be very difficult, labourious and time-consuming for new users to really understand and properly use Seaside!

Here is a perfect example:

In the class WARenderContinuation there is the method "newHtmlRoot:". From general Smalltalk conventions one would expect that this answers some new instance with data of the HTML root.

That is not false but not correct either, because unfortunately this method does a lot more: It starts a main generation loop through all child classes and sends them the very important message "updateRoot:"

When reading the message "newHtmlRoot" one would never expect that this factory method also immediately performs such important and vital actions, which are hidden behind a false name. In most libraries it is common practice to keep factory methods clean from such important actions.

I consider this extremely bad style and it makes me very angry that they are stealing my time with such highly individual and extremely uncommon bundling of functionalities behind false and lying method names! If at least they had given it some correct name like "newHtmlRootAndCollectFiles:" then I would just argue about this fancy but at least honest method name.

By the way: the method name "updateRoot:" is also a bad choice in my view. What it really does is collect references to script and css files etc, which are added to the new WAHtmlRoot instance that is created in newHtmlRoot:.

The semantics of "update" imply that some content is changed with some newer content (more "up-to-date"). This is not the case here. What happens is that some data is collected and added for the first time to that new instance. That is clearly not an update!

In my view, something like "collectFilesForRoot" or "initializeRootWithFiles" would be much clearer and much simpler to understand.

I would not discuss this if there were not many dozens of other wrong names. Nobody always and immediately finds the right words. That is why I regularly change ("update") method names when I see that they were not well selected or because their purpose and actions have changed over time.

I don't know why the authors of Seaside have made such a bullshit (remember: I promised open words and no false politeness)! I can only think of three reasons:

1) Either their goal was to sell their consultancy by making it hard for new users to become productive without external consultancy!

2) Maybe these people are verbally so limited in their capabilities of expressing their thoughts that they simply couldn't do any better. This would not be unusual for highly mathematical people and it is by no means any disqualification. I have never met anybody who is equally good in mathematical and in verbal logic. I myself have often my great problems with maths, for example, but never with open words.

3) Or these people are so self-assured and regards themselves so ingenious that they just give a shit on what other people think and don't understand.

I don't know but I would bet on a combination of the first and the third reason.

In any case, I think that these many substantial problems must be resolved quickly to make Seaside easily usable. Currently, this is unfortunately not the case.

For a quick start it would help a lot if all classes and methods had clear and concise documentation inside the code.

Unfortunately, there is almost nothing!

11 comments:

  1. Talking about misleading names: please change the title of your blog; the content of your posts is not about "Smalltalk". I suggest to use something like: 'My rude criticisms to a freely available web framework I am using to make money with". Changing the world starts with yourself...

    Being a seaside user myself, there is certainly something to say about missing documentation and concise naming, but your way of approaching the matter is completely out of scale and is the surest way of getting spewed out by the community. Good thing you're anonymous hey.

    ReplyDelete
  2. 1) There is more to come about Smalltalk in general.

    2)I had been offering my contribution several times (on and off the mailing list, even on the phone to Renggli) but it was rejected by these wise ingenious Seaside advocates. Immune to advice!

    But you also take advantage of being anonymous (I don't mind). So don't blame me!

    Thank you for your *confirmation* about missing documentation and concise naming.

    You proved my arguments right!

    ReplyDelete
  3. Woah...
    You may have valid points but you are being very crude and loud for no reason.

    1) No-one promised you anything.
    2) Yes you have offered your help, and yes maybe it was rejected, and yes again you may have valid gripes, but I'm sure if you had to approach this in another way you would be taken seriously.

    Now I don't know Lukas, Julian and all the other core developers...but I think I've seen some of these issues since earlier version of seaside. Now to say that they are trying to make money out of it is simply heavy handed. Avi, most likely wrote some of those things and he was doing it for himself not thinking i most create the cleanest code I can, or maybe one day he was tired,whatever.

    Clearly there is lots of code to clean up, why not send patches to the core seaside team instead. Why not come with more clear code examples and arguments without all the diatribe and hate hidden behind 'no false politeness' facade. If you had to state just the facts and let people make up their own mind then maybe people would consider creating a professional-code spinoff thingy if they felt the same way...

    It actually sounds like you are the one which is unteachable...calm down, read Proverbs, chill out and just state the facts instead of trying to bully everyone into thinking that their are evil people creating seaside with ulterior motives. Even if it were true (doubt it) its not helping anyone...

    ReplyDelete
  4. One more thing...I am keen to learn new design techniques especially regarding Smalltalk but I can't manage to see it behind all the !!! and attacks on people.

    Please just state facts...

    ReplyDelete
  5. Much more to come over time - facts and proposals!

    Be assured!

    ReplyDelete
  6. why not just submitting to the google issue tracker ?

    Much more productive !

    ReplyDelete
  7. ok, so gave the link ;)

    concerning #updateRoot:

    it's not only collecting files but also setting head elements (title, metatags...).

    Here's the method comment extracted from updateRoot... WAPresenter

    "This method allows you customize the head section of an HTML document. The API is very similar to the 'Canvas API' for rendering in the body section (where you 'draw' in #renderContentOn:).

    anHtmlRoot is an instance of WAHtmlRoot

    Whenever you override this method don't forget to send super"

    ...

    Also, last point, I think you'd better look at 2.9 which is more up to date ! And more comments, especially methods...

    @+

    ReplyDelete
  8. Cédrick,

    Indeed, this small commment in #updateRoot: is one of the very few method comments in the entire Seaside.

    But one does not see it when reading that the call of newHtmlRoot and one does not expect such vial actions hidden inside newHtmlRoot.

    I was proving that one MUST READ FULL code to use Seaside. And that is very bad!

    Still, I cannot see that your comment contradicts my statements regarding misleading method names.

    Please try to see all of that from the viewpoint of a novice to Seaside who is just trying to use the system. That is impossible without fully understanding this cryptic and by 98%% undocumented code.

    ReplyDelete
  9. the continuation stuffs, the action and rendering phase, the handler registrations etc... All this makes seaside quite hard to understand at least the internals... But most of the time people don't need it to use seaside... Also, seaside is a moving target. I find 2.9 having a lot of progress. Julian is doing a great documenting job on his blog. Some books are being written too...

    Personnaly, I feel like a novice-journeyer even if I practice smalltalk for 4-5 years (not full time programmer). And I got a global understanding of seaside internals by myself even if I don't really need it, just more by curiosity. To do that, I just put break points wherever needed (Html document creation for instance or better on request handlers...). Of course, it took more than one day but it's possible once you know how smalltalk behave.

    Still, I think your comments are valuable but too much aggressive. You cannot expect people being treated as idiot to accept your proposals and discuss. This is just human. Politeness has this value that it favours cooperation. Politness doesn't mean "no arguments".

    Why not just write here what you think without referring to arrogance etc... Otherwise it will be every time arrogance vs. aggressivity... boring !

    -
    concerning the name of updateRoot, I just wanted to point out that it's difficult to find a good name and the one you proposed was not correct either... I actually prefer updateRoot...

    last, I just can't understand why you just contributed back all your seaside understanding at least in method and class comments.... even sarcastic ones ! 2.8 was open for writing so...

    @+

    ReplyDelete
  10. Cédrick,

    merci pour vos commentaires. Mon but est serieusement de bouger les choses en avance.

    Documentation must be primarily inside the code! And there is almost nothing.

    But thank you for confirming that Seside is *difficult to learn*!

    Regarding my wording please read my latest post about the history of this blog. There comes a time when friendly words don't bring you any further.

    Très sincèrement
    M. Concombre
    *ggg*

    ReplyDelete