> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of William "Chops" Westfield > Sent: Wednesday, March 01, 2006 2:40 AM > To: Microcontroller discussion list - Public. > Subject: Re: [EE] Object oriented languages > > > On Feb 28, 2006, at 8:29 AM, William Killian wrote: > > > OO is a mindset not a language. Some languages just make it > > easier and some make it really really hard. > > > I had a revelation recently... > > For years (decades, actually) I've been a sort of low-level > programmer, writing first primarily in assmebler and more > recently in C. I've occasionally forayed into more modern > languages (first smalltalk, more recently Java...) But I > just didn't get the point. OOP looked OK, but I didn't see > the compelling advantage that would justify everyone being > so excited about it. > > Then, I finally decided it was time to venture into host-side > software; something for windows or macs, rather than an embedded > board somewhere. I couldn't believe how much crap you had to go > through just to setup basic constructs like windows with buttons. > > Thus, the revelation... Objects are not so much a basic programming > construct as a technique for interfacing to shared code (libraries) > in a way that is much more convenient than traditional methods for > cases where the data structures involved are large and/or complex. > And library-style shared data structures as well as their definitions, > which traditional languages do even worse. You can define and use > a standardized "window" in java in a way that would be quite complex > in C, with little effort... Code reuse is indeed a goal of OOD. Some writers refer to your revalation as a paradigm shift - I was using the term mindset as you noted. But here is another simplistic way to visualize this linguistically. When you code nouns you are coding an object. When you code verbs you are coding functions. You code the noun of window for example and add methods as that noun doing things. When you add descriptive adjectives to that noun you are refining (deriving) that noun and that is inheritance. Rather than have to write a new verb for all possible nouns you write the nouns and add the verbs as needed. You really do get about the same amount of 'needed' code but a lot of the 'bookkeeping' code in an object oriented language can be compiler generated. Code bloat can occur either way but with OO some programmers too often coding all possible methods into their objects even though they never end up being called (hey why is there a mirror popping up?) > That objects can also be massaged to look like a vaguely useful > basic computer construct bodes well for the concept, I guess. > > Alas, as James is discovering, this means that becoming a > proficient Java or C++ programmer is more a matter of being familiar > with the vast array of standard and available pre-defined classes > and such than knowing the details of the syntax and theory of the > language itself, or anything as simple as a mere CPU or > microcontroller. Being used to embedded and C, one tends to forget > that that's been important in many languages for all time. > (Even now, "C programmer" frequently means "Posix programmer") Posix? I do that sometimes. But VxWorks is the only embedded OS I used that was really all that close to Posix. ------------------------------------- Notice of Confidentiality ---------------------------------------------------------- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@vgt.net. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist