Linux-Networking Digest #682, Volume #11 Sat, 26 Jun 99 18:13:38 EDT
Contents:
Re: Why not C++ ("Tom Leete")
Re: Strange UUCP chat problem (Andrzej Filip)
Re: Changing Monitors in X????? ("Austin Shackles")
Re: Why not C++ (Johan Kullstam)
Re: help setting up email server (Nicholas E Couchman)
MAKE GOOD MONEY $$$$$$$$$$$$$$$$ ("debee99")
Re: wu-ftpd & umask settings ("YouDontKnowWho")
Re: Why not C++ (Nathan Myers)
Strange UUCP chat problem (Chris Huston)
Re: Why not C++ (Johan Kullstam)
Re: Can access internet, can't ping! (Bill Unruh)
DNS problem ("Klas Sehlstedt")
Can access internet, can't ping! ("Tim Barnes")
Re: Third level domains: how can I create them? (Bill Unruh)
Re: FTP and IPchains\Masquerading (Ian)
Re: HowTo Monitor Internet Acvities While At Work? (Stewart Honsberger)
Re: Why not C++ (Don Waugaman)
----------------------------------------------------------------------------
From: "Tom Leete" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: Sat, 26 Jun 1999 02:21:38 -0400
John E. Davis wrote in message ...
>On Sat, 26 Jun 1999 11:53:08 +1200, Bruce Hoult <[EMAIL PROTECTED]>
>wrote:
>> some_function(&foo);
>>
>>What will be foo's value after the call to some_function? Will it be
>>altered? In C he has no way of knowing because C programmers often pass
>>structs by reference even when they don't intend to change them.
>
>At least the syntax indicates whether or not foo could be altered.
>The fact remains that one cannot look at
>
> some_function (x)
>
>in C++ and be sure that x was not modified, whereas in C you know that
>the local variable x will not be affected. And yes, like many people,
>I use an editor that supports tags. When reading C++ code, I do have
>to look up every such function to see whether or not something like x
>could be modified by the function. With C, knowing instantly that x
>could not be modified is a big help to understanding code fragments.
>
>--John
This is FUD. If your compiler really acts like that, get a new compiler. And
look to your headers.
In C & C++ both:
somefunction(&x);
somefunction has signature f(x_type *). If you hand somebody a pointer, they
can do anything to its target. The identical syntax applies in C++, with
identical results.
In C and C++ both:
somefunction(x_type x);
is like C, a local copy is passed on the stack and local changes dont leave
the scope.
In C++
somefunction(x_type & x);
this x is semantically like x_type, not x_type*. This is a C++ reference. C
doesn't have them. It refers to an object outside the function scope, and
can modify it. It is always an error to think it won't.
somefunction(const x_type & x);
here you have a guarantee that x will remain unchanged,both in scope and
out. This is used for passing heavyweight arguments on the stack, where a
pointer would be an invitation for somebody to free() it. x does not have to
be a const as far as the rest of the world is concerned.
somefunction(const x_type x);
is an optimization construct, the compiler will howl if x isn't defined as a
constant somewhere visible.
Addressing some other misconceptions that have been voiced in this thread:
There is no objection to using throws, but the kernel is written in C, dont
expect it to know what you mean. Catch all your throws and convert the
errors to POSIX. An uncaught throw will abort() and dump core. Whether this
oopses depends on how much kernel state you are messing with, just like in
C.
C doesnt know about destructors either, but that doesnt prevent you from
passing pointers to in-memory structures, you just need to define your
destructors correctly, so they dont delete a pointer the kernel will
eventually free. A C free() is perfectly all right as a standin for delete,
just get your arguments right. As always dont do it twice.
For C++ classes passed by value, C will unwind the stack just fine so long
as the class was put there using "C" linkage. When C uses them, call them
struct. It is a good idea to define a C struct to contain the stack layout,
and then use the struct as the lone data member in a class. Another approach
is to use one header to define your class, and wrap up the C++-isms in the
stock cpp switch.
C and C++ are both very good at binding to other, stranger, languages than
each other. Assertions to the contrary should not be given credence.
TML
------------------------------
From: Andrzej Filip <[EMAIL PROTECTED]>
Crossposted-To: comp.mail.uucp
Subject: Re: Strange UUCP chat problem
Date: Sat, 26 Jun 1999 21:47:17 +0200
On linux you may try another way of debugging:
% strace -e read,write /sbin/uucico -f -r1 -s remote -D
It should trace all system read and write calls made by uucico.
(-D uucico switch should prohibit uucico from going background)
--
Andrzej (Andrew) A. Filip fax: +1(801)327-6278
mailto:[EMAIL PROTECTED] http://bigfoot.com/~anfi
Postings: http://deja.com/profile.xp?author=Andrzej%20Filip
Chris Huston wrote:
> I'm running into a very odd problem with Taylor UUCP version
> 1.06.1-16...
>
> When executing UUCP with:
> "/sbin/uucico -f -r1 -s remote"
> the call fails with an error (in the error log) of "Chat script failed".
>
> Now, without making ANY changes to the system, I rerun uucico with
> debugging on
> "/sbin/uucico -f -r1 -s remote -x9"
> and it works fine... call succeeds with no problems... I added a "debug
> chat" line to /etc/uucp/config and calls succeed every time.
>
> Any ideas why this might happen? does uucp deal with the serial port
> differently when debugging?
------------------------------
From: "Austin Shackles" <[EMAIL PROTECTED]>
Subject: Re: Changing Monitors in X?????
Crossposted-To: comp.os.linux.setup
Date: Sat, 26 Jun 1999 20:07:26 GMT
Nicholas E Couchman <[EMAIL PROTECTED]> wrote in article
<[EMAIL PROTECTED]>...
> You can run 1 of 2 different programs. You can use the text-based one called
> xf86config, or you can tyep setup and it will give you a list of programs.
One
> is the graphical X configurator. Run this one. I highly recomend the later
> one. The first makes you go through all of the setup again and it takes some
> time to do it. The later is fairly easy to use.
> --Nick
There's also a thing called XF86Setup (I think) which is another graphical one,
starts Xwindows in VGA16 mode and lets you alter the settings. maybe this is
the same thing?
currently, I'm awaiting XF86 3.4, to see if it supports my video card...must go
check if it's launched yet...
--
Austin Shackles : DoD #0467 : bike - BMW R60/6 (with home-brew monoshock rear)
cage - Citroen BX19TXD : big cage - 8-seater LDV minibus which is Cothi Taxis
web: http://www/telinco.co.uk/anshackles/austin.htm my opinions are just that.
------------------------------
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 26 Jun 1999 16:09:00 -0400
[EMAIL PROTECTED] (Nathan Myers) writes:
> Andi Kleen <[EMAIL PROTECTED]> wrote:
> >Well, the theory is that:
> > int f(vector<vector<float> > array)
> >is easier than
> > int f(float **array)
> >to handle for a beginner.
(defun f (vec)
...)
is about as easy as it gets. put in declares if warrented by
profiling results.
> No. The theory is that
>
> vector<float> vec;
> vector<vector<float > > array;
> array.pushback(vec);
>
> is easier for a beginner to handle than
>
> int nelems;
> float *vec;
> float **newarray = realloc(array, ((nelems+1) * M) * sizeof(float));
> if (!newarray) {
> abort(); /* ? */
> } else {
> memcpy(&newarray[nelems][0], vec, M * sizeof(float));
> array = newarray;
> ++nelems;
> }
>
> This theory is correct.
>
> --
> Nathan Myers
> [EMAIL PROTECTED] http://www.cantrip.org/
you forgot the freeing step. -- and the debug the memory management
step when you free the wrong thing or the right thing twice or forget
to free it at all. -- and the my memory is fragmented into oblivion
after all these malloc/frees so now my performance is losing hard.
the memory fragmentation problem pretty much precludes seriously using
C++ for kernel work. look to microsoft for examples of C++ in action.
do you really mean that all this C++ incantation is somehow easier
than
(let ((vec (make-array nelems :element-type single-float)))
...)
and then letting the garbage collector reap the results?
C has the benefit of being rather lightweight and efficient. C++ can
be efficient when it comes to execution speed, but it is tedious to
program in resulting in poor development speed and poor
maintainability.
after using lisp's macros i don't know whether to laugh or cry when i
think of C++ templates.
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
Don't Fear the Penguin!
------------------------------
From: Nicholas E Couchman <[EMAIL PROTECTED]>
Subject: Re: help setting up email server
Date: Sat, 26 Jun 1999 18:49:51 GMT
What you need to do is go download a POP3 server. You can find qpopper at
ftp.qualcomm.com or www.linuxberg.com. I use this server, it is kind of
pointless because I don't have a permanent internet connection, but the
experience counts because I am going to set up a Linux mail server at school
this year.
Anyway, download qpopper, run the configure and make commands (there is a
file titled "INSTALL" that will give you specific instructions on doing
this). Edit the /etc/inetd.conf file to start the POP3 daemon (I believe
the "INSTALL" file includes instructions for this, as well, if not, write
back and I will tell you what to add). Restart linux. To check the mail
server to make sure it is working, go to another machine and do a 'telnet
192.168.x.x 110 (where 192.168.x.x is your internal IP address of the Linux
server). You should get a message that says "+OK QPOP (version 2.53) at
computer.domain.com starting. Remember that in order to access your email
from remote locations you will need a permanent IP address and a domain name
would be helpful. Make sure your ISP can reserve and IP address for you,
unless you just want the mail server for internal purposes (Intra- vs.
Inter-net).
I hope this helps!!
--Nick
PlumTree wrote:
> Hi,
>
> I'm running Redhat 5.2 with 2.0.36 kernal. I recently got an adsl
> connection with a static ip address. I am using the linux box to run ip
> masquerade so that my roommates can have internet access. I'm
> interested in setting up my own email server. I want to be able to send
> and receive email and not depend on my isp for this service.
>
> Is it possible to set up email for myself and my roommates? How would I
> go about doing this? Which packages do I need to install? How can I
> check to see if they are already installed? How do I go about
> configuring them, and setting up individual email accounts? etc...
>
> I'm still new to linux, so any super simple instructions or good clear
> and concise guides would be greatly appreciated.
>
> Thanks in advance.
>
> Akira
> [[EMAIL PROTECTED]]
>
> please remove the nospam to reply.
> have a nice day! :-)
------------------------------
From: "debee99" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.ms-windows.networking.ras,comp.os.ms-windows.networking.win95,comp.os.ms-windows.nt.admin.networking
Subject: MAKE GOOD MONEY $$$$$$$$$$$$$$$$
Date: Fri, 25 Jun 1999 23:41:13 -0700
To make money when you are on the internet. You have to visit
www.gotoworld.com. When you visit the site you will need to get a pass
wordand user name. But when you get that dun at the same time you should to
enter 1006559531. That goes where it says << Friend's Member ID. When you do
that every one that use that # gets paid more. And the same for you. When I
use it you get payed more for useing that #.
THANK YOU.
------------------------------
From: "YouDontKnowWho" <[EMAIL PROTECTED]>
Subject: Re: wu-ftpd & umask settings
Date: Sat, 26 Jun 1999 19:58:47 GMT
As I understand it, the umask setting in the ftpaccess file applies
ONLY to anonymous users.
--
And now we return to our regularly scheduled,
uncommonly entertaining thread...
[EMAIL PROTECTED] wrote in message <7ktdfu$6gq$[EMAIL PROTECTED]>...
>Does the defumask setting in ftpaccess have any affect on wu-ftpd?
It
>appears that the only way I can get it to set the permissions
correctly
>is by passing it the -u[umask] parameter from the inetd.conf file.
>
>Anyone else have this problem?
>
>Andrew
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
------------------------------
From: [EMAIL PROTECTED] (Nathan Myers)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: 26 Jun 1999 12:12:09 -0700
Tristan Wibberley <[EMAIL PROTECTED]> wrote:
>
>If I'm using a C library, my program might have to say:
> some_function( &x );
>so, when debugging, I know right there that I can't assume x won't be
>altered. The same thing in C++ would be:
> some_function( x );
False. The same thing in C++ would be the same thing, period.
It is possible to declare non-const reference arguments in C++,
but that doesn't mean one finds it unexpectedly, in good code.
--
Nathan Myers
[EMAIL PROTECTED] http://www.cantrip.org/
------------------------------
Date: Sat, 26 Jun 1999 13:37:18 -0600
From: Chris Huston <[EMAIL PROTECTED]>
Crossposted-To: comp.mail.uucp
Subject: Strange UUCP chat problem
I'm running into a very odd problem with Taylor UUCP version
1.06.1-16...
When executing UUCP with:
"/sbin/uucico -f -r1 -s remote"
the call fails with an error (in the error log) of "Chat script failed".
Now, without making ANY changes to the system, I rerun uucico with
debugging on
"/sbin/uucico -f -r1 -s remote -x9"
and it works fine... call succeeds with no problems... I added a "debug
chat" line to /etc/uucp/config and calls succeed every time.
Any ideas why this might happen? does uucp deal with the serial port
differently when debugging?
Thanks!
- Chris
------------------------------
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 26 Jun 1999 16:12:55 -0400
[EMAIL PROTECTED] (Nathan Myers) writes:
> Thomas Steffen <[EMAIL PROTECTED]> wrote:
> > C++ might not be a very elegant language, but it is
> >fast, at least compared to other OO languages.
>
> Its syntax isn't very elegant, but where did that come from?
> It's fast compared to _any_ language, period. People who say
> it's slower than (e.g.) C are just spreading FUD.
C++ *is* slower than C. not by orders of magnitude or even a factor
of two, but if you feed code to both C and C++ compilers, the C
compiler will optimize harder and generally make a better product.
this is because C is more mature and that C++ code is potentially more
complex which causes a more conservative compile.
on the other hand, common-lisps like CMUCL can acheive near C or
fortran execution speed. speed is not exclusively the domain of the
C-like languages.
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
Don't Fear the Penguin!
------------------------------
From: [EMAIL PROTECTED] (Bill Unruh)
Subject: Re: Can access internet, can't ping!
Date: 26 Jun 1999 19:43:05 GMT
In <lH9d3.24166$[EMAIL PROTECTED]> "Tim Barnes"
<[EMAIL PROTECTED]> writes:
>--- www.cnn.com ping statistics ---
>520 packets transmitted, 0 packets received, 100% packet loss
>I can't run lynx with external addresses either...
>All my machines have hard IP addresses in the 192.168.254.xxx range, and the
>HP has a single ethernet card with two IP addresses: the one given by @home,
>and one for the internal LAN.
192.168.x.y are illegal IP addresses. That is why you are allowed to
assign them to your internal network without going through the IP
addresses assigners. However, no such address can be addressed from
anywhere on the net. Ie, no machine can return any packets to you since
they have no idea where they go. (there are thousands of machines with
the same IP address in the 192.168 range.)
You MUST run IP Masquarading. I do not know if it exists for the HP OS.
It certainly does for linux.
------------------------------
From: "Klas Sehlstedt" <[EMAIL PROTECTED]>
Subject: DNS problem
Date: Sat, 26 Jun 1999 22:43:02 +0200
I'm not able to connect to my samba services, telnet, ftp or whatever
network acces to the server unless it has made a succeful call to my ISP s
dns.
I have read the dns howtos,
By the way I think this started when I uppgraded to RH 6.0. I did work
before
Example:
Assume that I try to telent to server.kussered.net fron i486.kussered.net
telnet server.
The server.kussered.net answers with the contents of issue.net, Then it
hangs until it have asked
external DNS. After that querry the login prompt appears. When it has done
this once it works.
I don't understand why an external DNS has to be querried with information
that is
availible on server.kussered.net.
Below are my named.conf,resolv.conf and files for my var/named directories.
First named.conf:
options {
directory "/var/named";
};
zone "." {
type hint;
file "root.cache";
};
zone "kussered.net"{
type master;
file "zone/kussered.net";
notify no;
};
zone "0.0.10.IN-ADDR.ARPA"{
type master;
file "zone/10.0.0";
notify no;
};
zone "0.0.127.IN-ADDR.ARPA"{
type master;
file "zone/127.0.0";
};
Then resolv.conf
domain kussered.net
search kussered.net
nameserver 10.0.0.1
Then root.cache:
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . <file>"
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC registration services
; under anonymous FTP as
; file /domain/named.root
; on server FTP.RS.INTERNIC.NET
; -OR- under Gopher at RS.INTERNIC.NET
; under menu InterNIC Registration Services (NSI)
; submenu InterNIC Registration Archives
; file named.root
;
; last update: Nov 8, 1995
; related version of root zone: 1995110800
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
; End of File
Files in /var/named /zone
kussered net
@ IN SOA ns.kussered.net. root.kussered.net. (
1999062401 ; serial
8 ; refresh
2 ; retry
1 ; expire
1 ; default_ttl
)
@ IN TXT "Kussered.net, The fairy DNS"
localhost IN A 127.0.0.1
ns IN A 10.0.0.1
ns IN MX 10 mail
ns IN HINFO "AMD K6" "Linux 2.0 (win98)"
mail IN A 10.0.0.1
mail IN MX 10 mail
mail IN HINFO "AMD K6" "Linux 2.0 (win98)"
server IN MX 10 mail
server IN HINFO "AMD K6" "Linux 2.0 (win98)"
octans IN A 10.0.0.2
octans IN MX 10 mail
octans IN HINFO "Intel PII 350 MHZ / JOHAN" "Linux 2.0 (win98)"
volans IN HINFO "Intel PII 350 MHZ / KLAS" "Linux 2.0 (NT)"
deimos IN A 10.0.0.4
deimos IN MX 10 mail
deimos IN HINFO "Intel PII 350 MHZ / TORD" "NT 4.0 SP3"
i486 IN A 10.0.0.127
i486 IN MX 10 mail
i486 IN HINFO "Intel 486 DX 100 MHz" "Linux 2.0 (win98)"
p200 IN A 10.0.0.126
p200 IN MX 10 mail
p200 IN HINFO "P 200 MMX" "Linux 2.2 (win98)"
volans IN A 10.0.0.6
volans IN MX 5 mail
server IN A 10.0.0.1
@ IN MX 5 mail.kussered.net.
@ IN NS ns
The file 10.0.0
@ IN SOA ns.kussered.net. root.kussered.net. (
1999062401 ; serial
8 ; refresh
2 ; retry
1 ; expire
1 ; default_ttl
)
2 IN PTR octans.kussered.net.
4 IN PTR deimos.kussered.net.
126 IN PTR p200.kussered.net.
127 IN PTR i486.kussered.net.
6 IN PTR volans.kussered.net.
1 IN PTR server.kussered.net.
@ IN NS ns.kussered.net.
The file 127.0.0
@ IN SOA ns.kussered.net. root.kussered.net. (
1999062401 ; serial
8 ; refresh
2 ; retry
1 ; expire
1 ; default_ttl
)
1 IN PTR localhost.
@ IN NS ns.kussered.net.
------------------------------
From: "Tim Barnes" <[EMAIL PROTECTED]>
Subject: Can access internet, can't ping!
Date: Sat, 26 Jun 1999 19:17:37 GMT
I've just installed SuSE 6.1 on my local LAN. My connection to the outside
world is through a Windows NT 4.0 SP5 box, using a cable modem (permanent IP
address).
I use Wingate 3.0.2 to connect all the other machines to the Internet.
Netscape works: I have set up a www proxy on Wingate, and filled in all the
proxy addresses in Netscape's options. I can do e-mail, which talks to VPOP3
on my NT machine (i.e. through the local LAN only).
With all this done, I can't make a simple command-line ping work, except for
LAN addresses. So "ping hp" is fine.
DNS seems to be OK: if I type "ping www.cnn.com" I get this:
PING www.cnn.com (207.25.71.5): 56 data bytes
then the connection goes quiet and eventually I hit control-c and get a
message like this:
--- www.cnn.com ping statistics ---
520 packets transmitted, 0 packets received, 100% packet loss
I can't run lynx with external addresses either...
All my machines have hard IP addresses in the 192.168.254.xxx range, and the
HP has a single ethernet card with two IP addresses: the one given by @home,
and one for the internal LAN.
Any ideas?
Thanks,
tim.
--
Tim Barnes
MarketSpeed, Inc.
16471 Bonnie Lane, Los Gatos, CA 95032
Phone: (408)357-2472 FAX: (408)357-2473
------------------------------
From: [EMAIL PROTECTED] (Bill Unruh)
Crossposted-To: comp.os.linux.misc,comp.lang.perl.misc,comp.unix.sco.misc
Subject: Re: Third level domains: how can I create them?
Date: 26 Jun 1999 19:47:48 GMT
In <[EMAIL PROTECTED]> Scientia <[EMAIL PROTECTED]> writes:
>Let's imagine that one domain of mine is called example.com .
>How can I create domains like newdomain.example.com ?
You need to run a DNS a domain name server, so that when something on
the net looks for newdomain.example.com, that query will come to your
ISPs DNS (for example.com) who will pass it on to your DNS. That is what
the named daemon does-- answers name queries. Your ISP also has to pass
on requests to you when they come in to their machine.
------------------------------
From: [EMAIL PROTECTED] (Ian)
Subject: Re: FTP and IPchains\Masquerading
Date: Sat, 26 Jun 1999 20:38:36 GMT
On Sat, 26 Jun 1999 16:30:40 +0100, mist <[EMAIL PROTECTED]>
wrote:
>
>The error message certainly sounds like the one that you get when the
>ftp masquerading module hasn't been loaded. Have you done
>
>insmod pathtowhateverthatftpmasqmoduleiscalled
>
>as root?
Yes I have installed it and when I do a lsmod command the module is
listed.
------------------------------
From: [EMAIL PROTECTED] (Stewart Honsberger)
Crossposted-To: comp.unix.questions,comp.os.linux.misc,microsoft.public.windowsnt.misc
Subject: Re: HowTo Monitor Internet Acvities While At Work?
Reply-To: [EMAIL PROTECTED]
Date: Sat, 26 Jun 1999 20:43:44 GMT
On Fri, 25 Jun 1999 10:20:16 -0700, Jimmy Navarro wrote:
>Hi, Mr. Ron DuFresne with dodo brain, fyi I was just posting the question
>was asked me by a MCSE NT System Administrator who doesn't work around Unix
>is there's something he could do and this issue is not even my concern.
HAH! Some MCSE! Man, he really earned THAT CrackerJack box diploma!
He's so good at what he does - he doesn't waste his time on such minor tasks?
{snerk}
--
Stewart Honsberger (AKA Blackdeath) @ http://sprk.com/blackdeath/
[EMAIL PROTECTED] (Remove 'thirteen' to reply privately)
Humming along under SuSE Linux 6.0 / OS/2 Warp 4
------------------------------
From: [EMAIL PROTECTED] (Don Waugaman)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: 26 Jun 1999 13:55:04 -0700
In article <[EMAIL PROTECTED]>,
Johan Kullstam <[EMAIL PROTECTED]> wrote:
[ referring to two code snippets to create a float matrix, in C & C++ ]
>you forgot the freeing step. -- and the debug the memory management
>step when you free the wrong thing or the right thing twice or forget
>to free it at all.
I take it that the above is your opinion of the C code, since the C++
program suffers from none of these problems.
> -- and the my memory is fragmented into oblivion
>after all these malloc/frees so now my performance is losing hard.
Which is as much a problem for the C code as for the C++ code, if not
more so since schemes such as reference-counted objects is more
difficult to implement in C.
>the memory fragmentation problem pretty much precludes seriously using
>C++ for kernel work.
I don't think that memory fragmentation is worse in C than in C++.
It's true that some features of C++ can cause programmers to use
dynamic memory more than in C. but that's an attribute of the use of
the language, not of the language itself.
What it means is that in areas where memory fragmentation is an issue,
you'll have to be very careful about how you manage memory. This is
an issue in C programs as well, of course. The difference is that you
can use C++'s features to more easily move between different methods
of memory and fragmentation management.
For example: collection templates in the C++ Standard Library take an
"allocator" template parameter, which means that you can substitute in
your own memory allocator if the built-in one isn't acceptable for your
needs. This is part of what makes the C++ SL a rather robust design -
and something that can't be done without C++'s substantial template
support.
A good designer will build something that is flexible and reusable - a
poor one will create a mess. You've probably seen more C++ messes than
C messes because there are fewer good C++ designers, largely because it
takes a lot longer to become a good C++ designer. I don't mention this
as a strength of C++ - it's not - but it's not wise to blame the tool
for the poor hand that wields it, either.
> look to microsoft for examples of C++ in action.
You left out the phrase "poor use of" between "of" and "C++" in this
sentence. Again, this is caused largely by libraries written by people
with poor C++ design skills.
>do you really mean that all this C++ incantation is somehow easier
>than
>
> (let ((vec (make-array nelems :element-type single-float)))
> ...)
>
>and then letting the garbage collector reap the results?
Syntactically, I'd consider this to be about equal in complexity to
the previous examples. However, the previous examples do clean up
the vector when done, though you seem to be asserting the contrary
in your last line.
>C has the benefit of being rather lightweight and efficient. C++ can
>be efficient when it comes to execution speed, but it is tedious to
>program in resulting in poor development speed and poor
>maintainability.
I consider C++ to be a heck of a lot less tedious for programming than
C, and the programs I write are done faster and are more easily
maintained - though at least in part because C++ makes me think about
the design more.
>after using lisp's macros i don't know whether to laugh or cry when i
>think of C++ templates.
Could you describe what you don't like about C++ templates, and how a
statically-checked language that intends to minimize runtime cost could
do better?
--
- Don Waugaman ([EMAIL PROTECTED]) O- _|_ Will pun
Web Page: http://www.cs.arizona.edu/people/dpw/ | for food
In the Sonoran Desert, where we say: "It's a dry heat..." | <><
I hate it when my foot falls asleep during the day cause that means
it's going to be up all night. -- Steven Wright
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.networking) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Networking Digest
******************************