...

bigtunacan

1997

Karma

2013-08-21

Created

Recent Activity

  • A delayed response doesn’t mean it’s not automated, just that it wasn’t built to not feel automated.

    I worked on an automated reply system like this previously and we had intentional delays with randomness as well as variance in our responses to make it “feel more human”.

  • Commented: "Ruby Blocks"

    Fixnum#times isn’t a great example, I only used it since the parent used it to illustrate their confusion and quite frankly a concrete useful example is to complex for this format.

    ActiveRecord has changed a lot over the years, but as an example in the original ActiveRecord you used dynamic finders. None of the finder methods existed initially, but if you passed a message to an active record object for a non existent method rather than fail it would determine if that should be a method and then it would build and persist a method to the process for future calls.

    It allows for some really interesting and powerful applications in horizontally scaling as well.

  • Commented: "Ruby Blocks"

    It’s not just about practicality. Ruby is using message passing, not method calling. This is fundamentally different and a bit foreign to the larger community. Then ruby layers syntactic sugar on top that hides this.

    Behind the scenes everything is a message passed using __send__ and you can do this directly as well, but you generally don’t.

    So when you write

    5.times { puts "Hello" }

    It’s sort of expected by the average programmer that you are telling 5 to call the times method and expect it to exist and do what it’s told.

    In reality you have indirectly sent a message that looks like

    5.__send__(:times) { puts "Hello" }

    What we are really doing is sending a message to 5 (the receiver) and giving it the opportunity to decide how to respond. This is where method_missing comes in to allow responding in a custom fashion regardless if a method was explicitly defined.

    So you’re not telling 5 to call the method times, rather you are asking, “Hey 5, do you know how to handle the message times?”

    These are fundamentally different things. This is actually super important and honestly hard to really grok _especially_ in ruby because of the syntactic sugar. I came from a C/C++ background originally, then Java and then moved to Ruby. After a few years I thought I understood this difference, but honestly it wasn’t until I spent a couple years using Objective-C where message passing is happening much more explicitly that I was able to truly understand the difference in a way that it became intuitive.

  • Commented: "Ruby Blocks"

    I think you’re right, but I also suspect that doesn’t clear up anything for most people as in my experience they generally don’t grok the difference unless they’ve already spent a significant amount of time in something like smalltalk or Objective-C

  • No, they would know exactly what they know now. Employers already report your earnings to both the federal and state IRS agencies and pay your withholdings automatically adjusted for your dependencies. So a simple form that says you made X and claimed Y dependencies. Click submit to confirm…

    That would be simple enough for most people (1 job, 1 home, maybe some kids) and it doesn’t require the government to know anything additional.

    In that most common scenario no tax accounting service should be needed. Honestly a 1040 isn’t that complicated in that scenario either, but is still too difficult for a good number of people and it’s just unnecessary.

HackerNews