u/vegan_antitheist

Why you shouldn't write comments

The Java channel just posted this short:
https://www.youtube.com/shorts/q5EuaH5n65g

I think the reason why beginners write such useless comments is because tutorials use them to describe what the code does. But you should never do that in your own code. I rare situations you might use a commend to explain why it is like that.

Sometimes you describe a technical detail that is irrelevant for javadoc because you could just as well do something else to produce the correct result. You try to make it obvious but a quick note to why it was solved like this might be useful.

Sometimes it's just about something not being obvious.
For example if you do getFirst() on a stream and it's not obvious why the first element is the right one because sorting was done somewhere else. In that case you might want to explain that. And the method the generates the sequence must have a javadoc explaining the order that can be expected. But even better would be an assertions, where you check that it's really the expected item or that the order of the list if correct. Assertions are even more misunderstood than comments. They don't replace unit tests. They replace comments.

Whenever you want to write a comment, do this:

  • Try to rewrite the code so it's easy to understand without a comment.
  • Use javadoc instead of comments.
    • Describe what the caller can expect from the method, not how it's implemented.
    • In some cases you might even want to use a Java snippet. Did you know you can include real, compilable code in your javadoc? See: Programmer's Guide to Snippets
  • Use assertions instead of comments.
u/vegan_antitheist — 2 days ago

Do you see the garbled letters on this roof I saw today in "Switzerland"? Typical AI artifact.

What is this even supposed to say? I think the first letter is supposed to be an H. Then R or A. Then they don't even look like any letter.
On the second line it looks like some numbers are in there. 15 FSP-23?

Why would there even be letters on a roof?

They can't fool me!

Street view: https://maps.app.goo.gl/sGvcAAak67sscWR36

u/vegan_antitheist — 5 days ago

How is my street photography? Be honest.

I just saw someone else get absolutely slated for his photography, so I thought I'd submit myself to the same treatment. Be brutally honest.

Maybe it's a bit much, but I didn't see any rule on how many pictures you can add. There are 300 from my recent trip to Berlin and I picked these by going through them all and asking myself: "Do I want feedback on this?" So, they are not just my favourite ones.

The reason I tried street photography was that I like photography in general and I was in Berlin. I usually do wildlife, but I don't want to just take snapshots like any tourist. I'm aware of the "This is not the venue for your vacation photos or model shoots" in the rules, so if you think those are just my vacation photos, then I am sorry and I will leave in embarrassment.

I like to get feedback on everything.

  • Is it even street photography?
  • Is it interesting?
  • How is the editing?
  • Which one is your favourite? And if you hate them all, can you at least guess which one I like best?
  • Which ones are bad? Just touristy? Too cliché? Or just bad in general?

Gear:

  • Sony α7R V (61 MP, Full Frame)
  • Sigma 50mm F2 DG DN Contemporary
  • Sony FE 85mm F1.4 GM II (SEL85F14GM2)
u/vegan_antitheist — 13 days ago

I have a Bluray that I can't read using MakeMKV.

Film: Stürm: Bis wir tot sind oder frei
https://www.imdb.com/title/tt9502538
Barcode: 7 613059 327634

Version: MakeMKV v1.18.3 [win(x64-release)]

It doesn't even recognise the disk. I had to open it manually. It then sees that D: is a bluray and starts the analysis of the medium. But this fails.

Log (German):

Öffne Dateien auf Festplatte in D:
Inhalte-Hashtabelle geladen, überprüfe Integrität der M2TS-Dateien.
Dekodierung der Audio- und Videodaten von Titel #0 ist fehlgeschlagen. Ungültiger Mux oder interner Fehler. Der Titel wurde übersprungen.
Titel #00002.mpls wurde übersprungen
Titel #00000.mpls hat eine Länge von 26 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Dekodierung der Audio- und Videodaten von Titel #0 ist fehlgeschlagen. Ungültiger Mux oder interner Fehler. Der Titel wurde übersprungen.
Titel #00004.m2ts wurde übersprungen
Titel #00006.m2ts hat eine Länge von 76 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Titel #00002.m2ts hat eine Länge von 60 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Titel #00007.m2ts hat eine Länge von 10 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Titel #00001.m2ts hat eine Länge von 10 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Titel #00000.m2ts hat eine Länge von 16 Sekunden und wurde übersprungen, da die minimale Titellänge 120 Sekunden beträgt
Das Öffnen der Disk schlug fehl 

The last one means "Opening the disk failed". But there is no message explaining what the actual problem is. It just fails without further information.

The disk works fine on the PlayStation 5 Pro.

Note: I also can't watch it on VLC. But I think that's just because it's encrypted and VLC can't decode bluray.

reddit.com
u/vegan_antitheist — 13 days ago

I pay for reddit and youtube. There should be no ads.
But today I saw unskippable ads before a video that was posted on reddit. That's on a desktop browser. Reddit shows youtube videos that were posted as a link directly. I wouldn't see any ads on youtube. Embedded videos should also not show ads. Reddit shouldn't add any ads.

Why do I still get ads?
Is it because they use www.youtube-nocookie.com?
Here's the element in reddit's source code:

<video tabindex="-1" aria-hidden="true" class="video-stream html5-main-video" webkit-playsinline="" playsinline="" controlslist="nodownload" style="width: 532px; height: 299px; left: 1px; top: 0px;" src="blob:https://www.youtube-nocookie.com/41b3f986-cc80-4b4a-86a9-8e8865463c40"></video>
reddit.com
u/vegan_antitheist — 15 days ago