Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: rbowman Newsgroups: alt.folklore.computers,comp.os.linux.misc Subject: Re: The joy of FORTRAN Date: 5 Mar 2025 02:49:02 GMT Lines: 29 Message-ID: References: <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net kBKgGvtjENEd2RVp/QCC5AyfjjhGZooX9QFOm2p7z0qpN85hrf Cancel-Lock: sha1:ql8fXJThYFJf6hkcjd49w4uSy7U= sha256:RxxWb9A8kCxFfjL45Jm8oOV+LnaADRfTF5oxjl0Hrak= User-Agent: Pan/0.160 (Toresk; ) Xref: csiph.com alt.folklore.computers:230391 comp.os.linux.misc:66086 On Wed, 5 Mar 2025 01:28:16 +0000, The Natural Philosopher wrote: > On 04/03/2025 20:59, rbowman wrote: >> On Tue, 04 Mar 2025 15:38:57 GMT, Scott Lurndal wrote: >> >> >>> Perhaps not, but snprintf can easily append to prior snprint output. >>> No need to do it all at once. >>> >>> sprintf has been deprecated for decades. >> >> I often use sprintf() like >> >> char* ptr = errbuf; >> >> ptr += sprintf(ptr, "prymed LogiOpt settings:\n"); >> ptr += sprintf(ptr, "\tcfslib debug : %x\n", cfslib_debug); >> ptr += sprintf(ptr, "\tdata bits : %d\n", data_bits); ptr += >> sprintf(ptr, "\tdebug : %x\n", debug); >> ... >> >> > Yes, That does have the advantage of putting the elements that relate > closer together, but its fucking inefficient code wise. There are places, fewer than most people think, where maximum code efficiency is important. Otherwise readability and maintainability trump efficient. In this case it executes once at program startup and logs what configuration items were set.