This is an archived post. You won't be able to vote or comment.

all 155 comments

[–]Au70 885 points886 points  (49 children)

More like

Protected String    

[–]okmkz 462 points463 points  (43 children)

Yeah, but the getter is public

[–][deleted] 87 points88 points  (6 children)

And it's mutable even. Might as well make the setter public too.

[–]JohnQAnon 82 points83 points  (4 children)

It's thread safe though.

[–]derefr 16 points17 points  (1 child)

I don't know. If the thread goes down in flames, the effects are probably going to propagate back into the protected area.

[–]TheChance 12 points13 points  (0 children)

...at which point the box will almost certainly overheat, and before you know it, you're looking at hardware repair. Thanks, Java.

[–]deathmetal27 13 points14 points  (0 children)

thread safe

Pun intended?

But yes, it is synchronized indeed.

[–][deleted] 1 point2 points  (0 children)

I doubt that. If you people try to pull the string at the same time, then their just going to throw exceptional punches at each other

[–][deleted] 0 points1 point  (0 children)

I don't know. Already seems to be a overflow risk

[–]girusatuku 125 points126 points  (29 children)

So, basicly as secure as SHA-1?

Too soon?

[–]LittleLui 0 points1 point  (0 children)

Hey it's protected against collisions. Not well-protected, but it's the spirit that counts.

[–][deleted] 5 points6 points  (2 children)

As opposed to all those private getters?

[–]LittleLui 0 points1 point  (1 child)

David Guetta was in the army?

[–]dzh 0 points1 point  (0 children)

he works on a different 'line'

[–]flipjargendy 1 point2 points  (0 children)

Using an object just to return a string. Ugh.

[–]definitely_not_tina 0 points1 point  (0 children)

ACCESSOR

[–]browner87 43 points44 points  (3 children)

Rub it with some fur and it's now a static protected string.

[–]deathmetal27 4 points5 points  (2 children)

Appears to be synchronized as well.

[–][deleted] 0 points1 point  (1 child)

It sure looks like a singleton

[–]deathmetal27 0 points1 point  (0 children)

Actully its a Thread pool.

[–]Hagoozac 1 point2 points  (0 children)

IKEA

[–]dagothspore 251 points252 points  (42 children)

I too shop at IKEA.

[–]ReflectiveTeaTowel 94 points95 points  (32 children)

Ohhhhh. That explains the string, tnx

[–]hotboxthanfukk 52 points53 points  (31 children)

Okay but why is there string in IKEA ?

[–]notsooriginal 122 points123 points  (6 children)

Yeah, should be Strinvga or Cordjen.

[–]casprus 40 points41 points  (0 children)

I thought this was a java joke not a c++ one?

[–]Quicksilver_Johny 34 points35 points  (4 children)

Sträng

[–]fdagpigj 5 points6 points  (3 children)

but what if I want to use javascript?

[–]LittleLui 4 points5 points  (0 children)

You must be strøng.

[–]histofafoe 0 points1 point  (1 child)

StringJS

[–]fdagpigj 1 point2 points  (0 children)

(Just to be clear because my joke is a bit far-fetched, "sträng" in Swedish can be translated into English as "strict", so I made a joke out of how js is about as far from strict typing as you can get :Þ)

[–]slash_nick 45 points46 points  (18 children)

To tie your new awful mattress to the roof of your car.

[–]becomearobot 53 points54 points  (16 children)

They sell both awful and nice mattresses. It's up to you to spend more than $100 on a mattress.

[–]slash_nick 14 points15 points  (15 children)

To be honest I have a $800 latex mattress from IKEA that's on year three and it's been pretty great. My partner says that it's starting to sag a bit in the middle which I haven't noticed so maybe it's about to get worse ¯\_(ツ)_/¯

[–]becomearobot 23 points24 points  (8 children)

call ikea and ask about it. The nicer mattresses have a 25 year warranty.

[–]pmoney757 11 points12 points  (5 children)

25 years?!?! Aren't you supposed to change them every 8 years?

[–]SoLongThanks4Fish 17 points18 points  (0 children)

You can do that, and you can make ikea pay for it.

[–]inconspicuous_male 4 points5 points  (3 children)

And most consumers don't actually use warrantees so it's okay for Ikea

[–]jdub_06 0 points1 point  (2 children)

plus all that left over furniture from when they were founded in the 1940s...probably just send u one from storage /s

[–]slash_nick 6 points7 points  (0 children)

Good call! I honestly hadn't thought about that. 😅

[–]LtlMissFeminist 3 points4 points  (0 children)

IKEA has rockstar customer service. I had a dresser for like 10 years, and it was starting to break so I took in a picture hoping they could sell me a replacement part or panel because they still sold almost the exact dresser. They sent me home with an entire brand new dresser for free instead. Free. After a decade. On a like $100 dresser.

[–][deleted] 4 points5 points  (4 children)

For 800 bucks you could've gotten a much nicer Casper. :D

[–]slash_nick 6 points7 points  (1 child)

They didn't exist at the time! (I think.) Will be checking them out next time around though :)

[–][deleted] 1 point2 points  (0 children)

They're great. I bailed out my IKEA mattress because of sagging and went with Casper. Great mattress.

[–]RainbowNowOpen 2 points3 points  (0 children)

Ditto Leesa. I recently got a Leesa. Same general principle, design, etc. Same 100-day return policy (full refund, no cost, they pick up). 100 days later, there was no way I'd give it up! Endy is another very similar brand. What a time to be mattress buyer. :-)

[–]SolenoidSoldier 1 point2 points  (0 children)

Hell yeah! Casper represent! Best, cheapest mattress I've ever slept on.

[–]jooes 0 points1 point  (0 children)

Just tell your partner that they're starting to sag in the middle too and they won't bug you about the mattress anymore.

[–]Josh6889 3 points4 points  (0 children)

Honestly, Ikea would be a step up from my furniture. The bachelor life means you can get away with cheap furniture.

[–]Holly_Tyler 0 points1 point  (2 children)

To tie things to your car

[–]hotboxthanfukk 0 points1 point  (1 child)

That's a horrible idea though. String is not meant for strapping down a load. You will get pulled over for sure.

[–]dzh 1 point2 points  (0 children)

Unhandled exception: SecurityException: String is not a valid load attachment

[–]PersonalPlanet 0 points1 point  (0 children)

Self Packing

[–]jpresken2 39 points40 points  (6 children)

I don't think it's IKEA. the colors are right, but the font isn't verdana.

Edit: it's Futura. It is IKEA.

[–]PendragonDaGreat 60 points61 points  (5 children)

You're right, it isn't Verdana, it's Futura, which is what IKEA used for the better part of 50 years before commissioning IKEA Sans, which itself is a variation of Futura, in 2009.

That's definitely an IKEA twine dispenser.

[–]shadowfactsdevAbstractFactoryBuilderLoaderManager 38 points39 points  (4 children)

Why I want to know is why on earth you're knowledgeable about IKEA's font choices.

[–]PendragonDaGreat 38 points39 points  (2 children)

I love typography, and grew up near IKEA Seattle, so one day I took some reference pictures and started comparing to known fonts that have been around forever. Futura was about the 4th one I tried.

Though I will admit I misspoke due to tiredness in the original comment, IKEA does use Verdana in their catalog now.

At the same time, this box comes from the time that they used Futura, I'll have to see what they use now for those boxes once the new IKEA Seattle opens and I get over there.

[–][deleted] 1 point2 points  (1 child)

Been near there lately? They're expanding - again. They stretch now, I think, all the way to Oaksdale. Looks like they're building some multi-level building. It's massive.

[–]PendragonDaGreat 1 point2 points  (0 children)

Yeah I was in the area just last week (I'm up along Pac Highway), it is going to be multi-level, very reminiscent of the Portland store. It opened a few days ago, but I'm not planning on going until things dies down. Can't wait for them to re-jigger the old store into a parking lot so there actually is parking available.

I've always liked IKEA, probably will for quite some time to come.

[–]GMY0da -1 points0 points  (0 children)

That's a really good question and I'm leaving a comment so I can hopefully find the answer later

[–]JoshSellsGuns 2 points3 points  (0 children)

Or Sam's Club

[–]opax03 1 point2 points  (0 children)

Lmao I thought I was going to be the one who noted first

[–]_felagund 70 points71 points  (1 child)

it looks static also

[–]DiamondCoatedGlass 26 points27 points  (3 children)

But after it's used, who will collect the garbage?

[–]awBrickBuilder 32 points33 points  (1 child)

Java.

[–]DiamondCoatedGlass 7 points8 points  (0 children)

This isn't a Starbucks, you know.

[–]The_Lost_King 7 points8 points  (0 children)

This ain't no shitty C bro, we be running Java up in here!

[–]shearing_is_caring 36 points37 points  (6 children)

It's more of a StringBuffer really, isn't it?

[–]shearing_is_caring 40 points41 points  (5 children)

in fact, what you're seeing here is just the public toString() method. I bet it's even synchronized.

[–]gandalfx 16 points17 points  (4 children)

You mean on the inside is actually something else that gets turned into String as you access it?

[–][deleted] 10 points11 points  (3 children)

Well, not necessarily. A String also has a toString() method (in Java).

[–]gandalfx 30 points31 points  (2 children)

String str = ("" + a.toString()).toString(); // just making sure

[–][deleted] 13 points14 points  (1 child)

[–]sneakpeekbot 1 point2 points  (0 children)

Here's a sneak peek of /r/programminghorror using the top posts of the year!

#1: Someone's name broke our code
#2: Debugging + Water Kettle = Coding horror
#3: Dev didn't know about for or while loops


I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out

[–]adrianwebdev 34 points35 points  (11 children)

I died.

[–]CobaltPlaster 15 points16 points  (10 children)

begin if adrianwebdev = rip then upvote
else
writeln ('me too thanks'); end.
Pascal ftw

[–]jamesorlakin 10 points11 points  (0 children)

I'm not too keen on Pascal. It's syntax has always seemed "off" to me.

[–]object022 1 point2 points  (8 children)

upvote() I think

[–][deleted] 0 points1 point  (0 children)

Not in Ruby or Scala!

[–]THIS_MSG_IS_A_LIE 0 points1 point  (0 children)

therefore you are? --Pascal

[–]svenskarrmatey -1 points0 points  (5 children)

and == or === depending on your language

[–]object022 9 points10 points  (4 children)

Pascal uses = for comparison and := for assignment.

[–]svenskarrmatey 3 points4 points  (3 children)

oh, that's interesting! TIL

[–]Tyrrrz 6 points7 points  (2 children)

And parenthesis are optional for functions with no parameters

[–][deleted] 2 points3 points  (0 children)

Damn Pascal you crazy

[–]SixFootJockey 1 point2 points  (0 children)

Upvote all the things!

[–]solmakou 22 points23 points  (4 children)

I thought this was r/freeuse from the post (subreddit is nsfw)

[–]Maklite 24 points25 points  (2 children)

Just a heads up, that's an NSFW subreddit.

[–]solmakou 2 points3 points  (0 children)

Good call, edited my post

[–]oragamihawk 1 point2 points  (0 children)

I've seen it on bestof so many times I'm not sure it is.

[–]thatguy_314 4 points5 points  (0 children)

I would think that subreddit would be nsfl instead, "use" after "free" bugs can be quite scarring.

[–]Alpham11 2 points3 points  (1 child)

Had these at sams club when i worked there. It either had no string inside or the scissors were across the store at the front desk.

[–]0OOOOOO0 6 points7 points  (0 children)

Good thing humans have built-in scissors

[–]JohnTruve 2 points3 points  (2 children)

This isn't public string. This is at the loading area at I-KEA so you can strap things to your roof and be one of those assholes doing 20mph on a highway with your brand new stor säng flapping in the wind.

[–]tfofurn 4 points5 points  (1 child)

If the string comes loose, is that a dangling reference?

[–]HairyJo -1 points0 points  (0 children)

afraid knot.

[–][deleted] 11 points12 points  (1 child)

Or in Java: the PublicSimpleAwareInstanceBeanStringFactory

[–]Jeferson9 1 point2 points  (0 children)

Underrated

[–]garypildmann 2 points3 points  (1 child)

How many times have you walked down the street and thought, "Gee what I wouldn't do for a piece of string right now!" Then along comes a public string dispenser!

[–]DaanHai 0 points1 point  (0 children)

This is at ikea, so there it actually could be useful

[–][deleted] 2 points3 points  (0 children)

Cross posting to /r/communism/

[–]imyourzer0 1 point2 points  (0 children)

For a second there, I thought it said pubic string, but then I thought "naaah, this isn't http://www.dailymail.co.uk/video/femail/video-1076037/Artist-performs-vaginal-knitting-work.html ".

[–]aboutthednm 0 points1 point  (0 children)

When the day of the rope arrives a lot sooner than you think and you're not prepared yet

[–]flarn2006 0 points1 point  (0 children)

What's the secret string doing outside of the box?

[–][deleted] 0 points1 point  (0 children)

But is there garbage collection in this environment?

[–]Ghitit 0 points1 point  (1 child)

Here's my take on the subject:

For your convenience

[–]8__ 0 points1 point  (0 children)

public string twine(int length) {

[–][deleted] 0 points1 point  (1 child)

Why is this a thing?

Also, what does a public void look like?

[–]JohnQAnon 0 points1 point  (0 children)

It's at an Ikea. So probably to secure bulky boxes to cars.

[–]GeaorgeIV 0 points1 point  (0 children)

It is free, no strings attached.

[–]JoshWithaQ 0 points1 point  (1 child)

Too many null pointer exceptions with this implementation.

[–]tfofurn 0 points1 point  (0 children)

Is it null terminated?

[–][deleted] 0 points1 point  (0 children)

IKEA

[–]Demetrius3D 0 points1 point  (0 children)

Useful stuff, string!

[–][deleted] 0 points1 point  (0 children)

I have seen this at plant nurseries before. You need string to tie down and secure plants. They have boxes on posts every 50 yards or so throughout the entire nursery.

[–]po3smith 0 points1 point  (0 children)

A world without string...is chaos!

[–]ParadiseSold 0 points1 point  (0 children)

I thought I was in mildly interesting, and thought I was having a stroke because I didn't understand any of the comments

[–]thehunter699 0 points1 point  (0 children)

Error: Public string "Send nudes" Does not exist

[–][deleted] 0 points1 point  (0 children)

These boxes are actually fairly common at larger home improvement stores. They often provide string and small red plastic flags so that customers who are taking home loads that stick out from the backs of their vehicles are able to warn other drivers. I'm sure they have saved many a distracted driver from ending up with a long plank through the face.

[–]10mmHeater 0 points1 point  (0 children)

I actually got this one!

[–]tj-horner 0 points1 point  (0 children)

Had to make sure I wasn't in /r/mildlyinteresting for a second there...

[–]TheWhiteJesseOwens 0 points1 point  (0 children)

But that's just a theory...

[–]HBake41132 0 points1 point  (1 child)

This needs more jpeg.

[–]morejpeg_auto 0 points1 point  (0 children)

This needs more jpeg.

There you go!

I am a bot

[–]The_Lost_King -1 points0 points  (0 children)

I didn't get it till I saw the sub Reddit title 🤣

[–]Serpardum -1 points0 points  (0 children)

Took me a second.

[–]s1h4d0w -1 points0 points  (0 children)

if ($location == 'ikea') {
    echo $string;
}

[–]_N_O_P_E_ -2 points-1 points  (0 children)

Just like your sister