[Q] How far can stack [LIFO] solve do automatic garbage collectionand prevent memory leak ?

1

1001nuits

Nah, it's not: your attitude towards people with a degree in computer
science agrees with what I wrote.


I disagree.


Oh, that's what I was not implying. I am convinced that quite some
people who do self-study can end up with better understanding of things
than people who do it for a degree. I have done both: I already was
programming in several languages before I was studying CS. And my
experience is that a formal study in CS can't compare to home study
unless you're really good and have the time and drive to read formal
books written on CS. And my experience is that most self-educaters don't
have that time.

On the other hand: some people I knew during my studies had no problem
at all with introducing countless memory leaks in small programs (and
turning off compiler warnings, because it gave so much noise...)


Yes, yes, and Albert Einstein worked at an office.

Those people are very rare.

But my experience (see for plenty of examples: Slashdot) is that quite
some people who don't have a degree think that all that formal education
is just some paper pushing and doesn't count. While some of those who do
have the paper think they know it all. Those people who are right in
either group are a minority in my experience.

As for electrical engineering: done that (BSc) and one of my class mates
managed to connect a transformer the wrong way around.... twice. Yet he
had the highest mark in our class.

So in short: yes, self-study can make you good at something. But
self-study IMO is not in general a replacement for a degree. Someone who
can become great after self-study would excel at a formal study and
learn more. Study works best if there is competition and if there are
challenges. I still study a lot at home, but I do miss the challenges
and competition.

Hi all,

I quite agree with the fact that self learning is not enough.

Another thing you learn in studying in University is the fact that you can
be wrong, which is quite difficult to accept for self taught people. When
you work in groups, you are bound to admit that you don't have the best
solution all the time. To my experience, self-taught people I worked with
had tremendous difficulties to accept that they were wrong, that their
design was badly done, that their code was badly written or strangely
designed.

Because self teaching was done with a lot of efforts, in particular to
figure out complex problems on their own. Most of the time, the self
learned people are attached to the things they learned by themselves and
have difficulties to envisage that being right of wrong is often not an
issue provided the group comes to the best option. They often live
contradiction as a personal offense while it is just work, you know.

That's another interest of the degree, confrontation with other people
that have the same background. And letting the things learned at the place
they should be and not in the affective area.

1001
 
H

Hugh Aguilar

"Scintilla" gets about 2,080,000 results on google; "blather" gets
about 876,000 results. O Hugh, you pseudo-intellectual you!


About 5,910,000 results. It has a long history, even getting a mention
in the Wyclif's 13th century bible.

You looked up "blather" and "turd" on google *AND* you are not a
pseudo-intellectual??? That is funny!

I don't consider myself to be a pseudo-intellectual. I don't have any
education however, so a pseudo-intellectual is the only kind of
intellectual that I could be.
 
H

Hugh Aguilar

Another thing you learn in studying in University is the fact that you can  
be wrong, which is quite difficult to accept for self taught people.

Yet another thing you learn in studying in University, is the art of
apple polishing! LOL

If a person has graduated from college, it is not clear what if
anything he has learned of a technical nature --- but it can be
assumed that he has learned to be a head-bobber (someone who
habitually bobs his head up and down in agreement when the boss is
speaking) and has learned to readily admit to being wrong when
pressured (when the boss looks at him without smiling for more than
two seconds). These are the traits that bosses want in an employee ---
that prove the employee to be "trainable."

BTW, has anybody actually looked at my software?
http://www.forth.org/novice.html

All this pseudo-intellectual nonsense (including this post) is getting
boring. Why don't we try discussing software for a while? I wrote that
slide-rule program as a showcase of Forth. I've been thinking of
porting it over to another language, possibly C. Maybe one of you C
experts could write the C program though, as a comparison --- to show
how much better C is than Forth. You can demonstrate that my code was
badly written and strangely designed --- with a concrete example,
rather than just a lot hand-waving and chest-thumping.
 
D

Dennis Lee Bieber

If a person has graduated from college, it is not clear what if
anything he has learned of a technical nature --- but it can be
assumed that he has learned to be a head-bobber (someone who
habitually bobs his head up and down in agreement when the boss is
speaking) and has learned to readily admit to being wrong when
pressured (when the boss looks at him without smiling for more than
two seconds). These are the traits that bosses want in an employee ---
that prove the employee to be "trainable."
If that educational system has taught the graduates to not ask
questions, then that system has failed the student...
 
A

Alex McDonald

You looked up "blather" and "turd" on google *AND* you are not a
pseudo-intellectual??? That is funny!

I don't consider myself to be a pseudo-intellectual. I don't have any
education however, so a pseudo-intellectual is the only kind of
intellectual that I could be.

I don't have any formal CS education, nor a degree in anything else.
But that doesn't make me an anti-intellectual by instinct (the
instinct would be jealousy, I guess), nor does it stop me from
learning. Or using Google, something I'm sure you do too.

We have a great degree of admiration and fondness for intellectuals in
Europe; the French in particular hold them in very high regard.
Perhaps disdain of learning and further education is peculiar to a
certain section of American society, as the label
"intellectual" (often, "liberal intellectual") appears to be used as a
derogatory term. I have no idea what a pseudo-intellectual might be,
but it's evident you mean it in much the same way.
 
D

David Kastrup

John Bokma said:
On the other hand: some people I knew during my studies had no problem
at all with introducing countless memory leaks in small programs (and
turning off compiler warnings, because it gave so much noise...)
[...]

As for electrical engineering: done that (BSc) and one of my class
mates managed to connect a transformer the wrong way
around.... twice. Yet he had the highest mark in our class.

Anybody worth his salt in his profession has a trail of broken things in
his history. The faster it thinned out, the better he learned. The
only reliable way never to break a thing is not to touch it in the first
place. But that will not help you if it decides to break on its own.
 
H

Hugh Aguilar

In said:
[...]
I really recommend that people spend a lot more time writing code,
and a lot less time with all of this pseudo-intellectual nonsense.
[...]

   I energetically second that!

What open-source code have you posted publicly?

BTW, why did you request that your post not be archived, and be
removed in a few days? That doesn't seem very energetic. Also, now
that I've responded to it, it will be archived forever. It is so rare
that anybody agrees with me, I wanted to make a permanent record. :)
 
J

John Bokma

David Kastrup said:
John Bokma said:
On the other hand: some people I knew during my studies had no problem
at all with introducing countless memory leaks in small programs (and
turning off compiler warnings, because it gave so much noise...)
[...]

As for electrical engineering: done that (BSc) and one of my class
mates managed to connect a transformer the wrong way
around.... twice. Yet he had the highest mark in our class.

Anybody worth his salt in his profession has a trail of broken things in
his history.

Sure. The long version is: he blew up his work when he connected the
transformer wrong. He borrowed someone else's board and blew that one up
as well.
The faster it thinned out, the better he learned.

He he he, his internships went along similar lines. Maybe he loved to
blow up things.
The only reliable way never to break a thing is not to touch it in the
first place. But that will not help you if it decides to break on its
own.

I don't think transfomers connect themselfs in the wrong way ;-). I
agree with that accidents do happen, but some people just manage to make
accidents happen way above average. And in that case they might start to
think if it's a good idea them touching things.
 
H

Hugh Aguilar

And my
experience is that a formal study in CS can't compare to home study
unless you're really good and have the time and drive to read formal
books written on CS. And my experience is that most self-educaters don't
have that time.

I've read a lot of graduate-level CS books. I think most self-educated
programmers have read more of these books than have 4-year degree
students who were not required to in order to get their Bachelors
degree and who were too busy during college to read anything that
wasn't required.
On the other hand: some people I knew during my studies had no problem
at all with introducing countless memory leaks in small programs (and
turning off compiler warnings, because it gave so much noise...)

I do this all the time. My slide-rule program, for example, has beau-
coup memory leaks. When I have time to mess with the program I clean
up these memory leaks, but it is not a big deal. The program just
runs, generates the gcode and PostScript, and then it is done. I don't
really worry about memory leaks except with programs that are run
continuously and have a user-interface, because they can eventually
run out of memory.

The real problem here is that C, Forth and C++ lack automatic garbage
collection. If I have a program in which I have to worry about memory
leaks (as described above), I would be better off to ignore C, Forth
and C++ and just use a language that supports garbage collection. Why
should I waste my time carefully freeing up heap space? I will very
likely not find everything but yet have a few memory leaks anyway.
 
H

Hugh Aguilar

Anybody worth his salt in his profession has a trail of broken things in
his history.

When I was employed as a Forth programmer, I worked for two brothers.
The younger one told me a funny story about when he was 13 or 14 years
old. He bought a radio at a garage sale. The radio worked perfectly,
except that it had no case. He was mighty proud of his radio and was
admiring it, but he noticed that the tubes were dusty. That wouldn't
do! Such a wonderful radio ought to look as good as it sounds! So he
removed the tubes and cleaned them all off with a soft cloth. At this
time it occurred to him that maybe he should have kept track of which
sockets the tubes had come out of. He put the tubes back in so that
they looked correct, but he couldn't be sure.

Fortunately, his older brother who was in high school knew
*everything* about electronics, or at least, that is what he claimed.
So the boy gets his big brother and asks him. The brother says: "There
is one way to know for sure if the tubes are in correctly or not ---
plug the radio in." He plugs in the radio; it makes a crackling noise
and begins to smoke. The boy desperately yanks the cord, but it is too
late; his wonderful radio is toast. The older brother says: "Now you
know!"
 
J

John Bokma

Hugh Aguilar said:
I've read a lot of graduate-level CS books. I think most self-educated
programmers have read more of these books than have 4-year degree
students who were not required to in order to get their Bachelors
degree and who were too busy during college to read anything that
wasn't required.

I doubt it. But this all comes back to what I earlier wrote: those with
a CS degree think they are better than people without, and people
without think they can achieve the same or better by just buying a few
books and reading them. On top of that, most of the people I knew in my
final year were very fanatic regarding CS: it was a hobby to
them. During coffeebreaks we talked about approximation algorithms for
TSPs for example. Not always, but it happened. I read plenty of books
during my studies that were not on the list, as did other students I
knew.

If I recall correctly, you don't have a CS degree. I do, and I can tell
you that your /guess/ (since that is all it is) is wrong. For most exams
I've done one had not only to have read the entire book (often in a very
short time), but also the hand-outs. And for quite some courses
additional material was given during the course itself, so not attending
all classes could result in a lower score. Reading additional books and
papers helped. Sometimes reading a book by a different author could be a
real eye opener (and the students I had contact with did exactly this).

On top of that, often in class excercises were done, and with some
courses I had to hand in home work (yikes).

Also, most books are easy to read compared to CS papers. In my final two
years I did several courses which solely consisted of reading a CS paper
and giving a presentation on the subject in front of your classmates
(and sometimes other interested people). Reading and understanding such
a paper is one (and quite an effort). Teaching it in front of a (small)
class within a few days is not easy, to say the least. We also had to
attend several talks by guest speakers. I went to more than the required
number, including a guest talk by Linus. When there was a break-through
in proving Fermat's last theorem there was a talk, which I attended,
like several other class mates.

I am sure there are students who are there just to get a degree and to
make money. But my class mates didn't fall into that category, or I have
missed something.

So yes, I am convinced that there are plenty of self-educated people who
can code circles around me or plenty of other people with a CS
degree. But IMO those people are very hard to find. Most people
overestimate their skills, with or without a degree; I am sure I do. And
it wouldn't surprise me if self-educated people do this more so.
I do this all the time. My slide-rule program, for example, has beau-
coup memory leaks. When I have time to mess with the program I clean
up these memory leaks, but it is not a big deal. The program just
runs, generates the gcode and PostScript, and then it is done. I don't
really worry about memory leaks except with programs that are run
continuously and have a user-interface, because they can eventually
run out of memory.

Oh boy, I think you just made my point for me...
The real problem here is that C, Forth and C++ lack automatic garbage
collection. If I have a program in which I have to worry about memory
leaks (as described above), I would be better off to ignore C, Forth
and C++ and just use a language that supports garbage collection.

Several languages that support garbage collection still are able to leak
memory when circular datastructures are used (for example). Also,
allocating memory and never giving it back (by keeping a reference to
it) can also be memory leaking. And the wrong form of optimization can
result in a program using more memory than necessary. On top of that,
you have to understand when the gc releases memory, and things like
memory fragmentation. In short: you still have to use your head (on some
occasions even more).
Why should I waste my time carefully freeing up heap space? I will
very likely not find everything but yet have a few memory leaks
anyway.

Why should you waste time with carefully checking for other issues? In
my experience, once you become sloppy with one aspect it's very easy to
become sloppy with others as well.
 
H

Hugh Aguilar

Hugh said:
The real problem here is that C, Forth and C++ lack automatic garbage
collection. If I have a program in which I have to worry about memory
leaks (as described above), I would be better off to ignore C, Forth
and C++ and just use a language that supports garbage collection. Why
should I waste my time carefully freeing up heap space? I will very
likely not find everything but yet have a few memory leaks anyway.

IOW Hugh has surpassed GIGO to achieve AGG -
*A*utomatic*G*arbage*G*eneration ;)

The C programmers reading this are likely wondering why I'm being
attacked. The reason is that Elizabeth Rather has made it clear to
everybody that this is what she wants:
http://groups.google.com/group/comp.lang.forth/browse_thread/thread/c37b473ec4da66f1

Every Forth programmer who aspires to get a job at Forth Inc. is
obliged to attack me. Attacking my software that I posted on the FIG
site is preferred, but personal attacks work too. It is a loyalty
test.
 
P

Paul Rubin

Hugh Aguilar said:
I've read a lot of graduate-level CS books.

Reading CS books doesn't make you a computer scientist any more than
listening to violin records makes you a violinist. Write out answers to
all the exercises in those books, and get your answers to the more
difficult ones checked by a professor, and you'll be getting somewhere.
That's the point someone else was making about self-study: without
someone checking your answers at first, it's easy to not learn to
recogize your own mistakes.

Anyway, as someone else once said, studying a subject like CS isn't done
by reading. It's done by writing out answers to problem after problem.
Unless you've been doing that, you haven't been studying.
 
J

John Bokma

Paul Rubin said:
Reading CS books doesn't make you a computer scientist any more than
listening to violin records makes you a violinist. Write out answers to
all the exercises in those books, and get your answers to the more
difficult ones checked by a professor, and you'll be getting somewhere.
That's the point someone else was making about self-study: without
someone checking your answers at first, it's easy to not learn to
recogize your own mistakes.

Anyway, as someone else once said, studying a subject like CS isn't done
by reading. It's done by writing out answers to problem after problem.
Unless you've been doing that, you haven't been studying.

Yup. I would like to add the following three:

1) being able to teach to peers what you've read.

As explained in a post I made: during several courses I took you got
a paper from your teacher and had to teach in front of the class the
next week. Those papers are quite hard to grasp on the first reading
even if you know quite a bit of the topic. Understanding it enough
to teach in front of a class and being able to handle the question
round, in which the teacher participates, is quite a killer.

2) being able to program on paper / understand programs on paper.

On several exams I had to write small programs on paper. The
solutions had to compile (i.e. missing a ; for languages that
required so was counted against you, or using optional ;). One exam
was about OOP and several OO languages were taught, and hence on
paper one had to provide solutions in C++, Objective-C, Object
Pascal, Smalltalk, Eiffel, etc. No compiler(s) handy.

And of course questions like: what's wrong with this piece of code
and how should it be written.

3) being able to write papers and a thesis (or two)

No explanation needed, quite some people have no problem reading the
required books, passing the exams, but need quite some time to do
this (and some give up on it).
 
H

Hugh Aguilar

Anyway, as someone else once said, studying a subject like CS isn't done
by reading.  It's done by writing out answers to problem after problem.
Unless you've been doing that, you haven't been studying.

What about using what I learned to write programs that work? Does that
count for anything?

If I don't have a professor to pat me on the back, will my programs
stop working? That sounds more like magic than technology.
 
H

Hugh Aguilar

Anyway, I'm looking forward to hear why overuse of the return stack is a
big reason why people use GCC rather than Forth. (Why GCC? What about
other C compilers?) Me, in my ignorance, I thought it was because C was
invented and popularised by the same universities which went on to teach
it to millions of programmers, and is firmly in the poplar and familiar
Algol family of languages, while Forth barely made any impression on
those universities, and looks like line-noise and reads like Yoda. (And
I'm saying that as somebody who *likes* Forth and wishes he had more use
for it.) In my experience, the average C programmer wouldn't recognise a
return stack if it poked him in the eye.

"The Empire Strikes Back" was a popular movie. I read an article ("The
puppet like, I do not") criticizing the movie though. At one point,
Luke asked why something was true that Yoda had told him, and Yoda
replied: "There is no why!" The general idea is that the sudent (Luke)
was supposed to blindly accept what the professor (Yoda) tells him. If
he asks "why?," he gets yelled at.

This is also the attitude that I find among college graduates. They
just believe what their professors told them in college, and there is
no why. This is essentially the argument being made above --- that C
is taught in college and Forth is not, therefore C is good and Forth
is bad --- THERE IS NO WHY!

People who promote "idiomatic" programming are essentially trying to
be Yoda. They want to criticize people even when those people's
programs work. They are just faking up their own expertise --- many of
them have never actually written a program that works themselves.

The reason why I like programming is because there is an inherent anti-
bullshit mechanism in programming. Your program either works or it
doesn't. If your program doesn't work, then it doesn't matter if it is
idiomatic, if you have a college degree, etc., etc.. That is the way I
see it, anyway. This perspective doesn't hold for much on
comp.lang.forth where we have people endlessly spouting blather
*about* programming, without actually doing any programming
themselves. This is why I don't take c.l.f. very seriously; people
attack me all of the time and I don't really care --- I know that my
programs work, which is what matters in the real world.

(Pardon my use of the word "bullshit" above; there is no better term
available.)
 
J

John Bokma

Hugh Aguilar said:
What about using what I learned to write programs that work? Does that
count for anything?

Of course it does; but who's going to verify your program?
If I don't have a professor to pat me on the back, will my programs
stop working? That sounds more like magic than technology.

I am sure you know what Paul means. As for patting on the back: you must
make a hell of an effort to get that.
 
J

John Bokma

Hugh Aguilar said:
This is also the attitude that I find among college graduates. They
just believe what their professors told them in college, and there is
no why.

Which college is that? It doesn't agree with my experiences. In CS quite
a lot has to be proven with a formal proof, exactly the opposite from
what you claim. And after some time students want to see the proof and
certainly don't accept "there is no why!" unless it's a trivial thing.

Maybe it's because your anecdote is an interpretation from a distance,
not based on the actual experience?
This is essentially the argument being made above --- that C
is taught in college and Forth is not, therefore C is good and Forth
is bad --- THERE IS NO WHY!

At an university which languages you see depend a lot on what your
teachers use themselves. A language is just a verhicle to get you from a
to b. What a good study should teach you is how to drive the verhicle
without accidents and not that a red one is the best. From top of my
head I've seen 20+ languages during my study at the University of
Utrecht. Forth wasn't one of them, but I already knew about Forth before
I went to the UU. On top of that I had written an extremely minimalistic
Forth in Z80 assembly years before I went to the UU (based on the work
of someone else).
People who promote "idiomatic" programming are essentially trying to
be Yoda. They want to criticize people even when those people's
programs work.

"Works" doesn't mean that a program is good or what. There is a lot to
say about a program that works, even one that works flawless. I do it
all the time about my own programs. It's good to be critical about your
own work. And if you're a teacher, it's good to provide positive feedback.
They are just faking up their own expertise ---

Like you, you mean? You consider yourself quite the expert on how people
educate and what they learn when educated in a formal
environment. Without (if I recall correctly) only second hand
information and guessing.
many of them have never actually written a program that works
themselves.

Quite some part of CS can be done without writing a single line of code.
The reason why I like programming is because there is an inherent anti-
bullshit mechanism in programming. Your program either works or it
doesn't.

Now can you provide a formal proof that it works, or do you just
consider running the program a few times sufficient proof that "it works"?
If your program doesn't work, then it doesn't matter if it is
idiomatic, if you have a college degree, etc., etc.. That is the way I
see it, anyway.

Well, you see it wrong. A program that doesn't work and is idiomatic is
easier to make work and to verify by others that it works. A program
that's the result of trial-and-error (that's what quite some people end
up doing who are self-taught) is a pain in the ass (pardon my French) to
maintain or to extend.
This perspective doesn't hold for much on
comp.lang.forth where we have people endlessly spouting blather
*about* programming,

and you are different how? Also note that your post is crossposted to
several other groups.
without actually doing any programming themselves. This is why I don't
take c.l.f. very seriously; people attack me all of the time and I
don't really care

heh, hence all the replies you write, and mentioning it in this post.
 
J

John Bokma

John Bokma said:
At an university which languages you see depend a lot on what your
teachers use themselves. A language is just a verhicle to get you from a
to b.

Addendum: or to illustrate a concept (e.g. functional programming, oop)

[..]
Like you, you mean? You consider yourself quite the expert on how people
educate and what they learn when educated in a formal
environment. Without (if I recall correctly) only second hand
^^^^^^^

Should've written "With", of course.
 
D

David Kastrup

Hugh Aguilar said:
What about using what I learned to write programs that work? Does that
count for anything?

No. Having put together a cupboard that holds some books without
falling apart does not make you a carpenter, much less an architect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top