2,252 karma · joined December 20, 2007
We are currently looking to hire two people:
1. A full-time senior iOS developer, preferably ONSITE in San Francisco, but open to REMOTE.
2. A part-time community manager, starting at ~10 hours per week, with an opportunity to scale with the company. REMOTE friendly. Must love podcasts.
More information at https://www.breaker.audio/i/jobs.
Please send inquiries to jobs@breaker.audio
I wish I had been clearer in my talk but I only had 30 minutes and wanted to cover other topics. Here is a more comprehensive argument against symbols in Ruby:
In every instance where you use a literal symbol in your Ruby source code, you could you could replace it with the equivalent string (i.e. calling Symbol#to_s on it) without changing the semantics of your program. Symbols exist purely as a performance optimization. Specifically, the optimization is: instead of allocating new memory every time a literal string is used, lookup that symbol in a hash table, which can be done in constant time. There is also a memory savings from not having to re-allocate memory for existing symbols. As of Ruby 2.1.0, both of these benefits are redundant. You can get the same performance benefits by using frozen strings instead of symbols.
"string".freeze.object_id == "string".freeze.object_id
Since this is now true, symbols have become a vestigial type. Their main function is maintaining backward compatibility with existing code. Here is a short benchmark: def measure
t0 = Time.now
yield
t1 = Time.now
return t1 - t0
end
N = 1_000_000
puts measure { N.times { "string" } }
puts measure { N.times { "string".freeze } }
puts measure { N.times { :symbol } }
There are a few things to take away from this benchmark:1. Symbols and frozen strings offer identical performance, as I claim above.
2. Allocating a million strings takes about twice as long as allocating one string, putting it in into a hash table, and looking it up a million times.
3. You can allocate a million strings on your 2015 computer in about a tenth of a second.
If you’ve optimized your code to the point where string allocation is your bottleneck and you still need it to run faster, you probably shouldn’t be using Ruby.
With respect to memory consumption, at the time when Matz began working on Ruby, most laptops had 8 megabytes of memory. Today, I am typing this on a laptop with 8 gigabytes. Servers have terabytes. I’m not arguing that we shouldn’t be worried about memory consumption. I’m just pointing out that it is literally 1,000 times less important that it was when Ruby was designed.
Ruby was designed to be a high-level language, meaning that the programmer should be able to think about the program in human terms and not have to think about low-level computer concerns, like managing memory. This is why Ruby has a garbage collector. It trades off some memory efficiency and performance to make it easier for the programmer. New programmers don’t need to understand or perform memory management. They don’t need to know what memory is. They don’t even need to know that the garbage collector exists (let alone what it does or how it does it). This makes the language much easier to learn and allows programmers to be more productive, faster.
Symbols require the programmer to understand and think about memory all the time. This adds conceptual overhead, making the language harder to learn, and forcing programmers to make the following decision over and over again: Should I use a symbol or a string? The answer to this question is almost certainly inconsequential but, in the aggregate, it has consumed hours upon hours of my (and your) valuable time.
This has culminated in objects like Hashie, ActiveSupport’s HashWithIndifferentAccess, and extlib’s Mash, which exist to abstract away the difference between symbols and strings. If you search GitHub for "def stringify_keys" or "def symbolize_keys", you will find over 15,000 Ruby implementations (or copies) of these methods to convert back and forth between symbols and strings. Why? Because the vast majority of the time it doesn’t matter. Programmers just want to consistently use one or the other.
Beyond questions of language design, symbols aren’t merely a harmless, vestigial appendage to Ruby. They have been a denial of service attack vector (e.g. CVE-2014-0082), since they weren’t garbage collected until Ruby 2.2. Now that they are garbage collected, their behavior is even closer to a frozen string. So, tell me: Why do we need symbols, again?
I should mention, I’d be okay with :foo being syntactic sugar for a frozen string, as long as :foo == "foo" is true. This would go a long way toward making existing code backward compatible (of course, this would cause some other code to break, so—like everything—it’s a tradeoff).
I suspect Berlin would compare quite favorably, despite the relatively high German tax rate. I moved there 18 months ago and currently pay €500 ($565) for a one-bedroom apartment in a nice part of town (Prenzlauer Berg). In San Francisco, I paid 5X that for a studio apartment in Hayes Valley.
https://github.com/sferik/t/pull/142/files
https://github.com/sferik/t/pull/143/files
https://github.com/sferik/t/pull/144/files
Shameless.
If there was no financial incentive, I would probably merge it but now I'm questioning the motivations of the committer. If I merge this, it means there will be less money for someone else, who makes a more significant contribution in the future.
Personally, I prefer Gittip’s model to incentivize open-source contributions, if only because it doesn’t create this kind of noise for project maintainers.
Twitter is one of the few outlets where brands can effectively communicate their message online. That's the theory, anyway. You can argue that Twitter is a bad medium for branding but arguing that it's a bad medium for direct response advertising is missing the point.
There is another type of advertising called branding. Budweiser doesn’t spend $25 million per year advertising during the Super Bowl because they expect you to see the advertisement and immediately order a beer at the bar. Instead, Budweiser is trying to tell you a story about their brand to evoke an emotional response that will be stored deep in your amygdala such that every time you go to buy beer in the future you will reflexively choose Budweiser.
Google is better for direct response advertising; Twitter is better for branding.
PS: There is more money in brand advertising.
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> YAML
=> Psych
When I implemented this functionality, it was only to be compatible with the Rails parser.
Here's a link to this year's official WSOP rules: http://www.wsop.com/2012/2012-WSOP-Rules.pdf (see section 61 on Communication)
Here's the relevant part: "Participants not involved in a hand (cards in muck) shall be permitted to text/email at the table, but shall not be permitted to text/email any other Participant at the table."
Arguably, a public tweet could be interpreted as a text or email to another participant at the table, but the rules are not enforced that way and tweeting is a generally accepted practice by pros and amateurs alike.
I got some interesting replies but ended up going with "leaders" based on the logic that if someone follows you, you are their leader. Simple and easy to remember.
That said, I'm still open to other suggestions.
This error has been corrected in: https://github.com/sferik/merb-admin/commit/b5462f4b73d44447...
The thing that holds Kickstarter projects together is putting one's own credibility on the line. The people who pledge, understand that it would not be worth me publicly destroying my reputation for $2000. And since I haven't solicited pledges above $64, I would argue that I'm taking on a much greater risk than any individual contributor.
I view Kickstarter primarily as a tool for customer discovery, to gauge whether a project is worth my time. It has the added benefit of building momentum behind the project by creating a small army of people who are, quite literally, invested in it.
There are probably other names for this process, but I like to call it IDD: icon-driven development.