Which programming languages don't u use,and for which reason

How about "D: all of the above"

I (was) fluent in C/C++ but don't see the point.
I don't write C# because I don't write DotNet.
I don't use any of the esoteric fringers because I don't have a need. At all.

I was a heavy ASM coder for years, but no longer have a need.
Except I still use inline ASM in Delphi. A lot.
 
Python. There is no "Perl's TMTOWTDI". That is, I have to write the code exactly as the Creator of the Language would have done it. And 'indents' :(

Java. Single-root hierarchy. There is too much to write to express a simple thought.
 
Go: "they" decided that stylistic preferences should be baked into the language spec (but I do like web-application written in go and vastly prefer them to those written in php, node.js or the like, I just won't write it).
C++: Yeah, far too complex and time-consuming to write (as compared to the options)
Javascript: Ew!. Just, Ew!

(to contrast, I *do* write:
C (programatically, I still think in C),
Rust (still learning. The rust compiler is far too opiniated, but those can (to date) be disabled, unlike Go),
shell (mostly only zsh dialect),
a little python,
and Java (like the language, do NOT like the run-time environment requirements and GC but I haven't programmed in java in years)),
once-upon-a-time I wrote a *lot* in Delphi)
 
I mostly use C++ and shell scripting and correspondingly don't use anything else. Though I tried many other languages, starting with Fortran and ending with Rust.
 
I pretend not to know Java. Concerns about the code it is typically used for.
This. Plus very opinionated decisions in language design, like, "properties" are always bad, "operator overloading" is always bad, but hey, we certainly need "checked exceptions". No, thanks, no java for me...

To the OP: I don't think your perpetual attempts "assessing" programming languages ever leads to something productive. Your "reasons" given here against specific languages are so ridiculously short, they'd be refuted in 1 or 2 sentences each. Instead, better get coding something real and useful, and focus on one language for some time. BTW, in my very personal opinion, C is also a very good choice for that (simple, requires/teaches discipline and some knowledge of how a machine works).
 
In Java, when creating an object of a derived class, during the time the constructor of the base class is running and some function overridden in the derived one is called in it, then exactly that version of the derived class will be called -- https://stackoverflow.com/questions/10404879/polymorphism-and-constructors

But in C++, in this situation, the function of the class whose constructor is currently running will be called.
Code:
#include <iostream>
class A { 
    public: 
    virtual void f() { std::cout << "A::f\n"; }      
    A() { f(); } 
};  
class B : public A { 
    public:     
        virtual void f() { std::cout << "B::f\n"; }      
        B() { f(); } 
};  
int main() {
       B b; 
    return 0;
}
Because in C++, when the base class is working, there is no derived class yet, so there is nothing to call from it. In C++, the virtual call mechanism does not work in constructors (because the information about such a call is not yet defined) and destructors (because the information about such a call is no longer reliable).

As for me, the behavior of Java is illogical :rolleyes:
 
As for me, the behavior of Java is illogical :rolleyes:
I would argue that this kind of code is illogical 😏.

From a conceptual point of view, I'd argue Java's behavior makes more sense here. That way, the most derived type of the object in question doesn't magically change mid-way.

Looking from the technical side, it seems to boil down to the order in which the constructors are invoked. C++ starts at the innermost constructor. When creating your custom OOP code (which I recently did once again in C), you'd typically start at the outmost constructor, which then very early calls "down" to the base constructor. Adding polymorphism, you have to think about when and how to populate your vtable. If this is the very first thing you do in the most derived constructor, you end up with exactly Java's behavior.

Also from the technical side, it's quickly obvious you should just avoid such code, because it's ill-defined. With the "Java model", you'll end up calling a method on an object that isn't (fully) initialized yet.
 
Also from the technical side, it's quickly obvious you should just avoid such code, because it's ill-defined. With the "Java model", you'll end up calling a method on an object that isn't (fully) initialized yet.
In Java - yes, it's better not to write such code. But in C++ such code is quite normal (I think), and the behavior of such code in C++ is well defined (but I don't write such code).
 
Andrey Lanin what I meant by ill-defined was also on the conceptual layer. You'll typically expect the most derived type of an object to be immutable for its whole lifetime. And while you also normally consider construction/initialization to be a (conceptually) atomic thing, it's pretty clear that there must be some internal order of doing it. So, mixing in polymorphism during construction just doesn't make much sense, what happens (and whether that's well-defined) depends on implementation details. As I said, my own recent implementation in C would behave quite similar to Java, and TBH, I didn't even think about that aspect. ;)
 
C++ maintains a strict sequence of calls to both constructors and destructors. As for polymorphic calls during object creation, C++ simply does not allow this - virtual call mechanisms do not work in either constructors or destructors.:)

...and if a virtual function is called in both constructors (of the base and derived class), then this is exactly what the developer wanted (so that when creating an object of the derived class, the function of the base class would be executed first, and then the function of the derived class).
 
To the OP: I don't think your perpetual attempts "assessing" programming languages ever leads to something productive. Your "reasons" given here against specific languages are so ridiculously short, they'd be refuted in 1 or 2 sentences each. Instead, better get coding something real and useful, and focus on one language for some time. BTW, in my very personal opinion, C is also a very good choice for that (simple, requires/teaches discipline and some knowledge of how a machine works).

There is some saying roughly like "you can't evaluate an X before walking N steps with it". I forget whether that saying is about shoes, friends, destinations, or routes to those destinations. It might even be about cigarettes, remember the cowboy with the hole in the shoe who said "I walk miles for a Camel".

Anyway, to have a reasoned opinion about a programming language, one probably should have written tens of thousands of lines in it. Given most programmer's productivity, that is many months or a year. And the answer will be highly dependent on the domain (system, embedded, control, application, web, analytics, ...) and the scope (the programming language suitable for a 100-line quick hack that doesn't survive longer than an afternoon is different from the language suitable for a 10K line multi-month project, and different from a million line system of programs).

Speaking of Java: I used to like it. And I think for certain environment I would still like it. I did a lot of it in the early days, late 1990s. We replaced a half-million line industrial control program (written in C++, but stylistically really C with objects) with Java, from scratch. We spent a lot of effort on building coding styles, solid libraries, conventions, and a programming culture that makes it possible for a large and diverse set of coders to build and use a large system. When I left the company, we had got to about 50K lines. Today it is ~25 years later, and I hear from former colleagues that the system is still in use, that the basic design decisions were kept, and it today contains a total of 17M LoC, used across multiple companies, many divisions, and several 100+ person teams. It can be done in Java, but it requires good engineering and a lot of discipline.

If a similar project started today, would one pick Java again? Good question, and I don't know the answer, since I'm not familiar enough with today's languages. In addition to the usual requirements (ease of coding, absence of memory leak bugs, easy to write parallel code, reasonable performance), other requirements include dynamic loading and unloading of (pre-compiled) code, introspection, and an interpreter for a common scripting language (like Perl/Python/Ruby/...) that is built into the language and can call pre-compiled code. For a large and flexible system, those requirements are needed.

By the way, the above is not an appeal to program in Java. Since leaving that company, I haven't written more than 100 lines in Java, and I don't like reading modern idiomatic Java. But it has (or had?) its place.
 
With the "Java model", you'll end up calling a method on an object that isn't (fully) initialized yet.
And that's why, in the "C++ model", virtual calls in constructors and destructors don't work.Technically, when a constructor is called, the first operation is to initialize the vptr, the class does not know if there are classes derived from it, and the vptr must refer to the virtual function table of that class. When returning to the constructor of a derived class, that constructor shifts the vptr to its virtual function table.
 
And that's why, in the "C++ model", virtual calls in constructors and destructors don't work.
Didn't you say the result is just calling the current class' version? Which would probably lead to a crash if it's unimplemented (null) in the current class, or do compilers catch that? Anyways, I don't like that kind of behavior, I think it's counter-intuitive. That doesn't mean I like Java's behavior either, because it creates an awesome opportunity to shoot your foot by working on uninitialized data (which you can of course avoid if you're aware, but still). IMHO, the only sane thing for a language (and compilers) to do would be to strictly disallow any call to virtual methods during construction (IOW, issue a compile-time diagnostic and refuse compilation). I'd argue code doing such a thing is a sign of a flawed, likely over-complicated, design, which you should fix.

Technically, when a constructor is called, the first operation is to initialize the vptr, the class does not know if there are classes derived from it,
My implementation in C is only slightly different, first thing done in every construction is indeed something similar (initialize a pointer to some "meta object", which contains a class name and the full vtable), but this starts at the most derived type (it was the most straight-forward thing to do in C). This little difference would in practice lead to Java's behavior. As C doesn't support OOP at the language level, I don't expect any compiler diagnostics here of course, I just don't write code doing virtual calls in the constructor. 😁
 
Didn't you say the result is just calling the current class' version?
Yes, that's exactly what I said: first in post 10, then in posts 15 and 17. Simply virtual calls in constructors/destructors become non-virtual/non-polymorphic. Therefore, in C++ the code given in post 10 is quite normal. As for Java, I will still stick to my opinion, which I expressed in post 10.
 
All language which does not keep backward compatibility.
Requing build time options for compilers/linkers and runtime option (including command name) for interpreters are OK, if sanely maintained, just like K&R codes in C.
This way, we all can sanely use old but solid codes until we can take enough time and motivation to rewrite them to newer spec. (Found vulnerabilities are the exceptions, as it needs to be fixed as soon as possible [in seconds basis], but this case, possibly use old spec to fix urgently, though).

If Python somehow keeps backward compatibilities for 2.7 and earlier when they released 3.0, I could have motivation to learn it.
Rust needs de-jure standardization by, hopefully but not limited with, ISO and/or IEC before I consider starting to code with it.
 
Python. I cannot get used to the meaningful whitespace. I also intensely dislike languages like PHP that stuff meaningful "annotations" into lines that are syntactically comments. That hurts my brain. I do actually like how Rust turned out. It took me some getting used to but I feel quite at home with it for my hobby projects.
 
Rust. I can't understand the hype.
Scheme/LISP. I couldn't understand why use it instead of C & Pascal which I used to do all kinds of stuff back then.
Java. I use vim and this language needs something Eclipse to autocomplete this verbose language. But I don't hate it.
Perl is something I have to live with and I guess I grew used to it.
 
Golang: I only have room for one C/C++ replacement and that's Rust
Ruby: Python is right there
Anything vaguely related to LISP: There's too many, someone would have to pay me
 
Back
Top