It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I noticed this for a while too and so is UE engine games too, back then they ran like butter now a lot of them are super taxing on hardware.
I was studying C# in College ~1991, I learned Java for a Cert. in ~1997.
The reason they differ wildly is that C# works out of the box, where Java failed compiling legitimate code even on the school computers. Language is loose and undefined which makes for the nightmare.

Multi-Platform is the Culprit so yes, they put in the slowest possible code that works on the worst possible "Device" like tablet or cellphone, as far as gaming. Thus you have sloware games un-optimized for PC in any way shape or form. You're lucky that there are x64 cellphones.
avatar
AS882010M0: I was studying C# in College ~1991, I learned Java for a Cert. in ~1997.
The reason they differ wildly is that C# works out of the box, where Java failed compiling legitimate code even on the school computers. Language is loose and undefined which makes for the nightmare.

Multi-Platform is the Culprit so yes, they put in the slowest possible code that works on the worst possible "Device" like tablet or cellphone, as far as gaming. Thus you have sloware games un-optimized for PC in any way shape or form. You're lucky that there are x64 cellphones.
Looks like it really has been a long time since you were using Java - or you are bad at coding (when it comes to Java). My legitimate code also works on school computers. My first code (it was a test project for modular multithreaded text management with UI) I wrote on computers with Sun and Solaris and I can still compile it for Java 20 and run it on a Windows 11 computer. And that is code from before the introduction of generics. Since generics a lot has become idiot proof. Before that the programmer had to know what he sotred in vectors and lists.

C# has some advantages, like more accessible handling for properties. Java has other advantages (fun with Enums), both have their place in the modern world, C# for Windows applications, Java for all the rest.


Btw, could it be you are confusing C++ (or another C version) with C#? 1991 just doesn't do it for me, when it comes to C#
[url=https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#History]https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#History[/url]
avatar
AS882010M0: I was studying C# in College ~1991, I learned Java for a Cert. in ~1997.
The reason they differ wildly is that C# works out of the box, where Java failed compiling legitimate code even on the school computers. Language is loose and undefined which makes for the nightmare.

Multi-Platform is the Culprit so yes, they put in the slowest possible code that works on the worst possible "Device" like tablet or cellphone, as far as gaming. Thus you have sloware games un-optimized for PC in any way shape or form. You're lucky that there are x64 cellphones.
Funny how this thread is full of non-programmers explaining why things are the way they are.. as a professional software developer, I always get a little chuckle out of it.

By the way, C# was first released in 2000.
Given that he mixed up C# and C/C++, I'm guessing he meant Javascript not Java.

Loose and undefined sums up early Javascript for sure.

But it's "their" fault for sure.
avatar
neumi5694: C# has some advantages, like more accessible handling for properties. Java has other advantages (fun with Enums), both have their place in the modern world, C# for Windows applications, Java for all the rest.
Except that, at least with Java (not sure about C#), the language is only good for one specific paradigm (object-oriented), to the point where you can't even write a hello world program without declaring a class.

avatar
lupineshadow: Loose and undefined sums up early Javascript for sure.
The term "undefined" is really best applied to C. For example, in C, what is 2 + "2"? (1 + "1" is actually defined, but 2 + "2" will compile but is undefined.)
Post edited May 23, 2023 by dtgreene
How is 1 + "1" defined in C?

printf("%d", 1 + "1"); will output...?
avatar
dtgreene: Except that, at least with Java (not sure about C#), the language is only good for one specific paradigm (object-oriented), to the point where you can't even write a hello world program without declaring a class.
Of course. And the same is valid for C#.
why-main-method-in-c-sharp-is-always-placed-inside-the-class-but-not-in-c

They are object oriented languages. If you don't want to program object oriented, don't use a object oriented language.
Having runnable programs outside classes is very outdated.

In both languages this "sum" is a string concattenation, there is no alternative, since one of the two components is a String.

You should really try "Smalltalk". Now THAT's an OO language, that could drive one crazy.

avatar
lupineshadow: printf("%d", 1 + "1"); will output...?
In Java this (of course using System.out) would show a warning when compiling and cause an error when executed.
Post edited May 23, 2023 by neumi5694
avatar
neumi5694: Having runnable programs outside classes is very outdated.
I disagree. Even modern languages, like Python and even Rust, have programs that run outside of classes. In fact, Python doesn't even require that the code be in a function, and Rust doesn't even have classes! (Rust does have structs and traits, which are somewhat similar, however.)

avatar
lupineshadow: How is 1 + "1" defined in C?

printf("%d", 1 + "1"); will output...?
I don't think the output of that is defined, as "%d" specifies an integer, but you're passing it a pointer to char (char *).

What I've written is actually a case of pointer arithmetic. "1" is a pointer to the first character of that string, which is null terminated. "1" + 1, which is the same as 1 + "1", "1"[1], or even 1["1"], is a pointer to the second character, which is the null terminator. Therefore, the expression actually evaluates to a pointer to the empty string, and printing it (with "%s", not "%d") will just print the empty string.

2 + "2", on the other hand, points to just after the null terminator, and I'm pretty sure that's not defined in C. (In particular, trying to print it could, theoretically, print forever or segfault.)
Post edited May 23, 2023 by dtgreene
avatar
neumi5694: In both languages this "sum" is a string concattenation, there is no alternative, since one of the two components is a String.

[...]
avatar
lupineshadow: printf("%d", 1 + "1"); will output...?
avatar
neumi5694: In Java this (of course using System.out) would show a warning when compiling and cause an error when executed.
Other languages behave differently.
* In perl, the expression evaluates to 2. (The string is treated as a number, and the values are added.)
* In JavaScript, the expression evaluates to '11'. (The number is treated as a string, and the values are concatenated.)
* In Python, the expression throws a TypeError at runtime.
* In Rust, the expression will fail to compile with an error about a trait not being implemented.
avatar
dtgreene: I disagree. Even modern languages, like Python and even Rust, have programs that run outside of classes.
Python is a script language, those have very different usage purposes and are designed to behave drastically different.
In object oriented languages everything has to be a class, where in C++' case they made an exception for the main method for old times sake.

Btw, the comparison was about C# vs Java.
Post edited May 23, 2023 by neumi5694
avatar
lupineshadow: How is 1 + "1" defined in C?

printf("%d", 1 + "1"); will output...?
avatar
dtgreene: I don't think the output of that is defined, as "%d" specifies an integer, but you're passing it a pointer to char (char *).

What I've written is actually a case of pointer arithmetic. "1" is a pointer to the first character of that string, which is null terminated. "1" + 1, which is the same as 1 + "1", "1"[1], or even 1["1"], is a pointer to the second character, which is the null terminator. Therefore, the expression actually evaluates to a pointer to the empty string, and printing it (with "%s", not "%d") will just print the empty string.

2 + "2", on the other hand, points to just after the null terminator, and I'm pretty sure that's not defined in C. (In particular, trying to print it could, theoretically, print forever or segfault.)
But you wrote 1 + "1"
avatar
dtgreene: I disagree. Even modern languages, like Python and even Rust, have programs that run outside of classes.
avatar
neumi5694: Python is a script language, those have very different usage purposes and are designed to behave drastically different.
In object oriented languages everything has to be a class, where in C++' case they made an exception for the main method for old times sake.

Btw, the comparison was about C# vs Java.
The comparison was made by a drug addled bigot who thinks he knows programming because he took some courses once.

And he has derailed this thread like he has derailed a lot of other threads lately.
Post edited May 23, 2023 by lupineshadow
avatar
lupineshadow: a ****consored**** derailed this thread [...]
We did our part as well :)

But I agree, let's just stop it here in any case.
avatar
dtgreene: I don't think the output of that is defined, as "%d" specifies an integer, but you're passing it a pointer to char (char *).

What I've written is actually a case of pointer arithmetic. "1" is a pointer to the first character of that string, which is null terminated. "1" + 1, which is the same as 1 + "1", "1"[1], or even 1["1"], is a pointer to the second character, which is the null terminator. Therefore, the expression actually evaluates to a pointer to the empty string, and printing it (with "%s", not "%d") will just print the empty string.

2 + "2", on the other hand, points to just after the null terminator, and I'm pretty sure that's not defined in C. (In particular, trying to print it could, theoretically, print forever or segfault.)
avatar
lupineshadow: But you wrote 1 + "1"
They're confused.

1+"1" is indeed defined, and it evaluates to a pointer that points one past the first character of the string "1". That would be a pointer to the terminating NUL byte. 2 + "2" is likewise defined; it is a pointer one past the array containing the string "2". However, you must not dereference that pointer.

"1"[1] would not be a pointer.
Post edited May 23, 2023 by clarry
avatar
lupineshadow: But you wrote 1 + "1"
In C, 1 + "1" and "1" + 1 are the same

avatar
neumi5694: In object oriented languages everything has to be a class, where in C++' case they made an exception for the main method for old times sake.
C++ isn't a strictly object-oriented language. You can write plenty of C++, even using modern features like lambdas, without declaring any classes.

Furthermore, even if you are going to use C++'s object system, the keyword "class" actually isn't necessary; the only difference between a class and a struct in C++ is whether members are private or public by default.
Post edited May 23, 2023 by dtgreene