Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: why use static_cast ? Date: Fri, 04 Nov 2022 09:09:21 -0700 Organization: None to speak of Lines: 23 Message-ID: <877d0an1la.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="d74099c2b109b60a9d4b4d88adbab987"; logging-data="1979006"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Jpb7qZYj0GIeXWor9GBJT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:k1MTeaS1qRK+zQiqJHtxFs3Ya/0= sha1:PxHQVoX1XyKGhgmgxhoMQzUNScw= Xref: csiph.com comp.lang.c++:87233 Juha Nieminen writes: > Scott Lurndal wrote: >> Young C++ programmers don't understand C, so they think >> that static_cast*> is more "readable". Heh. > > So your opinion on what's "readable" and what isn't is better than my > opinion on the subject because... why? > > I'm 99% certain that the main (if not even only) reason why you don't like > static_cast is because it's longer. That's it. No other reason. > > I have noticed a very common psychological phenomenon that for some > reason beginner programmers try to write code that's as short as possible, > even when that comes at the cost of legibility (a phenomenon that I have > named "the brevity-over-clarity style of programming"). Way too many > programmers never learn out of this bad habit. Wouldn't it be better to call it the BOCSOP? 8-)} -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */