Re: Question concerning object-oriented programming
- From: spinoza1111 <spinoza1111@xxxxxxxxx>
- Date: Sun, 23 Mar 2008 01:49:59 -0700 (PDT)
On Mar 17, 5:20 am, "jehugalea...@xxxxxxxxx" <jehugalea...@xxxxxxxxx>
wrote:
On Mar 8, 10:25 am,spinoza1111<spinoza1...@xxxxxxxxx> wrote:
I haven't done a lot of reading about "design patterns" so this may or
may not be a related issue.
My question is why does it always seem necessary in OO for .Net to
decorate objects with state (class level variables) with a bunch of
extra procedures such as toString() and dispose()?
[My list is longer as seen in my book Build Your Own .Net Language and
Compiler.]
[I will try to ignore replies such as "because you're a dip ***".
Grow up.]
That is: there seems to be a consensus that the ancestor Object should
be without qualities or procedures.
If you close your eyes and someone puts something in your hand, would
you be able to tell what it is? Without fingering it, you might
determine that it is heavy. However, without any other indicator, you
really can't say what it is. That is the point of an object; it is
just a way of handing something to someone. When they are ready to
perform a task on it, they can look at it, feel it, other metaphorical
actions, and determine what it is. This is similar to testing with the
keyword "is". The same goes for interfaces. In my experience, object
is more of a placeholder for a real object, or for syncronization;
someone puts it into something else with the understanding that
someone later will know how to get it back to something useful.
That's an epistemological view. I prefer an ontology as being more
fundamental.
The danger is that if I make objects too feature rich, some clown
won't be able to do something. I don't care since this is my
programming language, not his.
Whereas I believe that all non-stateless objects should have a Usable
property and an inspect() method. If at the end of the constructor the
inspect() of the state fails to verify key assertions, actual objects
should mark themselves Unusable and thereafter all procedures should
take an early exit, and properties and methods returning values should
return defaults such as zero, a null string, or null.
I totally disagree. It is horrible to think that my code would
continue to run in an error state. I would prefer an exception thrown.
It continues to run, but refuses to do anything. It still exists as a
citizen object but from within admits guilt.
Any class I write has a constructor that verifies the input prior to
instantiating the object. It should be IMPOSSIBLE to create an invalid
object. Your example doesn't even handle the more realistic option
But it is not, is it. Therefore, objects have to refuse to run when
not usable/
where objects become invalid after construction. Again, to inspect
could cost significant time, or be impossible. The main idea behind
algorithms is to find constraints that must ALWAYS be true across all
actions. Classes should be written with the assumption that such
constraints will always be held as true, or exceptions thrown
otherwise. Another option is for methods to return error indicators
and for the class to correct itself (or never be invalidated).
Practice has shown error indicators to be unrealistic for most
projects.
Ontologically you still haven't answered the question, Lenin's
question, what is to be done. If an object knows itself to be
Unusable, what should the first lines of code of each of its Public
procedures do? I say the object should Throw an exception with a
message such as "all power to the Soviets" har har. How is this
materially different from what you want? It's only the object taking
responsibility inside its code for its not being ready for work!
I first encountered your "idealism" in assembler code which simply
assumed the needed invariants to obtain and which died, messily, with
a lot of pretty blinking lights when the user supplied bad input. I
thought this sucked then and I still think that code that takes steps
is better.
I know it's "unrealistic" to expect actual programmers to do this,
which is why I'm real glad I don't have to work with actual
programmers any more.
Why should the code of an object instance mindlessly grind on,
allowing itself to be called again and again, when another part of the
code has found an assert violation?
It shouldn't. You should throw an exception. Code is only as mindless
as the person who wrote it, since it doesn't have a mind of its own.
Don't assertions throw exceptions?
OK, then we agree. But I think you are prey to a common failing of the
learned which is the idealist refusal to instantiate and think of
material basis. Or, more precisely, to have different languages for
the shop floor and for the executive suite.
"Run time asserts are a waste of time". But Stroustrup says why would
you leave a harbor without lifejackets? Didn't something like that
happen on the Titanic?
I'm not sure if you are saying assertions are good or bad, here. I
assume you are saying they are good and should be listened to. Unless
you catch the exception, the assertions are listened to. But again,
you code should be smart enough to detect an error early on and bomb
out.
Here, the split occurs. What goes on, on the shop floor, is part of
"writing" in Derrida's sense whereas in the executive suite we must
never "speak" of such things.
One can listen (I can listen) to a BBC news story, let's say about the
violation of passport data for Clinton, Obama and McCain. One can
envision (I can envision) how it could have happened in terms,
perhaps, of Rexx, since it's probable that passport data is still on
very large IBM mainframes because IBM has quietly continued to improve
and enhance the mainframe despite the fact that most computer slobs
think it's dead, on behalf of huge organizations like the State
department and CIA...and Rexx is the scripting language for getting
access to "secrets" on IBM mainframes. Despite the need for "secrecy",
Rexx is an alarmingly transparent language in which scripts can print
and parse themselves which does math by default on variable-length
decimal strings, and it's from an internal IBM culture which prized
ease of access for internal people.
Mix this with the low self-esteem and petty bourgeois origin of
programmers, especially programmers invited in by Condi Rice's gofers,
who under Bush have been encouraged to outsource, and the only
surprise is that the breach didn't happen sooner.
But, the BBC is necessarily silent on social class and technology to
the depth needed, with the result that the slobs and thugs who pulled
the stunt have probably already sold the data to the highest bidder,
which is probably John McCain's and *** Cheney's mob.
It was another Watergate, in all probability, and the plumbers here
accessed McCain's records to cover their tracks.
Your language is directly responsible for the systematic loss of
control that people feel...the loss of control YOU felt, Malcolm, when
in a job interview, you crapped out when you criticised a programming
language. The fact is that speech, thought free, is controlled in
Foucault's capillary sense, and we violate the rules, which are always
unwritten by necessity, at our peril...as I violate the rules by using
gude gramer, writing ril gude, and speling (see below).
Therefore Object should expose abstract and unimplemented toString(),
dispose() (which is an issue in .Net), Usable and inspect.
Object would have to be abstract for this to be true. I am sometimes
amazed that you can say new Object() in C#. However, given that the
ToString() method returns a perfectly valid string makes everything
dandy. Again, not all object in C# are Dispose-able. Dispose has a
very special meaning in .NET. It is NOT a destructor! Again, I use
We know this, old boy.
Object as more of a placeholder or even as an indicator. Object is
just where C# says, "This is what all things are guarunteed to
implement. It may not be overly feature rich, but it will make other
things, such as HashTables, easier to implement."
Interesting points. Are Objects rilly real? Wouldn't my "real" object
demand a shadow and more abstract object? I am reminded here of Kant's
distinction between phenomena and noumena. Perhaps I shall discover
that it's impossible to do a good job without a noumenal object such
that my phenomenal Object, which I want to run on earth, giving off
charming little toString() texts (I spell ToString toString because it
is written, by me no less, that "method names must be camelCase").
Must we have things never implemented, or is this petty bourgeois
idealism?
I am in a sense a bare metal kinda guy who toggled in binary machine
code, and for this reason I don't want things to be based on an
idealistic and unimplemented/able foundation.
I do know one thing. Math should not be theology. DON'T tell me "you
can't do that for it is blasphemous to the church of math" because
only Allah is akbar. The things of man should never be surrounded by
mysteries.
Theory. Any Object should have a toString() and a palindromic
fromString() which restores the object state from the toString, which
would, in this scenario, create a readable but complete state, perhaps
in XML.
Exposing the state of an object breaks encapsulation. You shouldn't
store and retrieve state information for an encryption algorithm. God
forbid! ToString is more often used than not to display user-relevant
information. It is almost never used to spew out the class's internal
state. Most classes should use the default behavior of ToString.
I shall pay no attention to needs for secrecy because as a programme,
the drive for secrecy destroys knowledge. Somebunny else can worry
about this, like my former co-worker Whit Diffie. Secrecy in America
is destroying habeus corpus. *** secrecy.
Any Object should have an implementable static test() method which
would create an instance of the object and run a test.
Different testing environments perform testing differently. Some
objects are non-constructable (private ctor or static class). You
can't be so static about something like a test method since it may not
work for everyone. That is a decision better left to the standards
within a company.
Etc. Comments welcome: flamers may flame and be damned.
You must get a lot of people arguing with you. That is probably
because you make statements that are far reaching and too concrete. In
Now you are, like Lear in the old play, getting close to the heart of
the matter. Yes, Malcolm, old boy, my texts are like Soviet monuments:
too grandiose, far-reaching, and above all too concrete.
This is in reaction to a world of promises unmet. In the 1980s, I was
"promoted" from compiler writer to theoretician in a bank, and they
told me in the bank not to code until the grand design was all figured-
out. Well, the grand design was a waste of time: it was how a couple
of Seattle fat cats could revalue Rainier Bank to get top dollar...by
causing hundreds of people to lose their jobs.
I prefer concrete.
your case, I would listen to what other people are saying. Programming
languages don't pop up overnight. There are well-paid professionals,
with more years of experience than I have been alive, who spend
thousands of man-hours developing such systems. It can be somewhat
easy to make a list of rules that work well for an organization, but
it is almost impossible to make them for a global community. I was
able to find multiple reasons why your statements above could be
problematic for some people.
If I didn't reply to any of your statements correctly, it is because
you have bad sentence structure. A big part of making yourself heard
No, I don't, Malcolm. I've heard this canard for years, and I've
repeatedly examined my sentence structure. I have confirmed that it is
grammatical, but uses subordinate clauses to a greater extent than
"normal" people. This is because I am old enough to have escaped
post-1960s "education", and, in the 1950s and 1960s, was educated in
traditional Catholic schools.
Those schools taught me Latin, and before Latin, sentence diagramming
to such a depth that I was able to understand my first computer book,
Peter Wegner's "Programming Languages, Information Structures and
Machine Organization", and my first computer science book, Hopcroft
and Ullman's "Programming Languages and Their Relation to Automata",
both of which I special-ordered through the Roosevelt University
Bookstore in 1971 before Kroch's and Brentano's on Wells set up a
computer section. I understood parsing and recursion because I already
used a recursive sentence structure. I understood modern parse trees
having had fun constructing the traditional sentence diagram.
In 1980, the canard began to appear when as a consultant in a rather
strange Chicago consulting firm which had recruited some of Chicago's
most intelligent people as programmers, analysts and technical
writers. I was disciplined for writing "overly verbose" status reports
by higher-ups who in turn appeared to be terrorised by the man who'd
set up this firm. The middle managers wanted to take control of the
status report system, which had been put into place by the weird
founder, because our Fearless Leader, the weird founder, would read
individual status reports, and, being a University of Chicago demi-
intellectual with no social skills, would get a hair up his ass and
make life difficult for the middle managers.
"Your job", one of them told me in the dawn of the age of *** You,
that is the election of Reagan, "is to make me look good".
The Infamous Canard, that I can't write, resurfaces whenever I
Question Authority in my inimitable and literate style because the
programme of micro and macro authority has been the creation of an
Idiocracy in which people speak and think in Chomsky type 0 keyword
strings, in such a manner that their thoughts are immediately apparent
to those in power, in a one way, left to right scan for correct
Newspeak. The paradox is that "Orwellian" as applied to language means
to the half-educated certified complex speech, whereas the actual
programme in Orwell's book was speech simplification.
I conclude that the charge of verbosity and Crimethink as applied to
me has grown because usenet, along with America and the many places of
the world where America is hegemonic, has been deliberately moronized
and is now an Idiocracy, and this is convenient to power because power
need never pay any attention to stories of real victimization that
emerge regularly on usenet, and can use bullies to silence people.
My texts are a scandal here. They are not supposed to be here because
people, and elites, assume that the war on the working class, in the
form of a deliberate downsizing of language education, has been won.
People like my former wife, who won a national merit scholarship but
was prevented from taking it and who slaved for years correcting the
grammar of the half-educated certified, and myself, are scandals
insofar as we don't manifest the intended damage, and don't write
appropriate to our low station under the sumptuary law: actual
correctness as a result has to be renarrated as itself demotic given
the source.
[Go ahead. I dare ya. Parse the above. Figure out that by using
"sumptuary", I reference laws in the Middle Ages requiring the folk to
wear tertiary colours so that the Quality could be seen properly in
lapis lazuli encarnadined. Examine yourself, and see if you haven't
become re-feudalized by the barons of today who in the words of your
Elvis Costello, have their feasts on the backsides of beasts.]
Malcolm X's supporters scared white people when they put on suits and
ties. My South African friend, a journalist who helped overthrow the
apartheid regime, had a father who was a professional musician who
could not work as such but who wore a suit and tie to his truck
driver's job as part of dignity. Likewise it offends people who
overidentify with the thugs in charge that I use complex sentence
structure because they have to do work to parse the meaning and it
makes me seem rather like the uppity wog, doesn't it?
I am, you see, well aware that your charming little British word, wog,
is an acronym, for "Westernized Oriental Gentleman", the Harrovian who
like the Carthaginian must be hazed unto elimination because he makes
the upper form lads look bad.
I wish I had a dollar for every over-educated Chicago friend of mine
who got old, got married, and bought a house in Evanston, the posh
suburb...and who was batted from job to job, and willingly downsized,
not only his English prose style, but also his, or her, capacity for
hoping...only to discover today that the house he bought is worth
pennies on the dollar. These people counseled me to downsize my usage,
and they were wrong.
I conclude that the 1981 charge of "verbosity" was part of a growing
nativist Kulturkampf such as my Bavarian and Catholic ancestors were
subject to under Bismarck in Germany in the 1870s and which forced
them to flee to Amerika, a Kulturkampf that even in 1981 put Catholic
school graduates under suspicion NOT ONLY for Latinate construction
BUT ALSO based on what the Berrigan Jesuit brothers had done in the
1960s: burn draft records in protest against the Vietnam war.
is to speak well. I'm not saying you need to work on your commas and
semicolons, just that you need to make more structured arguments.
Sorry if you think I am being rude.
You are being rude, and manifesting a carelessness which you would not
show to authority and its own texts. As a slave you whisper to the
fellow slave not to get uppity.
You don't want me to be more careful of language and more aware. In
fact, you want me to be less careful, and go gentle into that good
night, or even rage in the Dylanesque mode against the dying of the
light.
It's been done. What you're encountering is Late Style as defined by
Edward Said, writing about my fat pal Adorno who was in turn writing
about the last music of Beethoven: a Tinkers to Evans to Chance
constellation (Nilges to Said, who Nilges spoke to in Chicago, to
Adorno, to Beethoven) which assaults convention in a far deeper way
than Dylanesque-tavernesque ravings at the Island Bar here on Lamma
Island.
What bothers you isn't the incorrectness of what I write. It's
formally correct, just "too much", and as Late Style it ignores
Dylan's "shibboleths of the ear of corn".
I violate norms systematically simply when pursuing mine own ends as
opposed to when you pay me, on the job, where I do what you pay me for
as do we all, for the most part. On reading the Algol 60 report, I
thought, these guys are onto something. I didn't have that feeling
when reading Backus on Fortran. Perhaps, I thought, mathematics' task
is to self-destruct, and to make mathematics (perhaps by solving the
Riemann thing) as trivial as logic. This way, I thought, we could move
on to more important things and stop work.
[Valery Solanis shot Andy Warhol in part because she wanted a world in
which computers would do all the work. She was a crazy woman, but Andy
Warhol's "Factory" WAS indeed a monument to a lack of imagination, in
which post-scarcity, work would continue and be celebrated sado-
masochistically as it is in countless firms today, meaninglessly.]
[I'll let the above stand despite the fact that it's sure to be
misinterpreted. I don't think, of course, that you should go around
shooting people. Instead, I think you should carpet bomb them on
usenet with wit and erudition to such an extent that like Ralph
Kramden, in the old play, they are reduced to homina homina homina and
silence.]
Ben Bacarisse has done an excellent job in helping me to get back up
to speed on C by pointing out my errors in C. I challenge you to point
out actual solecisms in my writing OTHER than some vague failure to
speak like a white man who's read Strunk and White on the putative
virtues of a "simple", reified speech appropriate to one's station in
life.
I will examine your reply when I return as promised at the end of this
month with the first piece of the spinoza programming language...an
XML parser. I am testing it rigorously but shall surely need your
comments and review, UNLIKE my English prose style, which I will thank
you not to comment about any more.
.
- Follow-Ups:
- Re: Question concerning object-oriented programming
- From: jehugaleahsa@xxxxxxxxx
- Re: Question concerning object-oriented programming
- From: santosh
- Re: Question concerning object-oriented programming
- From: Malcolm McLean
- Re: Question concerning object-oriented programming
- References:
- Question concerning object-oriented programming
- From: spinoza1111
- Re: Question concerning object-oriented programming
- From: jehugaleahsa@xxxxxxxxx
- Question concerning object-oriented programming
- Prev by Date: Re: Search for an algorithm to deal cards with preset conditions
- Next by Date: spinoza progress report, and, Le Canard Infâme
- Previous by thread: Re: Question concerning object-oriented programming
- Next by thread: Re: Question concerning object-oriented programming
- Index(es):