1194
Comenting code (lemmy.ml)
top 50 comments
sorted by: hot top controversial new old
[-] piko@chaos.social 2 points 4 days ago

@Vordimous Wait for daylight saving time...

[-] Vordimous@lemmy.ml 1 points 4 days ago

Is that when all of the devs write the comments on the line after the code?

[-] figaro@lemdro.id 9 points 6 days ago

Made a comment

[-] linkhidalgogato@lemmy.ml 7 points 6 days ago

basically how it feel when a professor requires u comment every single line of code u write to explain it. I know people tend to drop out of real engineering to do programing but an entire 4 years of this bullshit as opposed to just a couple classes sounds way worse than calc 3 or differential equations.

[-] Urist@lemmy.ml 1 points 6 days ago* (last edited 6 days ago)

The only problem with courses like calc 3 and differential equations (in my experience, as a mathematician) is that they are cheating somewhat. By cheating I mean relying on inadequate, flawed or entirely omitted proofs. How can the students truly understand something if they are not presented the whole story (or at least reference)?

The good thing about these courses are that there are usually no shortage of relevant exercises!

[-] linkhidalgogato@lemmy.ml 1 points 5 days ago

u could be right calc 3 was alright, pretty fun actually but differential equations i still dont get at all, maybe i should try learn it on my own now with more time and no pressure.

[-] Urist@lemmy.ml 1 points 5 days ago

I detested differential equations. However, that was more due to how it was presented than the underlying, surprisingly, beautiful math.

[-] chautalees@lemmy.world 2 points 6 days ago

When you ask a Dev to test their own code

[-] x00za@lemmy.dbzer0.com 2 points 6 days ago
// Open file
fopen();
[-] temmink@feddit.org 3 points 6 days ago

Will each level of smaller clocks get one additional hour?

[-] sjh@sh.itjust.works 1 points 6 days ago

Commenting code is a super important habit to get into—it not only helps others understand your thought process but also makes it easier for you to pick up where you left off if you revisit the code later. Plus, well-commented code can significantly reduce the onboarding time for new developers on a project. Remember, comments should explain the "why" behind the code, not just the "what." For instance, stating why you chose a particular algorithm or data structure can be far more helpful than just labeling it. According to a study by SmartBear, 44% of developers regard poorly documented code as a top cause of project delays, so it’s definitely worth the extra effort!

[-] doktormerlin@feddit.org 1 points 6 days ago

But it's also important to learn that comments should be brief and concise. We have one file from an ex-dev in which there are 750 lines of code and 2000 lines of comment, when someone wants to maintain this code they always have a hard time because this many comments are taking up so much screen real estate that you can't find the code that actually does stuff

[-] shasta@lemm.ee 2 points 5 days ago
[-] ZILtoid1991@lemmy.world 1 points 5 days ago

I only have a 3k monitor, and I can manage it. Sometimes I comment line-by-line even.

[-] essteeyou@lemmy.world 123 points 1 week ago* (last edited 6 days ago)
/**
 * Gets the user
 **/
fun getUser() {
    return this.user;
}
[-] lord_ryvan@ttrpg.network 8 points 6 days ago* (last edited 6 days ago)

Okay now I get the joke.
I hate these kind of people.

By the way, your ``` both need to be on their own, separate line

[-] essteeyou@lemmy.world 3 points 6 days ago

It renders correctly in my client (Sync), what are you using? I'll edit it anyway.

[-] lord_ryvan@ttrpg.network 2 points 6 days ago* (last edited 6 days ago)

It renders correctly on the web as well for me.

But the ``` being on their own line is how to write it properly, as stated this website among many others.

This way, you can put the intended programming language on the same line as the first ```, ensuring proper colour coding!

Ex.

echo "Hello $name\n";
echo "Hello $name\n";

EDIT I checked on mobile, it rendered odd on Jerboa for me:

Screenshot of essteeyou@lemmy.world their comment in the Jerboa client before the edit

Now it is fixed:

Screenshot of essteeyou@lemmy.world their comment in the Jerboa client after the edit

[-] essteeyou@lemmy.world 2 points 6 days ago

Yep, I know, but my code isn't in a real language.

[-] lord_ryvan@ttrpg.network 1 points 6 days ago

You can also not do it, it was just an additional comment!

[-] essteeyou@lemmy.world 2 points 6 days ago

Thanks for your code review. :-D

[-] some_guy@lemmy.sdf.org 33 points 1 week ago

I'm sorry, I don't think I understand what's happening here…

load more comments (3 replies)
[-] JasonDJ@lemmy.zip 84 points 1 week ago

My comments are just the code that didn't work but I don't want to delete yet because I might make it work except I never will be cause I already rewrote it so it does.

load more comments (6 replies)
[-] Sparky@lemmy.blahaj.zone 52 points 1 week ago* (last edited 1 week ago)

Hey thanks for reminding me I made a clock squared in blender about 2 years ago

yes there is an error in the image, and no I'm not telling you where it is

[-] cmhe@lemmy.world 4 points 6 days ago

An interesting concept would be if all hand on the 12 clocks would work, but the hands of the clock in the middle are stuck at 12 position, this way the hands in the middle would point to the clock showing the correct time.

[-] Sparky@lemmy.blahaj.zone 1 points 6 days ago

That's a neat way of doing it

[-] flora_explora@beehaw.org 2 points 6 days ago* (last edited 6 days ago)

What a fun idea!

Is it on purpose that all clocks in this are coupled at the 3 o'clock position? I assume all the clocks go the same speed. Then the large clock and all the smaller clocks at the 3 o'clock position (there are 13 of them) would show the same time. E.g. in one hour, the 12 o'clock position would show 1 o'clock, but the large clock and all the clocks on the 3 o'clock position would show 4 o'clock.

Oh and why is it a clock squared if you have three layers of clocks? Isn't it cubed then?

[-] Sparky@lemmy.blahaj.zone 1 points 6 days ago

I was mainly thinking of making some recursion hence why all the subclocks mirror the parent clock (for that given hour). Also I called it clock squared because I didn't think the resolution would be high enough for people to actually notice the 3rd level of clocks.

You might notice that some dials don't really align with the hours they're supposed to show. That's because I had to place a bunch of clocks at varying hours with a viewport rendering the parent clock at an angle that probably made it difficult to spot the errors. I rendered it once and didn't bother re-rendering it once I saw the errors :)

[-] flora_explora@beehaw.org 2 points 6 days ago

Haha yes, recursion is always fun!

Although I'm still confused on what the clock would show in an hour. Because if the subclocks mirror the parent clock at the given time, then they would all be stuck to the hour they are positioned on? Or if they can move then the sublcocks are coupled to 3 o'clock of the main clock. But well, it is all hypothetical anyways :D

[-] Sparky@lemmy.blahaj.zone 2 points 6 days ago

Idk maybe the sub clocks are static and never change :3

[-] oo1@lemmings.world 46 points 1 week ago

at 6 it says 12:30

load more comments (4 replies)
[-] goatmeal@midwest.social 34 points 1 week ago

I know I’m probably doing it wrong but this is how I feel whenever I write unit tests

load more comments
view more: next ›
this post was submitted on 28 Sep 2024
1194 points (99.2% liked)

Programmer Humor

32190 readers
454 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS