r/ProgrammerHumor 3d ago

Interesting ...

Post image
41k Upvotes

4k

u/Skhmt 3d ago

I literally wrote an article on how to center a div. I google the article every time.

841

u/DoctorWaluigiTime 3d ago

It's honestly a good reason to write articles/blog posts that detail the steps you took in solving a problem.

So that when you inevitably run into the same problem, the work you did before will pay off again.

699

u/Healyhatman 3d ago

That's why when I ask a question on stack overflow, and I figure out the answer on my own, I always answer it and leave it there - even if the answer turned out to be I was stupid and forgot to do something simple.

335

u/infii123 3d ago

Thank you

564

u/MoffKalast 3d ago

Fuck you, closed as duplicate.

225

u/Milkshakes00 3d ago

Oh my fucking GOD does that infuriate me.

Yes, some jackwagon linked another SO Thread that had a single word in common with my entire post. THEY AREN'T FUCKING DUPLICATES.

119

u/cringetoken 3d ago

Yeah stackoverflow has some aggressively bad English-as-a-second-language moderators (the one I remember most clearly having multiple negative interactions with is from Belgium).

Like they have technical skills (usually) but just can't fucking be assed to actually read most questions before making decisions on removing them.

43

u/TonyThePuppyFromB 3d ago

So they have the same elitists moderating as tweakers.

5

u/Yawndr 3d ago

Closing questions doesn't require a moderator. They can shortcut the process, but normally if enough people say it's a duplicate, that's where it's closed, at least temporarily.

4

u/alma_perdida 3d ago

I wonder if stack overflow abs duolingo have any overlap in their moderators because they're both about equal in terms of being dickheads for no reason

→ More replies

17

u/rndmcmder 3d ago

It especially bugs me when i finally find a question that relates to a pretty unique problem i have and it has been closed with a reference to a totally different question.

→ More replies

6

u/Yawndr 3d ago

Ya, something that helps with that is that if, in your question, you mention something like "This and That questions are similar, but they differ in X, Y, Z", or why their solutions don't apply.

On too of keeping your question open, people (at least me) would see that as you actually put efforts on your pre-question research and will be more willing to help.

→ More replies
→ More replies

63

u/pizza_for_nunchucks 3d ago

Be better than DenverCoder9.

41

u/Jdublin777 3d ago

What did you see!?

13

u/CarefulCoderX 3d ago

Is there something this user frequently does?

53

u/atieivpbpnhofykri 3d ago

20

u/CarefulCoderX 3d ago

I actually did find DenverCoder9 on SO and they post quite a bit so I wasn't sure.

14

u/FriendlyManCub 3d ago

Was the user created before the XKCD of after? I'm wondering if someone took the name as a joke or they were actually referenced, as that would be pretty cool.

13

u/CarefulCoderX 3d ago

Definitely after from looking at their profile. Just noticed the link to the comic in their profile.

→ More replies

27

u/alexnedea 3d ago

I hate it when the answer is "i was stupid and i forgot to do something stupid". Well shit. I didnt do that and my stuff still doesn't work but we had the same problem :(

12

u/aaronjamt 3d ago

6 hours later

"Oh, that was stupid of me. That was such a stupid idea! Why did I do that?"

9

u/MaybeMayoi 3d ago

Top tier human here.

9

u/j33pwrangler 3d ago

Nevermind, I figured it out.

→ More replies

12

u/Dane1414 3d ago

Isn’t that what stack overflow is for, but with separate people documenting the problem and the solution?

31

u/DoctorWaluigiTime 3d ago

SO is great but it's not the same. In a blog post or article you can elaborate your whole process from start to finish, including avenues you took that didn't quite work out, etc. Much more free-form.

13

u/409industries 3d ago

This. In your own blog it usually sounds more natural when read and with keywords you recognize. I’ve done this and refer back all the time. Also, because I’m too lazy to get enough reputation to actually comment on StackOverflow

5

u/AegisToast 3d ago

Which can be great, but the other side of that is that you sometimes just need a quick answer and don’t want to wade through 6 sections of, “First, let’s explore what a div actually is, and where the concept of ‘center’ originated.”

4

u/DoctorWaluigiTime 3d ago

That's a failure of a blog post / article though. They shouldn't be "here are basic building blocks." And none of my "I ran into {problem}, here's how I solved it" posts I wrote back in the day did that.

That said, even if posts don't do that, they should contain a tl;dr at the top.

→ More replies
→ More replies
→ More replies
→ More replies

306

u/Extension_dev_2002 3d ago

Link?

598

u/Nyckname 3d ago

Google it.

188

u/Msprg 3d ago edited 3d ago

Yes! We're programmers! For us, the Google is the only link we need!

8

u/Nyckname 3d ago

What's funny is when I Google Google, because there's no direct way to their other services from the search page on my phone's browser.

8

u/pixelboots 3d ago

In high school, in IE6 or 7 days, we only had IE on the school computers and the default search engine was MSN.

I had a teacher who typed Google into MSN search. Every. Time.

→ More replies
→ More replies
→ More replies

44

u/De_Hbih 3d ago

DuckDuckGo here

14

u/f-ben 3d ago

Whats the term for ddg? 'just duck it' ?

→ More replies

3

u/Diavolo__ 3d ago

For everything else but work

→ More replies
→ More replies

10

u/PeaPanties 3d ago

Out saving Zelda. Again!

5

u/AlmostButNotQuit 3d ago

Well excuuuuuuuse me, princess!

→ More replies

3

u/unverified-account 3d ago

Not OP, but this is my go to. It's got the most common layout scenarios and practical examples.

https://css-tricks.com/snippets/css/a-guide-to-flexbox/

→ More replies
→ More replies

36

u/Throwaway-tan 3d ago

Thank fuck for flex box. Now just 3 CSS rules on the parent div.

24

u/BetaFan 3d ago

Display: flex; Justify-content: center; Align-items: center;

Soo ez

5

u/trystanr 3d ago

My life summed up into three lines

→ More replies
→ More replies

5

u/pants_full_of_pants 3d ago

Ironically, even though the flex method is conceptually way easier and more intuitive, I still always think of the old method first, where you set the parent relative, the inner div absolute, left 50% and margin-left negative half the width of the div. So convoluted but it's stuck in my brain. Meanwhile I have to Google the easier, better way.

→ More replies

4

u/CommitPhail 3d ago

CSS grid would be two lines display: grid; place-content: center;

10

u/Xadnem 2d ago

Weird flex but ok.

→ More replies

27

u/alnp1987 3d ago

Was searching for a fix for a very weird bug just to find the solution on an answer I posted myself a few years back

6

u/cheers_sons_crying 3d ago

Lmao that's some next level shit

→ More replies

9

u/OKRollForInitiative 3d ago

Flexbox right? God it's so easy. Please tell me flexbox.

Or grid if you want easy vertical centering too, I guess.

11

u/Urethra_is_Ourethra 3d ago

You can vertically center with flexbox too.

5

u/RdtUnahim 3d ago

Flexbox is love. Flexbox is life.

I slap any of my juniors I catch still doing the whole "float:left","clearfix" junk. xD

→ More replies
→ More replies

4

u/concorde77 3d ago

That sounds like notes with extra steps

3

u/DeusExMagikarpa 3d ago

I wrote an article for pretty printing json with js for the same reason.

→ More replies
→ More replies

892

u/mellifluousMemer 3d ago

No one can conquer the div.

254

u/DmMacniel 3d ago

What's it made of?

380

u/poopatroopa3 3d ago

Tears.

163

u/forlornself 3d ago

Broken dreams.

98

u/programmer2514 3d ago

I walk a lonely road

57

u/Firemorfox 3d ago

The only one

that I have ever known.

58

u/forlornself 3d ago

Check if my div aligns.

This'll never fly, and I Google search.

22

u/randomTWdude 3d ago

I Google search,

Stackoverflow

11

u/forlornself 3d ago

Stackoverflow stackoverflow

Oooh oooh

Stackoverflow stackover-

I've seen that question asked somewhere else here.

Learn to use stackoverflow you fucking moron.

→ More replies
→ More replies

31

u/killeronthecorner 3d ago

D and then I and then a bit of V and wrap it up with some angly boys

→ More replies

63

u/_HingleMcCringle 3d ago

You can't kill the div.

The div will live on.

Bootstrap tried to kill the div.

But they failed, as they were smite to the ground.

15

u/NeonXero 3d ago

Tenacious D needs a new programming album. Make it happen.

→ More replies
→ More replies

421

u/H25E 3d ago

Just move the rest of the page by the appropiate offset

91

u/My-Work-Reddit 3d ago

Why stop at the rest of the page? Why not think bigger?

38

u/Vsx 3d ago

This conversation really captures the feeling when the person you're talking to is in a powerful position and making suggestions that don't even make sense but you're stuck listening to him.

→ More replies
→ More replies

12

u/neomeow 3d ago

Sometimes, when I am feeling naughty, I just sneak a table in there. :-)

→ More replies

358

u/crazy_boy559 3d ago

This is the first time im seeing this meme format. I cant wait to see them re do other memed scenes.

152

u/Pradfanne 3d ago

The top part of the meme is pretty old, the future one, that's new. I thought Miranda had reenacted the meme just for the lulz, but she's got a damn pear computer so I'm not sure if it's legit from a nickelodeon show or not

38

u/SolidSync 3d ago

The bottom image is from the reboot as others have said, but I'd like to add that the image just came out yesterday. This is the freshest meme I've ever seen with my own eyes.

8

u/5panks 3d ago

That's because it's artificial. Sure it look like just picked tomatoes out of season, but it's been sprayed with red dye and frosted to crisp it.

153

u/coolbrandon101 3d ago

Yeah it’s from the reboot, of course it’s new

32

u/PitchforkAssistant 3d ago

There's a reboot? Of Drake & Josh or iCarly?

48

u/coolbrandon101 3d ago

I Carly

4

u/brandons404 2d ago edited 2d ago

Where can I watch it? I didn't know there was a reboot

I saw the trailer. Its paramount+ exclusive and honestly.. it doesn't look very promising :/

→ More replies

39

u/I_cut_my_own_jib 3d ago

Don't think a reboot of Drake and Josh is ever gunna happen. Josh is weird now and Drake has been going the Amada Bynes route lately.

26

u/JustiFyTheMeansGames 3d ago

Drake also just got in big trouble with the law

25

u/I_cut_my_own_jib 3d ago

Yeah he's jailed like 10 miles from my house LOL

→ More replies
→ More replies

21

u/acouplefruits 3d ago

It’s funny because I’m pretty sure the original is from Drake and Josh, not iCarly

19

u/Soccham 3d ago

As someone who watched both, its definitely from Drake & Josh

41

u/Paragade 3d ago

They just announced a new show like a few days ago

46

u/2Damn 3d ago

What im the fuck is Paramount+

29

u/Sigvard 3d ago

It used to be called CBS All Access. Still not sure why they went with Paramount since I haven’t thought of that brand in ages.

31

u/kielbasa330 3d ago

It's got prestige. CBS makes me think of old people shows -- paramount makes me think of Hollywood.

→ More replies
→ More replies

4

u/bankrobba 3d ago

$10 more a month

→ More replies
→ More replies

6

u/EERgasm 3d ago

That show's been announced for months

3

u/Paragade 3d ago

Well the trailer just came out recently at least

→ More replies
→ More replies

320

u/[deleted] 3d ago edited 3d ago

[deleted]

60

u/wackywavingarmgumby 3d ago

CSS: weird (looking) flex, but okay

→ More replies

271

u/Skhmt 3d ago

<center></center>

167

u/Tweenk 3d ago

The chaotic evil solution

40

u/cafk 3d ago

As someone who hasn't done anything relevant or larger with html for the past two decades - this is how i still do it, when i have to support someone's web app

110

u/crux77 3d ago

Please don't. Please for the love of god just learn flexbox. It's like 8 properties total with a only a few values each. We know you back end guys have it in you!

-Love, your friendly front end

63

u/Chrisazy 3d ago edited 3d ago

For anyone that genuinely wants to learn flexbox, here you go: https://flexboxfroggy.com/

15

u/CatsOP 3d ago

omg its a frog

9

u/Fenarir 3d ago

and once you've done that, theres this:
https://css-tricks.com/snippets/css/a-guide-to-flexbox/

(i literally google this site on a near daily basis lol)

→ More replies
→ More replies

14

u/AnswersWithCool 3d ago

I don’t know how I feel about my front end being so friendly. But to be fair I think that’s better than it being the back end.

8

u/AxePlayingViking 3d ago

Flexbox is so easy to get the hang of compared to non-deprecated older solutions. Definitely worth learning!

→ More replies
→ More replies

21

u/tenhourguy 3d ago

People be complaining about this, but pop view-source:https://www.google.com/ into your address bar, Ctrl+F for <center> and tell me what you see. I don't use it myself, but it's damn well tempting with how concise a way it is to centre something.

17

u/clb92 3d ago

They use it purely for legacy reasons, I bet. When someone tests the internet on any old device, the first thing they visit is likely google.com, so Google may as well spend like 16 bytes extra to make sure it still looks somewhat like google.com on very old devices as well.

21

u/tenhourguy 3d ago

They serve different versions to different browsers. Set your useragent to Internet Explorer 8 for a blast to the past!

→ More replies
→ More replies

5

u/Nodebunny 3d ago

this tag should literally just read my mind and work

3

u/acwilan 3d ago

<table><tr><td align=“center”>centered text</td></tr></table>

→ More replies

30

u/gandhi89 3d ago

Display: Flex; Place-Items: Center;

21

u/Topikk 3d ago

How have I never seen Place-Items before??

16

u/jb2386 3d ago

It’s not as widely supported as align-items and justify-item. Though all modern browsers do support it. The versions at which they support them are different. Depends what versions your minimum support is at.

12

u/Wolfeur 3d ago

Thanks to whoever were in charge of designing and implementing flex and grid into css

25

u/Atletismo343 3d ago

This was a game changer.

6

u/Topikk 3d ago

Now learn SASS mixins and you won’t have to repeat these three lines of code everywhere!

→ More replies
→ More replies

10

u/the_brits_are_evil 3d ago

I honestly had this problem a while ago and i dont understand why the vertical aligb doesnt just do that, why dpesnt it center at 50% height like text align?

10

u/budd222 3d ago

That only works inside table cells

18

u/kbruen 3d ago
<table class="t-center"><tr><td>...</td></tr></table>

Fucking done =)))

4

u/Cat__Wrangler 3d ago

Ah yes the email solution

3

u/MetroidSkittles 3d ago

Get the fuck out.

4

u/turinpt 3d ago edited 3d ago

Vertical align centers it in reference to the elements next to it.
So for example with a single div with vertical-align: middle nothing will happen, but if you place an element with height:100% next to it, the div will be vertically centered to that element.

Back in the IE days i'd just add an invisible ::before to the parent to vertically center stuff. Also the div needs to be inline or inline-block since vertical-align is intended for text.

3

u/the_brits_are_evil 3d ago

Ooh, ok so that's what it does, ty, still seems weird to me that there isn't a more straight forward way to do itt, but ty

25

u/kowdermesiter 3d ago

Minus points for not using JavaScript. This is not robust, not enterprise.

31

u/MetroidSkittles 3d ago

The amount of pointless fucking JavaScript on the Internet is too damn high.

11

u/SomeNewJawn 3d ago

My favorite problem with JS on websites is when my pihole blocks something from loading in, and due to some bad HTML, other JS on the page doesn't work correctly. Don't leave hanging tags that rely on loaded code to close them out!

→ More replies
→ More replies

8

u/DmMacniel 3d ago

Where is the Houdini in that!? Unshippable.

→ More replies
→ More replies

4

u/Ok_Physics_6846 3d ago

Pfft, the easy way out I see. No: display:block, left: 50%, top:50%, transform:translate(-50%,-50%), position: absolute.

→ More replies

150

u/BohdanOpyr 3d ago

There's a pretty elegant solution along with a couple more useful tricks at https://smolcss.dev

46

u/FoxcatMitsunee 3d ago

some of those examples make me feel really stupid. Looks like I gotta learn a bit more about flex yet... (and grid, I barely scratched the surface of that one)

29

u/lasiusflex 3d ago

Just play through Flex Froggy and maybe Grid Garden afterwards if you liked it.

Best way to learn those concepts.

→ More replies

31

u/MelSchlemming 3d ago

Flex is king, fuck grid.

Literally every single time I've used it I've thought "hey, this would be a great opportunity to finally use grid properly". And literally every single time it's had some shortcoming (usually to do with responsiveness) that's led me right back to flex (which always works just fine).

There's a Thanos meme in there somewhere.

8

u/flavioneto_ 3d ago

Yeah it's just more complicated. I always got to look somewhere, but there's some ways to do very cool automatically responsive stuff using grid and the min-max property with auto-fit or auto-fill. To place cards side by side for example, they'll just adjust automatically depending on the screen width, with no media queries

→ More replies

4

u/SubstituteCS 3d ago

There’s been a few cases where grid trumps flex (mostly alignment for 2d layouts since flex is for 1d layouts.)

9

u/crocrococ 3d ago

Thats pretty cool thanks for sharing

4

u/oalbrecht 3d ago

Quitting software engineering and taking up carpentry?

→ More replies

48

u/Ooze3d 3d ago

15 years ago: “margin: auto” plus some weird thing for vertical. Tables, maybe?

Now: The same Flex tutorial I’ve used the last 20 times because I can never remember the right combination.

22

u/nanotothemoon 3d ago

Omg. I know flexbox is functionally the best way but I really hate how they wrote the syntax. It could have been so user friendly, but the language is confusing af.

13

u/Ooze3d 3d ago

Was it so difficult to implement “vertical-align” and “horizontal-align”? Like 98% of all web pages are centred on the screen. Just add these two lines to the body and done.

5

u/Slak44 2d ago

“vertical-align” and “horizontal-align”

The vertical/horizontal terminology is explicitly avoided by flexbox, because the main axis and the cross axis don't necessarily map to what you'd expect (see flex-direction values).

The names actually make perfect sense: *-content props control main axis, and *-items cross axis. Similarly, justify-* for main, align-* for cross.

The flex properties can align horizontally or vertically, but just like vertical-align, they're not a silver bullet, they have to be used right, so this time the name tries to be less generic.

→ More replies
→ More replies

4

u/enddream 3d ago

I always have to tell myself the parent is usually where the code goes. Usually.

→ More replies

86

u/_dysthymia 3d ago

Is the second screenshot from the new iCarly?

69

u/PowerlinxJetfire 3d ago

55

u/wholligan 3d ago

Spencer looking exactly the same.

→ More replies

30

u/NetworkPenguin 3d ago

Are Sam and Freddy not in this? Looks like that black woman is the new costar.

Also

Paramount+

Looks like I'm sailing the high seas for this show because there's no way I'm paying for a 7th streaming service or whatever number my family's on now.

35

u/thenewbier 3d ago

Dude Freddie was in the trailer dancing, he is Nathan Kress.

→ More replies

28

u/lsaz 3d ago

"Sam" said he hated her time in the show and would never go back.

13

u/BubbaTee 3d ago

She was bulimic and the producers knew, and then they wrote her character as a binge eater.

And that's just the tip of the iceberg for the fucked up shit going on at Nickelodeon.

→ More replies

14

u/_dysthymia 3d ago

"Sam" isn't doing acting anymore. Not sure about Freddy.

22

u/PowerlinxJetfire 3d ago

Freddie (Nathan Kress) is in the video lol

→ More replies

3

u/Sirthisiswendys69 3d ago

I think paramount is free. Unless I’m thinking of a different one.

Jk, I was thinking of peacock

→ More replies

9

u/Office-Cat 3d ago

WHERE'S GIBBY?

33

u/The_sad_zebra 3d ago

I feel ashamed that I am actually looking forward to this.

31

u/Doug_Dimmadab 3d ago

I don’t, this looks fucking amazing

22

u/luckydayisascam 3d ago

They're actually gonna be smart and treat the characters like proper adults which is already a big plus! And Jerry hasn't fucking aged at all .

11

u/droppedmyravioli 3d ago

All the characters look grown up but spencer is the exact same lmao

→ More replies

70

u/j2r5h 3d ago

Don't be ashamed to enjoy things!

14

u/IBleddit 3d ago

How dare you tell me to reject my Catholic upbringing!!!

→ More replies
→ More replies
→ More replies

22

u/trodiix 3d ago

how to remove child from it's parent

7

u/wopian 3d ago

How to kill a child [process] without killing parent

16

u/ReallyNeededANewName 3d ago

<center>

HTML5? What's that?

3

u/the_real_gorrik 3d ago

We should petition to bring back center tag!

10

u/ReallyNeededANewName 3d ago

I mean, it still works...

→ More replies
→ More replies

15

u/GoldenStarsButter 3d ago

Look how many ports they used to give you on the IMac

→ More replies

10

u/ldmosel 3d ago

I know how to center a div, it just never works !important

10

u/iceynyo 3d ago

With web standards changing as fast as they do, there's always new techniques so it's good practice to search again now and then... and 15 years is basically forever.

25

u/dinnozo 3d ago

margin: 0 auto;

→ More replies

35

u/bnunamak 3d ago

margin-left: auto; margin-right: auto;

62

u/mr_marshian 3d ago

margin: 0 auto; gang

7

u/gelatenous-blobfish 3d ago

Margin: 0, auto; is all good and well until you need to add vertical margins at a different state. For some stupid reason. Why would anyone need to do that? Who knows, but still.

→ More replies

7

u/i_used_to_have_pants 3d ago

That’s 4 properties and the one above is only using 2.

5

u/kbruen 3d ago

The thing that sucks about this is that you can't add margins if the screen becomes too small since auto becomes 0.

3

u/RandyHoward 3d ago

Which is why you pad its container instead

8

u/kbruen 3d ago edited 3d ago

This makes sense but it makes me die inside.

The entire goal of CSS was for HTML to describe the content and for CSS to define how it looks. I therefore tend to organize my HTML is divs that make sense.

It hurts me to have nested divs in HTML just to work around CSS.

<div class="card">
    <p class="title">Title</p>
    <!-- card contents -->
</div>

In the example above, to center the card but also give it a margin, I would have to wrap it in a <div class="center"> sorta thing, which is just oof. It almost feels like going back to <b>, <i> and <font color="red" face="Comic Sans MS" size="2">.

7

u/RandyHoward 3d ago

But you're taking that out of the bigger context. Your card is always going to have some sort of container - if not then its container is the body element of the page and you can pad the body. I very rarely use divs at all when I'm coding HTML, this has rarely been a problem for me. It shouldn't be necessary to add a superfluous div here. 9 times out of 10 if I'm using cards I'm not using divs anyway, I'm doing something more like:

<ul class="cards">
    <li class="card">...</li>
</ul>

That setup automatically has a container, and doesn't use the div which has no semantic meaning. All depends on what you're doing of course.

→ More replies
→ More replies

5

u/KillerBeer01 3d ago

With the amount of "how to center div" requests those FBI agents see on a daily basis, one would almost think that some of them might actually be more actively helpful sometimes. I mean, they had to see some correct responses too.

19

u/Gonzo67824 3d ago

Who’s that actress by the way?

58

u/diesmilingxx 3d ago

Miranda Cosgrove

→ More replies

4

u/greencard_huseyin 3d ago

.div-to-center { display: flex; justify-content: center; align-items: center; }

Or use grid

.parent-div { display: grid; grid-template-columns: 15vw 70vw 15vw; }

.div-to-center { grid-column: 2; }

→ More replies

4

u/Forgotten_Pants 3d ago

This is me and SQL date math functions.

6

u/ThermionicEmissions 3d ago

Been a software dev for 22 years. Many different languages.

Dates can just go fuck themselves right in the ass.

→ More replies

14

u/De_Hbih 3d ago

Position: absolute; Top: 50%; Left: 50%; Transform: translate(-50%, -50%);

9

u/emsnei 3d ago

absolute madman

→ More replies

5

u/713984265 3d ago

The ancient texts.

Always had issue with this for larger items though because the width would shrink due to either the left: 50% or the translateX part of it.

→ More replies

3

u/Garaleth 3d ago

If I don't do it weekly. It's going from a technical reference memory to a paint drawing memory.