Re: [Pharo-users] type checking in Smalltalk

2017-04-25 Thread Igor Stasenko
On 31 March 2017 at 21:34, Sven Van Caekenberghe wrote: > > > On 31 Mar 2017, at 19:38, Dimitris Chloupis > wrote: > > > > > > On Fri, 31 Mar 2017 at 19:13, Sven Van Caekenberghe > wrote: > > if you copy/paste something you should give a

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Dimitris Chloupis
Hehe yeah I love nice formatting :) You don't need to convince me , I prefer coding dynamically Ironically enough is the static that is not a real thing anymore. I am coding C++ and Unreal uses templates for pretty much everything. Templates the equivalent of dynamic types, kinda. However when

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Sven Van Caekenberghe
> On 31 Mar 2017, at 19:38, Dimitris Chloupis wrote: > > > On Fri, 31 Mar 2017 at 19:13, Sven Van Caekenberghe wrote: > if you copy/paste something you should give a reference > > > I did not copy paste anything, 100 % mine. What part you think it's copy

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Dimitris Chloupis
On Fri, 31 Mar 2017 at 19:13, Sven Van Caekenberghe wrote: > if you copy/paste something you should give a reference > I did not copy paste anything, 100 % mine. What part you think it's copy ?

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Sven Van Caekenberghe
if you copy/paste something you should give a reference > On 31 Mar 2017, at 16:40, Dimitris Chloupis wrote: > > > > On Thu, Mar 30, 2017 at 5:04 PM Marc Hanisch via Pharo-users > wrote: > Hello, > > I have a question which is more

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread jtuc...@objektfabrik.de
Marc, you should definitely go and understand method lookup and handling of unknown messages. This is the fun part of Smalltalk ;-) Just don't overuse it, because you can do things that are so cool you won't be able to understand your own code any more ;-) Joachim --

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Marc Hanisch via Pharo-users
--- Begin Message --- Thanks for that many responses! :-) I think I get the picture! In JavaScript I do that type checking because although I get an error, when requesting a method that is not defined, I do not get one when requesting or setting a property that does not exists. Much more worse in

Re: [Pharo-users] type checking in Smalltalk

2017-03-31 Thread Igor Stasenko
In other words: don't ask - tell. Instead of writing something like: object isSomething ifTrue: [ object doSomething ] ifFalse: [ object doSomethingElse ] just write it: object doSomething that gives you much less code bloat, and much clear view of your intent(s) and even in case of exception

Re: [Pharo-users] type checking in Smalltalk

2017-03-30 Thread Ben Coman
On Thu, Mar 30, 2017 at 11:06 PM, Stephan Eggermont wrote: > On 30/03/17 16:03, Marc Hanisch via Pharo-users wrote: >> >> Reading this, I realized, that I never saw such type-checking in >> Pharo production code. So the question is, what are recommended >> design principles for

Re: [Pharo-users] type checking in Smalltalk

2017-03-30 Thread Denis Kudriashov
2017-03-30 16:03 GMT+02:00 Marc Hanisch via Pharo-users < pharo-users@lists.pharo.org>: > It is advised not to use the message isKindOf: in applications. > > I do understand that it is not a good idea to do different operations > depending on the kind of an object in one method. But in my

Re: [Pharo-users] type checking in Smalltalk

2017-03-30 Thread Alexandre Bergel
Hi Marc, > Reading this, I realized, that I never saw such type-checking in Pharo > production code. So the question is, what are recommended design principles > for that problem in Smalltalk? Do you use what is called duck typing? I have carefully studied the topic of type checking in the

Re: [Pharo-users] type checking in Smalltalk

2017-03-30 Thread Stephan Eggermont
On 30/03/17 16:03, Marc Hanisch via Pharo-users wrote: Reading this, I realized, that I never saw such type-checking in Pharo production code. So the question is, what are recommended design principles for that problem in Smalltalk? Do you use what is called duck typing? Normally I'm not

[Pharo-users] type checking in Smalltalk

2017-03-30 Thread Marc Hanisch via Pharo-users
--- Begin Message --- Hello, I have a question which is more related to software engineering than to Pharo, but I hope that someone can give me an useful hint ;-) In Pharo By Example 5, Page 308, in the Chapter "Introspection", it is written: "Although these features (type inspection) are