From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,2afd440a210c7fb0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,df8a3dc583bf1f5f X-Google-Attributes: gid1164f8,public From: wilson@dbit.com (John Wilson) Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/08/25 Message-ID: <35e2ffdf.0@news.wizvax.net>#1/1 X-Deja-AN: 384633916 References: <0095000017115526000002L062*@MHS> <35E08F7E.F0CC86A9@gce.com> <35E17279.236FC9E2@ubs.com> <6rukse$3q0$1@usenet01.srv.cis.pitt.edu> X-Trace: 25 Aug 1998 14:18:07 -0500, dbit.dbit.com Organization: D Bit, Troy, NY Newsgroups: comp.os.vms,comp.sys.dec In article <6rukse$3q0$1@usenet01.srv.cis.pitt.edu>, Gregg E Economou wrote: >thats not a feature of C. There is really only one data type in c: >memory. integers, pointers, floats, etc, theyre all just memory in C. >(thats the beauty of it). > Now, common proctice is that when you ant to store a string-like thing, >you terminate it with a null. but ther ei sno data type in C 'string' >which dictates a null terminated sequence of bytes. You can do _whatever_ you >want in C, which is why it is so nice, as opposed to languages where you _do_ >have a 'string' type perhaps, and have to live with the accompanying rstricitons >. The problem is cultural -- people tend to learn from other C programmers (either directly or by reading their code), so even if the language does allow writing good code, it's extremely common to see C code that assumes null-terminated strings (which BTW is part of the language since that's how string literals are stored -- you don't *have* to use it but it's a strong encouragement and it's what all the textbooks and magazine articles use). It's also common to run into C code that has few or no comments (and what comments there are often describe the obvious stuff but say nothing about the weird little tweaks in the code which are obviously working around some tricky problem but who knows what it is), doesn't check return codes, doesn't check buffer limits, and is in general, total crap code (but still works most of the time so no one cares). You don't *have* to write code like that, but many/most people do and the newbies are learning from these people so it's just getting worse. >as the famous quote goes, >C provides all the power of assembly with all the flexibility of assembly >*grin* A common belief among non-assembly programmers! John Wilson D Bit