99
They call me Stacy (lemmy.world)

I could only imagine what the default:'friend' actually is on the backend.

top 14 comments
sorted by: hot top controversial new old
[-] misterdoctor@lemmy.world 10 points 6 days ago

Hey, { first_name|truncatewords: 1|slugify|title| default:'friend' } was my father, call me Mike!

[-] lime@feddit.nu 6 points 6 days ago

that format would mangle so many names. my legal name is my middle name, so it would fail. my grandfather's first name was Jan Erik (with a space, it's still a single name), it would fail on that. i know a guy named Göran, it would fail on that (ö is not an accented o, it is a separate letter, but it will slugify to o due to browsers being browsers).

actually, come to think of it, wouldn't this also mangle the default due to 'friend' not being properly capitalized?

basically, we've learned nothing since 'falsehoods programmers believe about names'. that was 14 years ago.

[-] dohpaz42@lemmy.world 29 points 1 week ago

There is no default:’friend’ on the backend. This is a template language that basically takes a first name, returns the first word, replaces any special characters with ASCII equivalent ones (e.g., ö => o), title cases it, and if it’s blank it will return ‘friend’ instead of an empty string.

[-] dsilverz@thelemmy.club 11 points 1 week ago

There is no default:’friend’ on the backend.

It's deep in so many ways... Indeed, there is no default:'friend' on the backend. 🥲

[-] dohpaz42@lemmy.world 4 points 6 days ago
[-] PlexSheep@infosec.pub 5 points 1 week ago

Seems so. But a } is missing, which is why it's showing like that.

[-] Anticorp@lemmy.world 13 points 1 week ago

Oops, someone forgot a curly brace!

[-] CluckN@lemmy.world 7 points 1 week ago
[-] Sanctus@lemmy.world 6 points 1 week ago

This is my best guess. I have never used it. NPM and JS are not fun for me. Like look at those dependencies.

[-] SickDisturbence@lemmynsfw.com 2 points 6 days ago

Hmm, I see zero direct dependencies in that npm page. Were you looking at dependants? Packages that need the slug package?

[-] Sanctus@lemmy.world 1 points 6 days ago

Awh shit, well I can't read. Which is also why I dont use JS or NPM.

[-] paraphrand@lemmy.world 5 points 1 week ago* (last edited 1 week ago)

Some systems define a slug as the part of a URL that identifies a page in human-readable keywords. It is usually the end part of the URL (specifically of the path / pathinfo part), which can be interpreted as the name of the resource, similar to the basename in a filename or the title of a page. The name is based on the use of the word slug in the news media to indicate a short name given to an article for internal use.

[-] Sanctus@lemmy.world 1 points 6 days ago

I'm really learning a lot by posting this! Thats interesting for sure. I think I'm just more than happy my own career never involves me in this side of tech lol

this post was submitted on 14 Nov 2024
99 points (98.1% liked)

Software Gore

4786 readers
189 users here now

Welcome to /c/SoftwareGore!


This is a community where you can poke fun at nasty software. This community is your go-to destination to look at the most cringe-worthy and facepalm-inducing moments of software gone wrong. Whether it's a user interface that defies all logic, a crash that leaves you in disbelief, silly bugs or glitches that make you go crazy, or an error message that feels like it was written by an unpaid intern, this is the place to see them all!

Remember to read the rules before you make a post or comment!


Community Rules - Click to expand


These rules are subject to change at any time with or without prior notice. (last updated: 7th December 2023 - Introduction of Rule 11 with one sub-rule prohibiting posting of AI content)


  1. This community is a part of the Lemmy.world instance. You must follow its Code of Conduct (https://mastodon.world/about).
  2. Please keep all discussions in English. This makes communication and moderation much easier.
  3. Only post content that's appropriate to this community. Inappropriate posts will be removed.
  4. NSFW content of any kind is not allowed in this community.
  5. Do not create duplicate posts or comments. Such duplicated content will be removed. This also includes spamming.
  6. Do not repost media that has already been posted in the last 30 days. Such reposts will be deleted. Non-original content and reposts from external websites are allowed.
  7. Absolutely no discussion regarding politics are allowed. There are plenty of other places to voice your opinions, but fights regarding your political opinion is the last thing needed in this community.
  8. Keep all discussions civil and lighthearted.
    • Do not promote harmful activities.
    • Don't be a bigot.
    • Hate speech, harassment or discrimination based on one's race, ethnicity, gender, sexuality, religion, beliefs or any other identity is strictly disallowed. Everyone is welcome and encouraged to discuss in this community.
  9. The moderators retain the right to remove any post or comment and ban users/bots that do not necessarily violate these rules if deemed necessary.
  10. At last, use common sense. If you think you shouldn't say something to a person in real life, then don't say it here.
  11. Community specific rules:
    • Posts that contain any AI-related content as the main focus (for example: AI “hallucinations”, repeated words or phrases, different than expected responses, etc.) will be removed. (polled)


You should also check out these awesome communities!


founded 1 year ago
MODERATORS