this post was submitted on 07 Feb 2025
542 points (98.0% liked)

Programmer Humor

20417 readers
136 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] JaddedFauceet@lemmy.world 13 points 2 days ago (2 children)

I used LLM to format my markdown table (ಥ ͜ʖಥ)

[–] locuester@lemmy.zip 8 points 2 days ago (1 children)

This is a primary use for me. A couple times per day.

That’s part of what makes LLMs so popular with software engineers, they solve lots of trivial daily computer tasks.

[–] meliaesc@lemmy.world 3 points 1 day ago (1 children)

At the cost of only one (1) inhabitable planet!

[–] jdeath@lemm.ee 2 points 1 day ago

ah no there's actually a free plan! /j

[–] jdeath@lemm.ee 1 points 1 day ago (1 children)

oh nice! i use Prettier for that and it has worked fine for a decade or so, but it is really lacking any AI so i have been having to search for alternatives.

maybe PrettierAI, it can use LLMs to format all your code!

[–] JaddedFauceet@lemmy.world 1 points 1 day ago* (last edited 1 day ago) (1 children)

Prettier doesn't make my markdown table prettier tho. This is what i did

prompt

Given the following markdown table

| input | output l
| -- | -- |
| 2.6 | 3 |
| 2.5 | 2 |
| 2.4 | 2 |
| 1.6 | 2 |
| 1.5 | 2 |
| 1.4 | 1 |

Align the vertical bar. Align number to the left

output

Here's the table with the vertical bars aligned and numbers left-aligned:

| input | output l |
|-------|----------|
| 2.6   | 3        |
| 2.5   | 2        |
| 2.4   | 2        |
| 1.6   | 2        |
| 1.5   | 2        |
| 1.4   | 1        |

Each column has been padded so that the vertical bars line up consistently, and the numbers are aligned to the left as requested.

[–] jdeath@lemm.ee 1 points 1 day ago

yeah, you formatted a markdown table. now you're just repeating yourself. Prettier handles that just fine. I have the Prettier VSCode extension and set it as default formatter on save and this gets done automatically for me.

before:

after:

Didn't require a small lake of water and a gigawatt of electricity to compute.. it even works offline!