Article View: comp.lang.misc
Article #5044Re: A bad design decision early on in A
From: Duke Robillard
Date: Mon, 11 Jan 1988 17:24
Date: Mon, 11 Jan 1988 17:24
40 lines
2383 bytes
2383 bytes
In article <3309@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704A-Liber,N.) writes:
>In article <472@m10ux.UUCP> rgr@m10ux.UUCP (Duke Robillard) writes:
>>... To set foo, you'd call a function called set_foo. To print the timet
>>you'd call a routine called print_time_t. This is a major concept
>>behind "object oriented programming" languages, life smalltalk
>I really hated doing this back in the days when I programmed in Modula-2. I
>ended up having a lot of functions which did nothing but set and read
^^^^^^^^^^^^^^---this is the definition of an object
>variables. Unless you have a real smart optimizing compiler, using function
>calls instead of just referencing the variables has a large cost associated
I agree here. Object-orientedism is more than a language definition,
it's a way of life. That's why Smalltalk is a whole programming
environment, rather than just a compiler/interpreter. You've got to
get away from thinking that some variable is an "integer" so you can
add something to it.
I don't know a whole lot about C++, but it makes me nervious--it seems
like they did it half-way, which can lead to the "data-confusion" you
complained about originally.
>Also, in order to use time_t (besides just printing it out), I do need to
>know what type it is.
Again, in real OOPS, you'd have a function (method, actually) for every
possible use of the time_t. I agree that this is a bizarre concept in
C (the world's highest level assembly language) but it's an integral
part of OOPS.
moral: don't write Smalltalk programs in C.
> _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194
--
+
| Duke Robillard, novice pagan.
| AT&T Bell Labs m10ux!rgr@ihnp4.UUCP
| Murray Hill, NJ {any biggy}!ihnp4!m10ux!rgr
Technical Details
Message-ID:
<479@m10ux.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ukma!rutgers!mtune!whuts!homxb!mhuxt!m10ux!rgrReferences:
<1322@sugar.UUCP> <47000028@uxe.cso.uiuc.edu> <472@m10ux.UUCP> <3309@ihlpf.ATT.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ukma!rutgers!mtune!whuts!homxb!mhuxt!m10ux!rgr From: rgr@m10ux.UUCP (Duke Robillard) Newsgroups: comp.lang.misc Subject: Re: A bad design decision early on in A Message-ID: <479@m10ux.UUCP> Date: 11 Jan 88 17:24:26 GMT References: <1322@sugar.UUCP> <47000028@uxe.cso.uiuc.edu> <472@m10ux.UUCP> <3309@ihlpf.ATT.COM> Reply-To: rgr@m10ux.UUCP (Duke Robillard) Organization: AT&T Bell Labs, Murray Hill Lines: 39