HN user

jz

248 karma
Posts3
Comments45
View on HN
Write Less Code 14 years ago

> When the number of "moving parts" created by your abstractions outnumbers the actual bits its abstracting, then you know your design took the wrong turn somewhere.

This is an interesting point which I agree with and is usually where I end up. In the past I've started from the opposite end, creating multiple modules, class hierarchies, etc. This future proofing has made things harder for me to follow/understand when reading at a later date. It has become tiresome and now I consciously start at the other end, making the simplest thing that could work. Layers of abstraction then come naturally as needed.

Write Less Code 14 years ago

Part of the zen of Python is "Flat is better than nested". Until recently, I always thought of this at a code block/function level. Recently I realized that this is also important when modularizing and adding layers of abstraction. The more layers of abstraction (from foo.bar.baz import Baz) you add, the more code you write and have to "keep in your mind". This presentation by Jack Diederich at PyCon 2012 really opened my eyes to the potential problems of adding layers of abstraction via modules and classes: http://pyvideo.org/video/880/stop-writing-classes

I needed this in a rake task under Rails 2 a while back; I ended up doing the following:

  require 'action_controller/integration'
  app = ActionController::Integration::Session.new

  module CurrentUserHack
    def current_user 
      @user ||= User.look_up_my_user_here
    end
  end
  ApplicationController.send :include, CurrentUserHack
Now you can make authenticated requests in rake tasks and presumably in script/runner.

> Money moving from one place to another does not always help the economy. When money flows from the corporate coffers directly into the private accounts of its executives, generally little of that money actually flows into the greater economy.

Can you give an example of how this would hurt the economy?

EDIT - those that down voted, mind giving a reason?

I agree that the change will cause a lot of pain, however early adopters tend to have a high tolerance for pain. If you don't want to deal with the pain or are running a server (your EC2 mention sounds like a server), you probably want to avoid cutting edge distros like Fedora.

Check out Mondrian: http://mondrian.pentaho.com/ I used it a couple years back at a startup. It's written in Java and IIRC works (only?) with MySQL. Mondrian took a bit of work to get setup, mostly due to my lack of OLAP knowledge at the time, but once setup, it was pretty nice and fast. I think it uses materialized views for the cube data. I'm actually working on a new project where an OLAP will be nice. Thanks for posting Brewery, I'll definitely give it a spin. OLAP's don't get much love, but are very useful for certain types of problems.

The girlfriend mentions seemed irrelevant and out of place. I've noticed lately that more and more technical bloggers try to inject this fictional writing style to draw in readers. Most of the time it's so out of place that I immediately stop reading. My preference though is terse articles for technical discussions.

I purchased my first CD set yesterday. They provide great tools (OpenSSH, tmux, and of course OpenBSD) which save me time and money and make my life easier.

Showoff 15 years ago

I work remotely 100% of the time (and not always in the same location). The use case for me is to quickly show a feature to coworkers without having to commit/push to a remote server. Especially if the feature needs immediate feedback and is not completely baked/finished.

A little late to the party, but I went through a bout with wrist/arm pain for over a year. I did physical therapy for more than 6 months, saw a doctor that said I needed to have surgery on my arms, neither helped (did not have surgery BTW). I then finally saw a myofascial specialist. She identified the cause of my pain from trigger points in my upper back and shoulders. After just one visit and a follow up visit a year later, I've been relatively pian free. She basically taught me how to address the trigger points my self using a tennis ball and 'The Trigger Point Therapy Workbook' http://www.amazon.com/Trigger-Point-Therapy-Workbook-Self-Tr...

I'd definitely give this book a try since it clearly identifies which trigger points are causing the referred pain/numbness along with the ways to treat them.

Also if you are in the Chicago area, check out http://www.myopain.com/. Like I said, they were able to help me with only 2 visits.

If you work for any employer that actually cares about you, convince them to keep you on their insurance and take a 6 month sabbatical. If they are not sympathetic to your situation, quit your job immediately since they have no regard for your well being. Try the bag and see how it goes. Make friends, travel, enjoy life. Do the things you always wanted to do. Then reassess in 6 months.

Looking at my own life the things that I feel blessed for, have nothing to do with work. After falling in love and starting a family, being rich and changing the world are no longer important. As long as I can provide for my family and raise my children in a way that would make me proud, nothing else matters.

Unplug and try the bag. There is much more to life than business success and $.

I thought the exact opposite. I'm in Chicago and the spill covers a 1/3 to 1/2 of Lake Michigan. After zooming out though, it clearly would cover Lake Erie or Lake Ontario. The thing that was put in perspective for me was the shear size of the Atlantic.

I've been programming exclusively in Ruby for almost 3 years now and came across this while I was looking at tempfile's source. I was gonna write about it but turns out this guy sums it up pretty good. I apologize since this is a news site and the post is from 2007, but it was news to me and I thought it was a very elegant hack.

I've switched to Chrome on my Mac because of its speed and quality of dev tools as well. It's a shame though since Firefox and Firebug were both revolutionary and "raised the bar".

3 years ago I bought my first Apple computer. Coming to the Apple platform, I was amazed by all the apps my fellow co-workers would buy for their Macs. Most of them were just simple stupid things that cost only a few bucks but I could never see an average non-Apple user buying. I have no statistical evidence, but it seems like Apple users are more susceptible to buying apps, ring tones, songs, and other junk. My advice would be build for the iPhone and if you get something that is very popular or making you a ton of money, then port it over.

I'm fed up with the snarkiness from Apple lovers and haters. I have several Apple products, MBP, iPhone, and Airport Base Station and I have never touted that they are superior or better than other offerings out there. I just silently go along and do my own thing and still attract tons of negative comments. There seems to be an inferiority complex in both Apple fanboys and Apple haters.

Now you can start to dive into any subject with some whimsical web browsing - an alternate to watching a TV show

Wow, I just had a discussion with my wife about giving up cable TV but keeping cable Internet for this reason. My argument was during the 1/2 hour of a silly sitcom, I can become knowledgeable with just about any subject of my choosing. And even if I want to veg out, I can still find most shows on the web.

Her counter argument was the cable box + remote are easier to use than hooking up a computer to the TV, which is what we currently do.