Hello Blake. I like discuss about Delphi, but I don't say much more here becouse this is a Smalltalk list :)
2012/1/13 blake <[email protected]> > Gaston, > > >> This method is for manage the event, not for do something that is really >> part of the model. A Form, no is part of the model. This is similar in VW: >> you coded your event handler method in the AplicationModel, that is like a >> Form in Delphi. >> > > Delphi was a direct reaction to VB, which was eating Borland Pasal's > lunch. MVC was nowhere to be seen. It was all about "look how easy it is to > do [whatever]." Never "look how easy it is to re-use" or "look how easy it > is to maintain". I'm not a Basic basher, but the atmosphere surrounding it > has always been "Computer science is =haaaaarrd=. I just wanna program!" > In general, the user of Delphi do not know how to make good programming with it, becouse Delphi granted them make the things quickly and bad. There are a VERY good book named "The dark side of Delphi...", and the DARK word is for the general unknown about it. Here is (in Spanish sorry): http://www.marteens.com/pdfs/TheDarkSideOfDelphi6.pdf > > You CAN do it right. But here I am (right now!) looking at a guy who's > encoded multi-hundred-line event handlers, that are massive if-then chains, > with code duplicated like crazy between the events. > > hehe, Maybe a sometime when I'm very hurry... but too in Delphi I can use polimorphic, strategy, double dispatch, etc, for avoid use of if-then. And no massive code, just necesary code for handle event, just in VisualWorks :) > Really, the "beauty" of the VB model is that you didn't HAVE to learn OO. > (And, hey, reality bears out that code quality and profit are not strongly > correlated.) > > >> No. The IDE automaticaly define a global variable and create code for >> create and assign a instance, but if you want more instances of same Form >> you can easy declare local variables and create new instance (on initialize >> of other instance or on the fly in accesor methods) and asign to. Same in >> Smalltalk.... And you can delete this automaticaly created code. >> > > Sure. You can do a lot of things right. The underlying weakness is in the > static typing and poorly defined messaging. (I haven't tried FireMonkey > yet, though, it may be different.) > Sure! I completely agree with you. You are deal with reserved words like "virtual, override, dinamic" for achieve dinamic message dispatch across static variable typing. This is very inconveniente for clean code (and has bad psychological consequences in the developers hehe). I do not try the Embarcadero version (and I do not), but them improved some things. For example added use de "Class Helper" for do some similar a trait to a class (but in a context). No only Smalltalk evolves :). FYI see:: http://edn.embarcadero.com/article/34324 > > mmm no. Again, a Form is not part of model, idealy this is for write event >> methods handlers. >> > > I'm glad you're following the ideal. I started using Delphi on the beta in > 1994, and in the past 18 years, I've seen about two instances of the ideal > being properly followed in the real world (that I didn't write). > hehe, again, "the DARK side..." never is very popular. > >> In the Buttons you can use Actions for delegate the handler method of the >> click event. In general, you can assign method of a Form to events of >> controls in another Form, but I do not do often that becouse I only write a >> small code in the event handler in the Form for delegate to some model the >> work (DataModules). >> > > Point is: Buttons then become inflexible pass-throughs. In Smalltalk what > you'd do is allow a component to be swapped for any other component if it > had the right handlers. > In Delphi I can change the component too if they has the right handlers with out major work, but I agree with you in that this in not possibly do it easily that in Smalltalk. But, the class of the variable that hold the current component should be ancestor of both interchangeables components, very inconvenient! > If you could lay out forms in Smalltalk and press a button to create a > lean, deployable version, I'd only use Delphi for CPU intensive tasks. > What'd be optimal is a Smalltalk (with some VA/Delphi influences) in a > browser with an overall approach like that of OPA or maybe Morfik (not > Morphic) so that front and back-end stuff was seamless. Smalltalk was born > for that. > :) Regards. Gastón.
