There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Squirrel , in I'll just sort it myself
@Squirrel@thelemmy.club avatar

Because everyone means “alphabetize” when sorting numbers.

dingleberry , in Zero to Hero in 1 hour

The anklesnappers.

embit , in The lengths we have to go to

He could wrap a rubber band around the screen

MajorHavoc ,

Spoken like a fellow professional Python programmer.

ShittyRedditWasBetter , in Zero to Hero in 1 hour

K8s basics isn’t that hard, but it builds on quite a bit of knowledge. And running anything of complexity to multiple nodes is going to take at least some intermediate tuning to get your app stable.

This is fantastic though.

some_guy , in The lengths we have to go to

I started with Perl. This taught me a certain mindset that works well with Bash and Ruby. I’ve tried to learn Python several times and I just fucking hate it. I gave up when I realized that it just doesn’t work the way that my brain works.

I wonder if the outcome would have been different if I’d started with Python? How might that have shaped my thinking / reasoning? Fwiw, I was also ok with PHP and SQL, but I don’t know much or anything about the backgrounds on those foundations. Maybe my above statements were completely bullshit.

magic_lobster_party ,

I kind of started with Python, and I hate Perl. Relying so much on global variables like $_, @_, $1, $2 is just the worst idea ever. Oh you want to call a function? Better be safe and backup all global variables you’re using, because they will be overwritten! Want to use some regex in a function? Better ensure all callers have made backups of the $1, $2, $3 variables.

The end result is just large amounts of defensive boilerplate everywhere because things will break if you don’t.

There’s also no good way to tell which functions use $_ without looking up the docs or keeping everything in memory.

The only merit Perl got in my opinion is its regex support. Quite handy for bash one liners time from time.

evranch ,

I used to love Perl as it worked the way my brain worked.

Then I started taking medication for ADHD.

I haven’t used Perl since except for text parsing, it’s an absolute hot mess of a language (though very powerful and functional at the things it does well)

some_guy ,

That’s super interesting.

I have a mental divergence that isn’t ADHD. I was reviewing stats on it that said people who have it are some percent more likely to have ADHD. I wonder if my previous enjoyment of Perl is because I’m on an ADHD spectrum. It would be interesting to find out.

thepianistfroggollum , in The lengths we have to go to

And God forbid you use tabs in a document with spaces instead of tabs (or vice versa)

radix ,
@radix@lemm.ee avatar

:retab is your friend!

Armand1 , in I'll just sort it myself

As annoying as this is, you are meant to use a comparer.


<span style="color:#323232;">mapped.sort((a, b) => {
</span><span style="color:#323232;">  if (a.value > b.value) {
</span><span style="color:#323232;">    return 1;
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">  if (a.value &lt; b.value) {
</span><span style="color:#323232;">    return -1;
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">  return 0;
</span><span style="color:#323232;">});
</span>
minikieff ,

<span style="color:#323232;">arr.sort((a, b) => a - b);
</span>
SpyingEnvy ,

One hundred percent how I do it everytime.

smik ,
@smik@discuss.tchncs.de avatar

Stuff like that exists to remind us of the Java in JavaScript

pinkdrunkenelephants , in The lengths we have to go to

And that is why I don’t bother with that garbage. C++ for life

gerryflap , in The lengths we have to go to
@gerryflap@feddit.nl avatar

People here are taking this way too seriously lol. I love Python, and I never really had any issues with the indentation being used instead of curly braces or something. This is just a silly meme, not a personal attack

alphacyberranger OP ,
@alphacyberranger@sh.itjust.works avatar

Precisely. It’s like programmers lost their humor.

some_guy ,

Had humor? /s

Asymptote ,

Humor is hard for autists.

(Disclaimer: am autist)

DarkenLM ,

I have not known happiness for 12 years now.

Anticorp ,

Right? Especially since there are plugins for VS Code that colorize the indents.

Asymptote ,

VSCode? Is that an Emacs extension? Or is it for vi?

DarkenLM ,

It's a bash script made to be run on MS-DOS on a breadboard computer.

Asymptote ,

bash

MS-DOS

r u a wizard

DarkenLM ,

I shall henceforth take the title of wizard.

MajorHavoc ,

Sadly neither, but it’s Vi plugin is nearly perfect.

Osnapitsjoey ,

Oooh whats a good one called?

Anticorp ,

I’m not at my computer right now, but I think the one I use is called indent-rainbow.

calzone_gigante ,

I really like the identation aproach, or begin/end instead of curly braces or parenthesis. When people start to nest things too deep, it gets painful to look at.

merc , (edited )

Then you never had to share a codebase with someone who had different ideas about how things should be indented.

gerryflap ,
@gerryflap@feddit.nl avatar

Hmmm nope. That sounds like hell indeed

bjoern_tantau , in What could possibly go wrong
@bjoern_tantau@swg-empire.de avatar

Well, how else would I add the Konami code for desktop and touchscreen devices?

sj_zero , in Zero to Hero in 1 hour

Unrelated, I love those stairs. They seem like a disaster waiting to happen but I love them.

lightnsfw ,

Break grandma’s hip in 10 easy steps!

KIM_JONG ,

My grandma is so hip, she uses kubernetes.

milkjug ,
@milkjug@lemmy.world avatar

Yo she alright but does she even know how to exit vim

KIM_JONG ,

Bitch, my g-ma :wq yo ass :1,$s/Twice on Sunday//g

PersnickityPenguin ,

Lol 1 easy step

TheBat ,
@TheBat@lemmy.world avatar

Your grandma sounds kinky ngl

my_blackest_day ,

Children injury in 5 easy steps! Available now!

LegionEris ,

Yeah, I am, without sarcasm, super agile and coordinated. I would love to have these steps. It would be fun for me every time. And I’d feel so safe at the top of my tricky stairs. Unfortunately my wife would never. She’d just be trapped downstairs.

sj_zero ,

"My wife" aka the lady you brought down before the drugs wore off who can never leave your basement.

:P

LegionEris ,

Psh. The drugs never wear off. She smokes weed all day every day.

ChickenLadyLovesLife ,

I run 6 miles every other day. A local rails-to-trails path near me is exactly 2.5 miles long, so I have to find some way of getting in an extra mile on my runs. The trail ends at a real railroad track, so for a while I tried running a half mile on the track and back, between the rails landing on every other tie as I ran since the distance perfectly matched my stride. This went on for a couple of years until one day I was doing it and actually started thinking “wow, this is pretty amazing that I can do this and not fall”. Not five seconds later I tripped and fell, landing both elbows and both knees on tie.

Somehow I was only bruised and didn’t break anything, and after ten minutes of groaning I was able to drag myself up and even complete my run. That was my last time running on railroad ties though.

LegionEris ,

Yeah, never take it for granted. You gotta do it on purpose with your feet every time. Learning to purposely activate intuitive motion is the goal. In a way, they’re extraordinarily zen stairs. You have to be right there on the stairs every time.

PersnickityPenguin ,

You should try the Oahu Diamond Head hike then. Its like a half mile of hiking up a funicular track.

GbyBE ,

Perfect stairs to your man cave 🙂

LegionEris ,

Except I’m not a man, and I don’t have a cave. I’m a woman, and I have a cage. But it has to be accessible to my wife so she can let me out eventually o_o So again, no agility stairs allowed.

GbyBE ,

Sorry, I somehow failed to notice the [she/her]. Didn’t mean to offend.

LegionEris ,

Oh you’re good. I actually put it in there after seeing your post. You and the Hexbears inspired me.

PersnickityPenguin ,

“Seem?”

As an architect this is honestly insane. First rule is to do no harm, but someone obviously is a psychopath, and thats the designer.

There is no way that thin metal can even structurally support a person.

GbyBE ,

Of course the metal can support a person. It’s not like one side is floating in thin air. The way this is constructed, both sides of each step are supported and the metal seems thick enough to support quite a bit of weight.

The only thing that bothers me is that forward/backward motion of the steps would put a lot of strain on the connection to the wall or floor. With normal use, that motion is quite limited though.

I’m quite confident the designer of those stairs used the right thickness for the material used, which you can’t judge from a picture.

discostjohn ,

My concern would be if someone slipped and got their leg wedged between two of the steps

GbyBE ,

I guess that would also be a legitimate concern, as the steps are rather short. It would look a bit less sleek with longer steps, but making the steps longer while keeping the supports narrow would still look good in my opinion.

r1veRRR , in Zero to Hero in 1 hour

Kubernetes is so easy! Unless you’re insane enough to have any state at all in your app. But who does that?

knobbysideup , in The lengths we have to go to

Programming languages that use white space to delimit structure are annoying at best. I get annoyed at yaml too, but I’m ok once I have a few templates set up.

corytheboyd ,
@corytheboyd@kbin.social avatar

YAML comes with its own unique pains in the ass https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

These things actually matter, come up often enough to actually be annoying, and are a bit difficult to explain and learn into people. You’re basically fine if you just string quote everything that you can, but nobody does that.

lemmylommy ,

That was interesting. And possibly the most Dutch name I have ever heard of.

Scribbd ,

Is Dutch name. Source: am Dutch.

mexicancartel ,

Use TABS guys TABS.

AntEater ,
@AntEater@discuss.tchncs.de avatar

Tabs suck. Use a real editor and spaces work fine.

PreachHard ,

Yeah who tf isn’t using tabs as spaces, it isn’t 2010

mexicancartel ,

Why tabs suck? Explain.

Tabs are neat.

Does you app have too many nested functions?

Use tab width = 2

Do your app have too less nested functions?

Use tab width = 8

Is your app having average number of nested fns?

Use tab width = 4(mostly default)

And all theese can happen without modifying a single byte in the source file, unlike spaces!

merc ,

Except that you have to either indent with only tabs or indent with only spaces. Any time you mix tabs and spaces you are just asking for disaster.

If you indent with only tabs you can’t align things except on tab boundaries. If you have a function that takes 10 parameters and want to do it on multiple lines, the alignment of the extra parameters is going to be ugly.

If you indent with only spaces, you can indent things so that all the parameters line up directly underneath the parenthesis, for example.

mexicancartel ,

I agree we shouldn’t mix tabs with spaces. But use tabs always. I could line up parameters together but may not be just under parentheris, and it looks good and readable for me

merc ,

I think it looks like ass, so only spaces for me.

seitanic , in I'll just sort it myself
@seitanic@lemmy.sdf.org avatar
StarkillerX42 , (edited )

“Actually, this one isn’t ‘Wat’, it’s part of what makes Ruby awesome and powerful, unless of course you actually do this, at which point it’s ‘Wat’”

Zeragamba ,
@Zeragamba@lemmy.ca avatar

let’s talk about Ruby

Ruby like most programming languages doesn’t support bare words, [undefined variable exception]

but if you define a particular method_missing, suddenly Ruby supports bare words. [ruby repeating what was typed]

Now this isn’t deserving of wat. this actually shows just how awesome Ruby is. [Drummer_t-rex.jpg]

But if you actually do this then…

Wat

fraction ,

Based on this you can Take Shit even further with jsfuck

zqwzzle ,
NegativeLookBehind , in Zero to Hero in 1 hour
@NegativeLookBehind@kbin.social avatar

Ok so just learn Kubernetes. And then realize that for it to be useful in a production environment, it needs like 10 other third party things, which you’ll also have to learn, and you’re done!

u_tamtam ,
@u_tamtam@programming.dev avatar

Rule of thumb for kubernetes, if you are learning it “for fun” or on your own, you are not gonna need it :)

alphacyberranger OP ,
@alphacyberranger@sh.itjust.works avatar

Thanks for saying that…I thought I was the only one who thought like that.

CanadaPlus ,

I just want to understand in detail what it is and how it works. Advice?

ramius345 ,
CanadaPlus ,

Thanks. So TL;DR it allows you to set up a little cloud computing service on your own physical machines, minus load balancing which you have to add on?

ramius345 ,

It can be used to scale cloud computing services as much as you want. It’s a scalable container runtime at its core. It provides a means for scaling an overlay network with service discovery and uniform ingress configuration.

u_tamtam ,
@u_tamtam@programming.dev avatar

I’ve found it best explained in some stackoverflow answer mentioning the pet vs cattle analogy. In short, if you know how many servers you have from the tip of your tongue, and what they do more or less, then they are akin to pets: you treat them well and keep an eye on each of them.
Kubernetes is meant for when you have so many of them, that come and go without you even noticing or caring, bearing a number for the sake of production/cost control, this is cattle. Needless to say that this is not your typical app/company running at such a scale, and that there is a 24/7 team of “ranchers” keeping an eye on the herd.

smik ,
@smik@discuss.tchncs.de avatar

10 is a bit exaggerating. What do you really need?

ExternalDNS is nice so you don’t have to config your DNS manually. You might need to install your own Ingress controller. If you want to automatically add and renew certificates cert-manager is great. Security is important! Speaking of, you should add some kind of secret management (something like sealed-secrets, vault or Secrets Store CSI Driver).

A really important thing is monitoring so you know your pods and the cluster itself is healthy. Prometheus is still king in that regard in my opinion. PromQL isn’t that hard. Of course some kind of alerting like AlertManager is a must for prod environments. Be aware that the front ends of those tools are not behind a login so something like oauth2-proxy and dex is vital! You might want to have some visualisation too so Grafana is a nice addition. If you add Loki too you got your OPs covered.

Keeping track of all of your stuff is the hard part so some GitOps is highly recommended. ArgoCD or FluxCD are popular for a reason!

I think that should cover the basic setup so you may scale your CRUD app without worries!

KIM_JONG ,

I think you covered at least 10 things.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines