Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: John Ames Newsgroups: comp.os.linux.misc Subject: Re: C/C++ timeline (was Re: Python: A Little Trick For Every Need) Date: Fri, 6 Feb 2026 13:55:13 -0800 Organization: A place where nothing fits quite right Lines: 58 Message-ID: <20260206135513.00001a9e@gmail.com> References: <10lrt1t$16vf1$1@dont-email.me> <-EOdnRUZmNTqQx_0nZ2dnZfqn_qdnZ2d@giganews.com> <10lvc6a$2a0lm$4@dont-email.me> <10lvt12$2g653$1@dont-email.me> <10m0915$2ka88$5@dont-email.me> <10m0fnd$2n7r1$3@dont-email.me> <10m25v7$36k4g$3@dont-email.me> <10m2855$38cir$2@dont-email.me> <10m2b84$30icq$1@dont-email.me> <20260205080604.00002be0@gmail.com> <20260205095745.0000319c@gmail.com> <20260206112850.00006164@gmail.com> <10m5knv$h5mp$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Fri, 06 Feb 2026 21:55:18 +0000 (UTC) Injection-Info: dont-email.me; posting-host="e773039c119d47a2d73f7b6a13718f13"; logging-data="576116"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UhQ7H4+76G+ArsKuD1FN0JTGq/UviF9U=" Cancel-Lock: sha1:NSQkzUeKyISO+JBo2MCGTwm2kX4= X-Newsreader: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Xref: csiph.com comp.os.linux.misc:81804 On Fri, 6 Feb 2026 20:59:44 -0000 (UTC) Lawrence D=E2=80=99Oliveiro wrote: > > ... [Java=E2=80=99s] classes *aren't* namespaces, so there's no class > > equivalent for using in C++ - so you can't just call > > helperFunction(someObject), you have to write > > utilityClass.helperFunction(someObject) instead. =20 >=20 > I forget that - but it only partially mitigates the problem. You can get System.out.println() down to out.println() f'rexample, but AFAICT you still have to package functions into a container class and call them as methods of that class; you can't just write println("a string") like you can in any decent, humane language. That's conceptually confusing on top of being annoying; class methods should represent operations on objects of that class, but since there's no way to create generalized functions not attached to a class, you end up with classes that serve no purpose other than to aggregate random utility functions. (In the best case, they might at least be organized - java.lang.Math f'rexample has the decency to contain only math-y sorts of entities - but anyone having a passing familiarity with human nature will know how often that's actually the case in the Real World.) But nobody declares a Math object any time they need a number variable to "do math at" at some point in their program; they have objects of specific number-type classes for that. So instead of doing things sensibly: Integer anInteger; Double aDouble =3D 1.5; anInteger =3D aDouble.round(); ...you have to bring some other miscellaneous class into view: Integer anInteger; Double aDouble =3D 1.5; anInteger =3D Math.round(aDouble); ...except when, for some reason, you don't: Integer a =3D 2, b =3D 3; Integer c =3D b.max(a, b); ...except that this is not properly a method of the *object,* but a static method of the *class,* so: Integer a =3D 2, b =3D 3; Integer c =3D b.max(a, c); ...is valid even though b has nothing at all to do with matters. Smalltalk got this right (math operations are methods of Number, and other number types like Integer are subclasses of Number;) Java is just arbitrary and confusing for no reason.