Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Newsgroups: comp.lang.c++ Subject: Re: C++ (and some C) quiz questions Date: Tue, 17 May 2022 00:34:27 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: <87o7zxqcfw.fsf@bsb.me.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="7660cd5e868edcec25ceffcea488893c"; logging-data="30874"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IGCUDu5El431UHj66WGTi0NlLAudw23E=" Cancel-Lock: sha1:DoV92rufp4SyuEnqUrlv585g3kg= sha1:wpasA/R9iJ1M3P+/SBfP816alr4= X-BSB-Auth: 1.4dd6a69042449f80b37a.20220517003427BST.87o7zxqcfw.fsf@bsb.me.uk Xref: csiph.com comp.lang.c++:84133 Paavo Helde writes: > 16.05.2022 23:09 Christian Gollwitzer kirjutas: >> BTW, in old C when the types were omitted, it was implicit int. How >> about "implicit auto" for today? That way, one could write >>     x = 0.1L; >> or >>     f(x, y) { >>         return 3*x+y; >>     } >> to get a templated function with type inference and get closer to modern >> languages? > > You mean sloppy languages, not modern. At the same time, these sloppy > languages are currently trying to move closer to strictly typed > languages, as - surprise-surprise - sloppy code is not so easy to > maintain. That's why you can now write e.g. in Python things like I doubt CG was referring to Python since it does no type inference. He may be thinking of languages like Haskell that are strongly typed but include very effective type inference. Of course I don't think C++ can or should go down that route, but that's another issue. > def headline(text: str, align: bool = True) -> str: -- Ben.