this post was submitted on 04 Aug 2024
319 points (97.9% liked)

Programmer Humor

19149 readers
1219 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 14 comments
sorted by: hot top controversial new old
[–] Aatube@kbin.melroy.org 180 points 1 month ago (4 children)

https://github.com/type

Sorry for terrifying you when you use a type annotation

[–] cheddar@programming.dev 41 points 1 month ago (1 children)

I still don't understand. I assume there is a plugin that enables github annotations in the code. But why would anyone need that?

[–] GBU_28@lemm.ee 23 points 1 month ago (1 children)

Think of it like git blame

[–] shotgun_crab@lemmy.world 6 points 1 month ago

I'm definitely blaming git(hub) for that

[–] GBU_28@lemm.ee 24 points 1 month ago
[–] hoshikarakitaridia@lemmy.world 18 points 1 month ago

It's beautiful

[–] Lemminary@lemmy.world 73 points 1 month ago (2 children)

VS Code said hot singles in your area, click here for drenched felines.

[–] jaybone@lemmy.world 15 points 1 month ago

Hot singletons in your πr^2

[–] dbx12@programming.dev 9 points 1 month ago

I would go nowhere near a drenched feline since the most common version of them is likely in a very bad mood due to being drenched.

[–] NegativeInf@lemmy.world 39 points 1 month ago

She was just his Type.

[–] raman_klogius@ani.social 15 points 1 month ago

Somewhere in the world, somebody can look at this and truthfully say "she's my type."

[–] BurningnnTree@lemmy.one 8 points 1 month ago* (last edited 1 month ago) (1 children)

Can someone please explain? What would cause VS Code to show an image like this? Is this related to a plugin? (I don't know what a docstring is)

[–] vithigar@lemmy.ca 21 points 1 month ago* (last edited 1 month ago)

A docstring is a comment that is used to annotate types/methods/classes/whatever and can be parsed by the IDE and used to provide various hints/assistance when writing code. Tooltips, parameter type suggestions, intellisense, etc. for things that aren't native parts of the language all usually come from or can be supplemented by docstrings.

The specific format of a docstring varies by language, but many of them prefix meaningful tokens with an @, like @type or @param.

However, if your project is using GitHub it's also quite common to mention users in comments by prefixing their username with an @, so several vscode GitHub extensions will make any "@{real username}" in a comment into a link to that user, which will show a small user tooltip when hovered.

Edit: I appear to have conflated docstrings and docblocks, but then so has the initial post. I guess at some point "docstring" has just taken over to colloquially refer to all of it.