Re: Good Linux to start with



On Thu, 7 Jul 2011 23:04:01 +0200, "Peter J. Holzer"
<hjp-usenet2@xxxxxx> wrote:

The Natural Philosopher <tnp@xxxxxxxxxxxxxxx> schrieb:
Mark wrote:
On Thu, 07 Jul 2011 13:49:05 +0100, The Natural Philosopher
<tnp@xxxxxxxxxxxxxxx> wrote:

My biggest problem with interpreted higher level languages is the way
most of them use some form of automagic not under program control memory
allocation, and that means garbage collection at some stage.

This is supposed to me an advantage (in that you don't need to
explictly "free" memory). However you do have to rely on GC which
doesn't always free things up quickly enough.

Precisely. Whereas if you take care at the coding stage to exactly
specify local storage in a strongly typed language, garbage collection
is simply a matter of resetting the stack pointer (or a separate heap
pointer, if the CPU architecture makes that sane)

Its a one machine cycle 'free()'
[...]
The penalty being that you or the compiler have to get that right at
compile time.

That's a big penalty. While you can usually rely on the compiler to get
it right, relying on the programmer for stuff that can easily be
automated is a bad idea. Humans are sloppy. And for most applications
that kind of micro-optimization doesn't help performance: If the program
is waiting for the user or some I/O most of the time, reducing CPU usage
doesn't help, and if the CPU is the bottleneck, the programmer can
probably gain a more by improving the algorithm than by
micro-optimizing.

Genally true. But in pretty much all languages there will be multiple
ways of achieving the same thing. Therefore it could be possible to
micro-optimize with great success. I've done this with Java on
several occasions.

There are situations where C has its place and there are programmers who
can use C well, but for the average program the average programmer is
better off with a different language.

I must not be an "average" programmer then ;-) I generally prefer C
over other languages as it not too high level and you can easily see
what is actually going on. But then it's the language I have most
experience in using.

--
(\__/) M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there. If you wish your postings to be seen by
everyone you will need use a different method of posting.

.



Relevant Pages

  • Re: Garbage Collection - Stop Making Trash
    ... >> cases that require garbage collection. ... > figuring out why anyone would want to perturb a language like ... There are also many programmers who do not desire it. ... Reread and try again. ...
    (comp.lang.cpp)
  • Re: type checking
    ... >it's not far from your favourite SWIG-supported language. ... when its constructor raised an exception. ... It hasn't really been an issue so far, but I guess C# constructors ... This is one issue I already have with Java/C# style garbage collection ...
    (comp.lang.python)
  • Re: Why C# and Java have got it wrong
    ... But I agree that garbage collection in Java and C# is a problem: ... For example, C++, which I love and hate, is not a language well ... work force on almost any real-world project, and much of the reason ... for that complexity is that C++ is not designed with GC in mind. ...
    (comp.programming)
  • Re: In the matter of Herb Schildt: the question of a "bad" book
    ... engineers do NOT use the C programming language. ... There has been a great deal of attention given to ensuring safety as the ... As for memory: forget garbage collection. ...
    (comp.lang.c)
  • Re: Optimizing simple calls in a dynamically typed language?
    ... GC (which is non-trivial due to polymorphism). ... collector in a polymorphically typed language is difficult in ways ... to perform type reconstruction during garbage collection and do not ... Polymorphic Type Reconstruction for Garbage Collection without ...
    (comp.compilers)