From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 11440e,23963231b5359f74 X-Google-Attributes: gid11440e,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-ArrivalTime: 2001-06-08 11:18:37 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-post-01!supernews.com!news.supernews.com!not-for-mail From: Pete Thompson Newsgroups: comp.lang.ruby,comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml Subject: Re: Long names are doom ? Date: Fri, 08 Jun 2001 11:19:17 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <7q32itc596euq7tgic3qgd4qpov9bocaj5@4ax.com> References: <9f8b7b$h0e$1@nh.pace.co.uk> <9f8r0i$lu3$1@nh.pace.co.uk> <9fgagu$6ae$1@nh.pace.co.uk> <9fjgha$blf$1@nh.pace.co.uk> <35mqhtkdfma2rggv1htcaq6vfn2ihs67a1@4ax.com> <9fli1b$4aa$1@nh.pace.co.uk> <3B20E1B0.3EC7FEBB@dresdner-bank.com> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ruby:10510 comp.lang.ada:8443 comp.lang.awk:2927 comp.lang.clarion:21477 comp.lang.java.programmer:74858 comp.lang.pl1:931 comp.lang.vrml:3670 Date: 2001-06-08T11:19:17-07:00 List-Id: On Fri, 08 Jun 2001 16:31:12 +0200, James Kanze wrote: >Pete Thompson wrote: > > [...] >> Well, sure. Pointer arithmetic in C/C++ is inherently unsafe and >> encourages obfuscation. However, it also promotes flexibility. > >Just curious, but what can you do with pointer arithmetic in C/C++ >that you couldn't do otherwise, in a cleaner fashion? Well... I'm not saying that there's anything that would be impossible to do without pointer arithmetics -- there's always another way to do things, after all. I'm just saying that there are cases where using pointer arithmetics are simply faster. I find it convenient for when dealing with strings/substrings, images, special effects, filters, masks, reading the system memory, etc. One might argue that arrays are an abstract form of pointer arithmetics. Whether you agree with that or not, that's up to you. The same argument could be applied to recursive functions (another thing that's inherently unsafe and encourages obfuscation) - there's ALWAYS a way to do it non-recursively and avoid the risk of clobbering the stack. There are certain things that it just makes sense for, though, such as partitioning. I could use a nerf ball instead of a hammer to drive a nail into a wall. Sure, it'd take me a lot longer, but it'll still get the job done (given enough decades), and at no personal danger! :)