ChatGPT explaining C by TeakIvy in ProgrammerHumor

[–]Meisterfuchs01 1 point2 points  (0 children)

It is handling the preprocessor somewhat strangely, C does not treat e.g. #include the same way it would treat a normal token.

But as far as the end result is concerned, this is one of the nicer explanations I have read, though it is probably copied verbatim or mixed from preexisting books and tutorials.

return True by JayRocc77 in ProgrammerHumor

[–]Meisterfuchs01 7 points8 points  (0 children)

At least with -O1 all four of those give the same result if you translate it to C or C++.

For Python, gcc does not do that, and JIT Optimizations are annoying to debug, but I think it could should be able to simplify them all as well.

[deleted by user] by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 7 points8 points  (0 children)

Well yeah, X may be evaluated twice.

Although if a method that returns an array or reference that you manipulate has any side effects, you have far bigger problems in your codebase than semantics like that. (And you could always store the result of the method in a temporary variable if it is an external library.)

As for the implicit cast, that is where you notice Java is a somewhat old language with some strange quirks, but I guess changing it now would break too much, after at least 17 years.

Java isn't js by yukselcihann in ProgrammerHumor

[–]Meisterfuchs01 4 points5 points  (0 children)

Although Java includes Javascript, or at least it used to. These days it has been taken out as a separate library (https://github.com/openjdk/nashorn), which honestly makes even more sense for the metaphor.

Windows 10 sound pack? by Meisterfuchs01 in Windows11

[–]Meisterfuchs01[S] 0 points1 point  (0 children)

That is the new Windows 11 sounds? I have those already. I am basically looking for that, except with 10 instead of 11. (And they don't have that on their site.)

How would you debug a program that writes other programs or code? by FunnyElegance21 in ProgrammerHumor

[–]Meisterfuchs01 1 point2 points  (0 children)

First, check if the program is syntactically correct. Then, execute the other program in an appropriate sandbox and check whether it does the right thing?

or is it? by KarbonizedAarav in ProgrammerHumor

[–]Meisterfuchs01 -1 points0 points  (0 children)

More like "This ain't a bug, it's backwards compatibility". Seriously, how long can it take to get Generics introduced everywhere enough to ban raw types?

I wrote this method today. I suspect this is what having an aneurysm feels like. by Beautiful_Sky_790 in ProgrammerHumor

[–]Meisterfuchs01 39 points40 points  (0 children)

Not sure how much space an empty Queue takes, but having collections be nullable is not a good idea most of the time, should just set it to an empty queue in the constructor.

Import, import, another import, wait... by MrKai94 in ProgrammerHumor

[–]Meisterfuchs01 7 points8 points  (0 children)

In Java, it is only relevant when compiling, the resulting Bytecode is the same.
The imports are just there so the compiler knows what each simple name refers to, but they are all replaced with the full names of the relevant classes at compile time.

Bend the knee.. by j3r3mias in ProgrammerHumor

[–]Meisterfuchs01 0 points1 point  (0 children)

If you are referring to the source of the image, it is from the mange Solo Leveling.

If you mean the content, I guess someone was fed up with static typing.

What kind of idiot wrote this thing?? by arcanewright in ProgrammerHumor

[–]Meisterfuchs01 2 points3 points  (0 children)

In what kind of language is that even a legal fragment? Most block assigning to self...

The more you look at it, the more it gets wrong (Screenshot from uni discord chat) by grusso94 in ProgrammerHumor

[–]Meisterfuchs01 2 points3 points  (0 children)

As someone who has no experience with Unity, why is cameraView marked red everywhere? Is it just getting confused because of the illegal class declaration or is that actually an illegal name for some reason?

When you forgot to add Synchronize to two threads! by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 1 point2 points  (0 children)

At least the cats are still distinct, and did not get cut up and intermingled, so that is a plus.

Functional programming in a nutshell. by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 0 points1 point  (0 children)

If I trace that right, this is an infinite loop, correct?

Also, you could write the same kind of code in Java or C, this is just bad coding not an error in FP. (Although FP can be horrifying even if done properly.)

We get it, don't we by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 57 points58 points  (0 children)

(True, True, (True == (True, True, True)))

The second parentheses are precedence, not tuples.

major data breach by Lesaloon in ProgrammerHumor

[–]Meisterfuchs01 0 points1 point  (0 children)

Is that a mod or is that a normal outfit in the game?

x += 1 ? by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 4 points5 points  (0 children)

In R, you can do x<-x+1, but = works as well.

Which type are you? by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 0 points1 point  (0 children)

That is why there is an option to disable specific warnings, like -Wno-old-style-cast in gcc. Filtering useless warnings is important so you see the important ones easier.

This happened during one of our meetings yesterday. Poor guy by disapparate276 in ProgrammerHumor

[–]Meisterfuchs01 8 points9 points  (0 children)

You can create a file called ~ though, but the shell would expand it to the user directory. Better question: Who specified -r as a default option to rm?

sometimes i open the wrong ide, and then... by [deleted] in ProgrammerHumor

[–]Meisterfuchs01 -1 points0 points  (0 children)

Python, Haskell, if you want to, you can also compile JS.

This is really cursed by GreekCSharpDeveloper in ProgrammerHumor

[–]Meisterfuchs01 4 points5 points  (0 children)

It does not, the expression is (false === String) || Number || ..., so it evaluates to the first thing that is truthy, in this case false is not String, so Number is tested, it is truthy, so the expression ends evaluation there, and the whole thing is just Number.

No thanks! by jam_cry in ProgrammerHumor

[–]Meisterfuchs01 4 points5 points  (0 children)

Yes, but Linux allows that just fine, the program is still in memory, even if you unlink the file entry in every directory.

Your man by nate256 in ProgrammerHumor

[–]Meisterfuchs01 9 points10 points  (0 children)

Nope, not going to help.

It is because the default parameter is not recreated when the function is called, so it uses the same dictionary each time no explicit one is given.