|
Re: Spaghetti code: msg#00085lang.smalltalk.squeak.beginners
Hello Blake, B> Looking at the chart, it looks like spaghetti code, and reminds me of some B> of the stuff I did in BASIC. And that's sort of what he's doing within B> Smalltalk. I'm actually tempted to show him how it would look in BASIC B> using GOTOs and line numbers. It would have the advantage of being easy to B> see all in one glance. for things I would have considered a state machine in previous languages in Squeak I usually take a Dictionary. I've only used them two levels deep up to now and for a real deep tree it's not appropriate. But they are easy to follow by opening explorers on them and programming consists of going to the right dictionary typing: self at: "I now want to handle this case" put: [ the Block of code to handle this]. Lately I put these Dictionaries into class vars and on the class side I have some file in/ out code using reference streams. (Tried this only with Dictionaries containing no code, but I guess it should work with blocks too.) Cheers, Herbert mailto:herbertkoenig@xxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Spaghetti code, Blake |
|---|---|
| Next by Date: | RE: Spaghetti code, Ron Teitelbaum |
| Previous by Thread: | Re: Spaghetti code, Blake |
| Next by Thread: | Re: Spaghetti code, Blake |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |