HNHacker News
TopNewBestAskShowJobs

lusr

1,147 karma · joined July 14, 2011

http://www.flickr.com/lusr
submissionscomments
lusr··on United States Sentencing Commission website hacked
Given the small time window for an attack to be viable I have to wonder why a more concise and succinct message wasn't used. It does make me wonder if the bark is bigger than the bite.
lusr··on The Senate will move next week on comprehensive high-skill immigration reform
The article title claims "comprehensive high-skill immigration reform".

As a highly-skilled South African (which, interestingly enough, appears to be where parent ultimately decided to emigrate), the effort, duration and uncertainty involved in acquiring US citizenship makes it a non-starter option for me.

I'm better off remaining in South Africa where I don't have to work non-stop for years and years unless I want to risk being deported, don't have to play a different game in the job market, can stop working at any time to go full speed on my startup, etc.

Eventually I hope to be successful enough that emigration through business and wealth is a simpler and more direct option. Of course by then I may very well have a family and other commitments that again make emigration a non-option.

Assuming I'm the sort of person this reform is meant to entice into the USA (a country I very much admire), it certainly isn't comprehensive, which appears to be parent's point.

lusr··on Actual Facebook Graph Searches
What is your opinion on the following scenario:

An "Islamic gay man living in Tehran" in 1997 creates a web page and populates it with exactly the same personal information you are describing. Sometime later Google comes of age and indexes his site for the world to easily discover.

Do you feel that Google and Facebook are acting differently in this scenario, and if so, why?

lusr··on An Interview Question that Actually Works
Assuming I understand it correctly, the paradoxical thing about this article is that it seems to imply the engineers currently working there would have failed this interview question.
lusr··on So you think you can tell Arial from Helvetica?
In the ones where you don't have the flat edges to work from, I found Helvectica is the "bolder" one.
lusr··on Airbnb CEO: Designers Deserve Respect Like Engineers
Is this agency you refer to a marketing or design agency?

If so, this data point is most likely somewhat deceptive. The core competency of a marketing or design agency is creative work, and naturally you want exceptional talent in that respect. Such an agency is generally going to be building straightforward websites that don't require particularly skillful software engineering. (And even if they did, it'd be an option to contract out, whereas contracting creativity out is not - as far as I know - a real option.)

If you look at the salary of an equivalent "Head of Development" and "Head of User Experience/Design" at e.g. Microsoft I suspect you'll see the opposite salary situation because of the relative focus of the organisation (although Microsoft is putting a lot of emphasis on design these days so who knows?).

lusr··on Your ATM does not use transactions
I currently work on a client accounting system at a large bank, and have worked at another large bank previously.

While what you described may happen somewhere, the pattern in banking systems that I've seen is pretty straightforward and simple to reason about: a cash flow produces two ledger entries within a transaction and is committed with no concept of distributed rollback.

If there are problems with some sort of subsequent step (e.g. the actual dispensing of cash in ATM or invalid routing instructions in a cross-border payment), the original cash flow is reversed with a reversal of the original two ledger entries -- which is precisely what Ayende saw on his statement.

If a correction is also required in addition to the reversal (perhaps SOME of money was dispensed before an ATM loses power), the correction will be encapsulated with another pair of ledger entries.

(These various cash flows will then typically be placed on a payment bus for further processing by various other systems that perform recon, liquidity management, etc. Again, there is no distributed transaction, just simple double-entry accounting and straightforward transactional message queues.)

lusr··on Dependency Injection is a Virtue
If you're building a simple system then it probably won't matter what you do. My opinion is it's good practice to follow sound architectural principles and just because your language lets you get away with crazy stuff doesn't necessarily mean it's the best choice. I listed a number of features of the approach I took - I'm not sure why I'd want to give all that up just to save a few lines of code.
lusr··on Dependency Injection is a Virtue
Your "function returning a function" is a closure, and yup the class's instance variables act much like a (mutable) closure here.

The clever bit is that the consumer (e.g. a web callback or UI event handler) of IArticleService is not the constructor of ArticleService. The consumer simply receives a reference to an IArticleService and uses it, while the constructor of the service knows how to wire things up and hand out service references to consumers that need it so that the consumers don't need to know how to do the wiring up; this is precisely what a dependency injection engine does.

It's the difference between you walking to a Post Office and saying "mail(this envelope)" and you saying "mail(this envelope, put it into truck x, route it via [A, B, C, D], find it in the corner of truck D weeks later and route it through E, give it to Alice to give to Bob to place it in the customer's post office box)". Somebody constructed the Post Office with all these rules encapsulated and you just consume the service.

It's the reason society can scale despite nobody knowing how everything works exactly, and the same principles apply to creating maintainable code that scales among many developers of varying degrees of skill.

lusr··on Dependency Injection is a Virtue
Finally, somebody talking sense. You define a class to encapsulate rules (data, permissions) specific to a class of problems in your domain so that you don't have to repeat those rules elsewhere, which has all sorts of problems (the worst of which become impossible to address in some scenarios, e.g. where one executes potentially malicious code).

If you're passing in DateTime.Now to your Publish method then the caller (probably a UI element or a web callback) is implementing business logic that does not belong to it, which violates the single responsibility principle and will eventually cause your code to become unmaintainable.

Part of the problem with these posts is the authors seldom have experience building software in some of the more tricky real-world software development environments. While DHH is rightfully respected for many things, I can find nothing in his history [1] to suggest he has the relevant experience to criticise "enterprise development": as far as I can see, he's never had to work on a millions-of-lines code base with 3+ years of cruft written and maintained by large disparate teams of mediocre developers using poorly chosen technologies to solve problems within time, quality and scope constraints outside his control.

In these sorts of environments, saying "start over" or "choose better" is not an option and things like DI and well designed interfaces make it possible for a small team of architects to ensure the mediocre developers actually accomplish something and software gets released.

I'll repost what I posted yesterday on the other post:

    interface IArticleService {
       void Publish(int id);
    }
    
    class ArticleService : IArticleService {
       protected IArticleRepository ArticleRepository;
       protected ITimeService TimeService;
    
       public ArticleService(IArticleRepository articleRepository, ITimeService timeService) {
           ArticleRepository = articleRepository;
           TimeService = timeService;
       }

       public void Publish(int id) {
           ArticleRepository.Publish(id, TimeService.Now);
       }
    }
Some features of this design pattern:

- the consumer of the service doesn't need to know anything about the publish time: e.g. whether it's UTC or local time, whether it needs to have +1 second added to deal with a bug in some legacy interface, or perhaps a switch to database time, etc. The problem of "publish time" is strictly limited to the ArticleService, which is an expert on the matter of publish times.

- any new business rules regarding publish times or Publish-related activities are strictly limited to this service and none of the consumers have to be modified when the rules change

- the ArticleService is easily testable by swapping in one or more testing ITimeService implementations (e.g. one that returns a fixed test date time, one that returns bad times, etc.)

- your software has a consistent, single view of time (which is critical in a time dependent application, for example)

[1] http://en.wikipedia.org/wiki/David_Heinemeier_Hansson

lusr··on Wisdom from Psychopaths?
> I often say if 51% of the population were psycopaths then they would not be psycopaths but normals and the other 49% would be the exceptions and outcasts in many ways.

There's good reason to believe that such a world would be unstable. When too many people are willing to take advantage of too many other people then you will most likely have a tragedy of the commons [1]. Co-operation and altruism appear to be very important components for the evolution of species and the advance of civilization.

> After all not all psycopaths are criminals

This is true, and as with most things in life what's important is balance. As the article discusses, psychopaths tend to live "in the now" and have a very present-oriented time perspective, which certainly has some value. But too much of a particular time perspective, in this case with no past- and future-oriented time perspectives, creates a distorted map of reality [2].

[1] http://en.wikipedia.org/wiki/Tragedy_of_the_commons#Applicat...

[2] http://www.thetimeparadox.com/

lusr··on Dependency injection is not a virtue
Design Patterns: 1994 [1]

Java: 1995 [2]

Scala: 2003 [3]

Clojure: 2007 [4]

Unless these hypothetical developers of yours are time travellers, your proposed solution wasn't an option for more than half of Java's life. Sometimes Java is 90% of what you need and you just get on with the other 10% because the alternative (learning a new language, finding a new team or training an existing team to use it correctly, etc.) is simply not worth it to anybody with real world time/quality/scope constraints.

[1] http://en.wikipedia.org/wiki/Design_Patterns

[2] http://en.wikipedia.org/wiki/Java_(programming_language)

[3] http://en.wikipedia.org/wiki/Scala_(programming_language)

[4] http://en.wikipedia.org/wiki/Clojure

lusr··on Dependency injection is not a virtue
Ah cool, I was foozy... Hit me up with an email by picking any word at my username .org :)
lusr··on Dependency injection is not a virtue
This may be completely left field, but are you the same Peaker from #programmers on DALnet years ago?
lusr··on Dependency injection is not a virtue
> Using DI is just a glorified way to have "globals".

How so?

> Wanna unit test? Pass in a modified function giving back the time you want.

Right. And all DI does is make it possible for the following constructor to be invoked without special knowledge or adverse coupling:

    interface IArticleService {
       void Publish();
    }
    
    class ArticleService : IArticleService {
       protected IArticleRepository ArticleRepository;
       protected ITimeService TimeService;
    
       public ArticleService(IArticleRepository articleRepository, ITimeService timeService) {
           ArticleRepository = articleRepository;
           TimeService = timeService;
       }

       public void Publish(int id) {
           ArticleRepository.Publish(id, TimeService.Now);
       }
}
lusr··on [dead]
For me the spinning wobbles on Chrome 23.0.1271.97 and doesn't work at all on IE9 despite the site banner claiming IE7 support?
lusr··on Why I Quit Being So Accommodating (1922)
This simply cannot be possible. Perhaps you've been fortunate enough not to encounter the sort of people the article is referring to, and consequently aren't familiar with the drain these people are.

Some examples from my own life, a more modern context:

- acquaintances ask me to "fix their Internet" because I'm "good with computers": I point out I have other priorities and they're already paying the line provider/ISP so should call them for assistance

- similarly, people who ask me to fix their computers: I point out that they wouldn't expect a mechanic to fix their car for free, and besides IT != software development

- back in university when people asked me to help develop or debug portions of their solutions: if I couldn't figure it out in 15 minutes I told them I had other priorities but gave them general advice about what the problem or solution might be

- people asking me to work longer for the same amount of pay and unpredictable benefits (i.e. bonus formulas): I became a contractor instead and I've been immeasurably happier for it

You simply cannot consent to every request from such people - they will literally drain your life (i.e. time) from you, to what end?

lusr··on A $5 Lamp Powered Solely by Gravity
Why are you limiting your scenario to only one of these lights?
lusr··on When I first heard the name "Safari"
I was born in South Africa and have spent half my life in its neighbour, Namibia. Both countries are well known for diverse wildlife and vast unspoiled natural habitats.

"Safari", to me, is a word foreigners use unnecessarily and some locals chuckle at when they hear it. Locals simply say "We're going to Blahblah National Park for Christmas." It's also the name for a brand of dried fruits and nuts, which makes it even weirder to hear it in conversation here.

I honestly didn't grasp the relevance of the name to the Internet until you explained it now, despite programming for over 15 years and living in Africa for over 29 years.

lusr··on Why we still love board games
My girlfriend and I saw Monopoly in the store the other day. We both thought it'd be awesome to play because as kids none of the adults around ever wanted to play with us. After about 2 hours of going around the board waiting for one of us to hit the tie-breaker property first we understood why.
lusr··on Police concerned with Apple iOS 6 mapping system
The thing I really don't understand is this seems like such a simple thing to test! Search for X in our data set vs. competitor data set: flag for review if we are not within 1km radius. Don't release until the number and scope of flags hasn't been reduced to an acceptable margin of error (don't even have to test the full data set, just need a good enough statistician to help you figure out how bad your overall data is based on your sample tested data).
lusr··on Dune II ported to the Web with Emscripten
Ah, I miss those long windy trails of concrete and rocket turrets built right at their base :)

Also the first game I learned to 'hack', and it's what set me on the path to learning programming: I discovered a hex file editor on a floppy and had a hunch about how things might fit together.

So I saved a game, waited a second until some money was spent in the game and then saved again into a different slot. Thereafter I went through the two save game files, visually figured out which parts were different between the files, changed the magical numbers I saw, reloaded the game and slowly figured out how to make myself rich :)

(This worked much better than my earlier attempt with the disk editor I found where I thought I was really clever compressing files by changing their size to 0.)

lusr··on Not Wanting Kids Is Entirely Normal
I'm familiar with the theory that men are more expendable [1], but I don't think you can take that to imply that men don't have a breeding role. Men are critical to the family unit. Beside that, I'm suggesting that even on top of gender roles there is a breeder/non-breeder split. Otherwise all women AND men would have an urge to raise families, which is clearly not the case.

[1] www.psy.fsu.edu/~baumeistertice/goodaboutmen.htm

lusr··on Not Wanting Kids Is Entirely Normal
The problem with the article is it lumps together a whole bunch of different reasons for not wanting kids as if they're all equally reasonable reasons. It also doesn't address "normal" within any objective framework.

It's an interesting question in evolutionary theory whether there is an advantage to have a split of "breeders" and "non-breeders". Non-breeders, people who don't mind being e.g. soldiers and mine-technicians, seem pretty useful to society (actually a necessity once a large enough population of violent "non-breeders" evolve to threaten the breeders).

However they don't really contribute much genetically unless perhaps the "breeder" vs. "non-breeder" flag is entirely random and therefore allows for certain individuals to randomly specialize without negatively affecting the genetic potential of a family of mutations.

Intuitively, the value of "non-breeders" would seem to be very... expendable. I doubt people who are against having kids would enjoy that label, though. I wonder what other evolutionary value non-breeders bring to a species.

Perhaps having non-breeders who divert all their energy towards science and progress produce such an important species advantage that even if they don't necessarily contribute to the genetic pool they do contribute to the overall preservation and extension of the underlying genetic code.

lusr··on Not Wanting Kids Is Entirely Normal
Terrible article. It lumps together all the following scenarios and more:

1. A woman forced into motherhood by a partner who refuses to allow her to terminate the pregnancy

2. A forced mother (rape, abandonment) who was unable to opt for termination for whatever reason

3. A stay at home mother who thinks its too much hard work (as compared to...? We never find out what their expectations are)

4. A resentful mother with the wrong or unsupportive partner and whose anger and resentment towards said partner may now be directed at everything related to them (e.g. children)

5. Women who had children "too early" and feel resentful missing out on youthful freedom

6. Women who miss their youthful freedom

Etc. Some of these are quite understandable, some appear to be naivete, and some appear to be pure laziness or a lack of responsibility (i.e. deficiencies in moral character).

lusr··on Rob Pike on Object Oriented programming
Actually the author clearly states as much:

"Object-oriented programming [...] is a powerful idea. It truly is. But it's not always the best idea."

The problem is the opionated flamebait title submitted to Hacker News, the text of which is nowhere to be seen in the Google+ post itself.

lusr··on What Petraeus and Broadwell could have used instead of Gmail
What I don't understand is all the attention to technical risks of exposure. Ultimately his physical activities would surely have raised suspicion anyway? I find it hard to believe that the CIA and FBI rely solely on intercepting electronic communications to catch spies.
lusr··on Mark Cuban: Facebook Is Driving Away Brands - Starting With Mine
I had no clue who he was before watching Shark Tank. But it greatly impressed me when he straight-up called the woowoo "ions" guy on his bullshit and outright called it a scam [1].

Watching the YouTube video you linked it doesn't look like he seems to enjoy the T-Mobile product placement. Have I been brainwashed into liking him because of my earlier experience?

[1] http://www.youtube.com/watch?v=4XfXt93s1YE

lusr··on Mark Cuban: Facebook Is Driving Away Brands - Starting With Mine
I've commented about the Shark Tank 5% before [1]; I believe it's quite reasonable, why don't you?

Have you seen Dragon's Den (UK)? I saw Shark Tank first and thought it was great but the more hardline Dragon's Den grew on me and I believe I learned much more from it.

[1] http://news.ycombinator.com/item?id=3948913

lusr··on Why we have never hired an MBA
The real question is whether 4 (or 5, etc.) years of running your own business gives you more business skill than 2 years of MBA education and 2 (or 3, etc.) years of running your own business.
← PreviousPage 2 of 16Next →