Hacker Newsnew | past | comments | ask | show | jobs | submit | pillbug88's commentslogin

It's to lessen the potential impact of a breach. a) you have a chance to recover from a hack in that two hours, b) it can reduce the speed with which leaked data gets to the opposition, and c) it reduces the likelihood of a hack getting valuable data.

And these are just a few reasons I can think of. There's nothing but benefits to this policy and very small negatives.

It's analogous to filling the moat before a battle. It's just a defense intended to slow an enemy. Try to remember that these guys are some seriously strategic thinkers, they're not morons and they're not technophobes.


Isn't this just the small string optimization with copy on write?


No - instead of allocating memory on the heap for the C character array aka "string", Ruby is the text itself directly in the RString object.

These short strings would actually NOT have COW optimization because they're structs and cloning one would clone its embedded string as well (as there are no pointers involved in < 24 byte strings).


isn't that the definition of the small string optimization?

This is how the dinkumware implementation of std::string has behaved for years. The basic form of the structure is a buffer and a pointer. If the pointer is filled in, it points to a heap string and follows cow semantics. Otherwise, the buffer is used, accomplishing the small string optimization.

I suppose I should have elaborated more. It just feels like the OP is "discovering" the wheel.


Absolutely. Keep in mind that the OP is coming from a Ruby background and TFA targets people more familiar with high-level interpreted languages than with C/C++.

BTW, I think though I cannot be sure that both the GCC and MSVC std::string implementations use this optimization in release mode, but I gotta dash and don't have time to verify this fact, so take it with a grain of salt, if you will.


It's funny cos before Obama was elected I told my friends that under this administration the internet would become regulated.

This is in stark contrast to the laissez-faire approach the Bush administration took towards the internet.

You can argue whatever else you want about him, but it is undeniable that more legislation regarding the internet has passed under the current administration than under Bush -- he even fought off the UN's (read: china/russia) attempt at taking over ICANN.


I have few kind words for Obama, but SOPA clearly transcends party lines. You're deluding yourself if you think things would have been any different under Bush.

The truth is, we don't know if Obama will sign SOPA. This bill is universally reviled among Obama's base (probably more than any other individual issue since the start of his presidency), and that same wave of enthusiasm that put him in office threatens to become a tempest of rage as anti-Obama as the tea party. We'll see.


I find the standard to be very clear and concise regarding lvalue/xvalue/prvalue [2011 3.10.1].

I wonder if teaching from the standard is a better way of approaching this, ie: start with the standard, then just explain what it means.


"vim has two main modes, normal mode ... and the insert mode"

i stopped reading here because i knew what was coming next. the omen was fulfilled by the next line:

"in insert mode, now you type text as your normally would. Pressing <Esc> exits back to normal mode."

its command mode vs insert mode. any vi user should know that.. it's the very first thing vi bludgeons you with.


:help command-mode goes to the same place as :help normal-mode. I'd rather call it normal mode, because that isn't easily confused with the command-line mode.


It also emphasizes that inserting text is rare. You will spend more time not inserting new text, but navigating the file.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: