The McGurk Effect - An Illusion you will never overcome. - <AUTHOR> http://hunch.com/item/hn_3697271/?mp_event=share_click&mp_extra=eyJzaGFyZV9zb3VyY2UiOiAic2hhcmVfdHdpdHRlciJ9

<comment><USER2> Looks like he's biting his lip in the left video, but not in the right video. I thought it was supposed to be identical except for contrast?

<comment><USER3> If you'd like to understand the video, I would suggest watching it. It contains a thorough description of what it's about, including why the man's lips have a different shape in the left-hand image.</comment></comment>


How Running A Business Changes The Way You Think - <AUTHOR> http://www.kalzumeus.com/2011/07/08/business-psychology/ <comment><USER2> I'm worried you've fallen out of one trap (salarymanhood) into another (highly paid consulting). I'm sure you're good at consulting and it's clear from the way you write that you're excited to finally get paid what you're worth for a change.

I'd just hate to see you wake up in a few years in a very similar situation as you were in as a salaryman.

It sounds like you're significantly increasing your cost of living: new apartment, getting married, treating money differently ("whats $2k when my comfort is on the line"), etc. If you're not careful you're going to _need_ to consult full time just to get by. Good bye startup. No time for that. Your new wife quit her job six months ago and that new car isn't going to pay for itself.

My advice: put off the enjoyment of making real money and get back to _investing_ time in AppointmentReminder or something else that will pay big scalable dividends.

That's what I'd say if we were having coffee :-)

<comment><USER3> I fell into that trap while still on salary, and it still haunts me three years into full-time consulting, and severely sabotaging attempts to transition to being a product company. Don't make the same mistake. +1

</comment></comment><comment><USER4> "I have since found that many, many people I respect likewise worry they're faking it. Anybody in my audience got the same issue?"

It's funny, when I started out in the professional programming world I had a ton of confidence. I felt unstoppable. Back then, I didn't know shit about programming but hey, how hard could it be. Then I started learning and slowly my confidence starting dwindling away. The more I learned, the less confident I became. I was humbled by the smart people I learned from. I realized how little I actually know. Now I'm noticing how big of an issue confidence has has become.

"I have found that actually showing confidence issues, on the other hand, does not do great things for one's business"

I've found that showing lack of confidence hurts in most areas of life. The less confidence I speak with, the less people take me seriously though. It's ridiculous. Now, whenever I speak with certainty & confidence, it feels like I'm faking it. It's a huge internal struggle and it's interesting to hear others perspectives on this.

<comment><USER5> _Now, whenever I speak with certainty & confidence, it feels like I'm faking it._

I have felt the same way. It's very hard to fight away that feeling, but I can see the trance people go into when I cut away the "truthful", disclaimer-ed, somewhat more equivocal and/or safe speech, and start talking like an expert, like I believe I'm an expert even if I don't believe it - I see people fall into a trance and I'm selling them. That's what you have to do, but it can definitely feel.. weird. Fake or whatever word you want to use.

<comment><USER6> <http://en.wikipedia.org/wiki/Impostor_syndrome>

</comment></comment></comment><comment><AUTHOR> Well we now have a better idea of the psychology behind 58,363+ Karma.

Patrick - as a business (not competent programming) guy who runs his own small business, and consults / coaches many much larger businesses, this was probably the article of yours I've had most empathy (and a thrill of excitement) reading. I mean, the HN-man-crush has been there for years, but I really received a lot of value feeling your feelings of suddenly being an international business consultant and being _good_ at it. Even your writing style here seemed more ... feely, though that may have been me.

And if that empathy gives me any credibility to support a key piece, more people should add 50% (or more - one of my mentors told me recently to 2x + $150 my price) more often. You are almost certainly more experienced and confident than you think you are. Recognising that is paying massive dividends for me.

</comment><comment><USER7> As always, I'm happy to talk about it. I think I specifically owe jdietrich a shoutout for his comment here <http://news.ycombinator.com/item?id=2667481> . I knew in the back of my head that I care about being happy. It was not obvious to me other people cared to read about that aspect of the business.

Back to our regularly scheduled tactics/strategy discussion next time.

<comment><USER8> Thanks, I really enjoyed your essay. However, I didn't care for your subscribe overlay appearing so abruptly. Would you please slide it down from the top or use something else to ease it in on the reader?

<comment><USER9> Agreed. It was abrupt, and I thought for a second I must have scrolled too far or accidentally switched tabs.

If there must be one (and I'm not against them), I would suggest the NY Times style slider. It's unobtrusive and smooth, so I know where it is coming from, and doesn't get in my way if I want to act on it. (Granted their objective is to bring you to another article.)

</comment></comment></comment><comment><USER10> Fascinating story and great insights. I think you undervalue your introspection.

It raises an interesting question though, if you were in a class that graded on a curve, did you do just enough to get an A or did you always get enough to insure it would be an A minimum?

Then the harder aspect of that, did your getting an A ever result in someone else getting a B grade? If it did would that make getting the A 'better'?

The question relates to the 'game' aspect of success. At Google, for example, when I was there it had a lot of money and not a lot of real[1] projects. So a number of people used gamification as a means of defining success. Specifically they would seek out 'win' such as having their project grow at the expense of others, or create the maximum amount of change in the shortest amount of time, or any number of ways to create a scoring system and then to 'win' based on that scoring system.

The insight you had, and I came to later, was that if you're button is 'win' and you take away the obvious 'company gets "better"' scoring system, people invent their own.I concluded that one of the jobs of 'management' in that scenario, is to help define a scoring system that allows folks who are 'wired to win' be successful and not be destructive to those around them.

[1] 'real' in the sense that few projects would make money for the company or cause it to lose money, they existed primarily as science projects to keep the engineers busy.

<comment><USER7> I treat both school and business as PVE, not PVP. (Gamer to human translation: the environment is the adversary to win over, not the other players.) There's a reason my dashboards always show my historical sales stats, not my competitor's sales stats. Beating my old score is a win. Beating their scores is not.

An environment where many people were aiming to _cause losses_ would be very unattractive to me, even if it could offer me all the tea in China.

<comment><USER11> _Beating my old score is a win. Beating their scores is not_

Ayn Rand wrote: "A creative man is motivated by the desire to achieve, not by the desire to beat others."

</comment></comment></comment><comment><USER12> I've been coming to HN for months and months always dreaming of doing something on the side along with my megacorp job but I have not started on anything. If I get an Idea, I wonder about it for 2 to 3 days thinking about reasons why it won't work and forget about it. I think about at least opening my own small consulting company on the side but then think how would I get any clients. This has basically been going on for quite a lot of months. But I end up going home, sitting in bed and still contemplating things. For what its worth, I was happy before being bitten by the startup bug, I guess not knowing what things CAN be like is better than knowing what things CAN be like but not being able to do anything about it. Knowing that I need to change my attitude and finish things, reading this article made me fill and mail the registration for my LLC.

<comment><USER13> I've dealt with a similar issue the last few months, mate. Introspection to the level of getting almost nothing done. I finally self-diagnosed myself with a testosterone deficiency _, and immediately gave up caffeine, ate healthier and started regular exercise. The introspection is still there, but it's far, far, far less a problem, in only 3 weeks. I can't believe how much stuff I'm accomplishing.

So if I can go from crippled to David Allen 2.0 in less than a month, there's hope for anyone. Be healthy, be interesting, and the dreaming should naturally turn into doing sooner rather than later. Far better than trying to force it.

_ I may or may not had an issue with this. The point is my psyche believed I did, giving me specific ways to "fix it." Mental game here.

<comment><USER12> _Introspection to the level of getting almost nothing done._ I'll remember that. Good to know I'm not the only one out there. I agree with you, finishing things and getting things done should start eternally and inside you first. key is to be consistent in anything you do.

</comment></comment></comment><comment><USER14> This was great, Patrick.

I've been going through a hugely eye-opening period of my life where I'm learning lessons that your article echoes. The largest of those lessons are: A) Your main obligation is to serve yourself and to allow yourself to make decisions you are truly happy with, and B) Much more than "It's not about what you know, but who you know", I'm finding that it's really about "what you know about how to deal with people you don't know." And for me, not knowing about the latter prevented me from realizing the former, and your story about missing the Delta flight not only validated those points to me, but really hit home.

Additionally, I'm finding that the way I viewed my dealings in life and overall progression as a person was completely backwards: I would look at my past attempts, from social to professional, as a long string of failures that would only continue to stretch onward, both discouraging me and crushing my confidence. But in looking at my attempts as isolated, bunkered events, the spread of potential damage is significantly decreased, which has done quite a bit to boost my confidence in that I'm more willing to take that much more of a risk. If the bomb blows up, leave the bunker and move on to the next one with your newly acquired knowledge and experience. And no one really remembers that bomb exploding as the explosion was merely a psychological dramatization. I know you somewhat touched this point in a more business-negotiating context, but it's one that's had a universal effect on how I deal with others in any context.

Anyway, really nice writeup; I enjoyed it quite a bit! More articles like this one would definitely be appreciated.

<comment><USER15> It is human nature to over estimate the impact of events or things we do. Every one looks at the world with their own view point. They are the center of their own universe. That's all the world we know.

May be not failing often is the reason why we take ourselves so seriously. Your current view point of looking at things as isolated events is a great way of looking at life.

</comment></comment><comment><USER16> I take great umbrage with his graph depicting teachers both as relatively high paid and not working that hard. He says he's been a teacher, but given the plot on the graph, I highly doubt it. It's way harder than you think, and unless you're a tenured professor at a university, teachers make shit.

<comment><USER17> I've never taught high school, but I'm a grad student and teach freshmen, so I have some experience. A few observations:

1) The first time you teach a class, it's incredibly hard and time consuming, but the difficulty drops like a logarithm to a relatively low plateau after you've done it a few times.

2) At one point I thought about teaching high school English. Seattle Public Schools paid $36K / yr with a Masters or $30K / yr without starting, and those numbers topped at around $70K and $55K after 30 years (IIRC, Bellevue Public School teachers made something like ~10K more). That doesn't count retirement; teaching is unusual because a lot of the benefits are backloaded in the form of retirement pay. One woman in my grad program taught English for 26 years in Michigan and took an early retirement offer; I think she gets 70% of her last year's salary for life. Granted, those deals are going away because of the budget crisis, but a lot of the retirement stuff is still baked in.

3) You can multiply those numbers by 1.2 or so because teachers only have mandatory work for nine months of the year.

4) After two to three years, you effectively can't be fired because of union rules (unless you sleep with a student and get caught in a flagrant manner, don't show up, etc.). See this post: <http://jseliger.com/2009/11/12/susan- engel-doesnt-get/> for lots of citations on that, as well as a lot of the information that's going into this comment. This has value. PG figured this out: "Economic statistics are misleading because they ignore the value of safe jobs. An easy job from which one can't be fired is worth money; exchanging the two is one of the commonest forms of corruption. A sinecure is, in effect, an annuity." <http://paulgraham.com/ladder.html> .

Note: there are major downsides to teaching. You have to like working with relatively undeveloped people (if you're teaching high school) or children (if you're teaching elementary school). In teaching, it's very hard to make substantially more money if you really want to; whether you're a good or bad teacher isn't likely to make you more money.

My big impression is that teaching isn't going to make you rich, but you're also unlikely to ever be poor. To say that "teachers make shit" isn't really true. It is to true to say that teachers have back-loaded compensation packages that tend to be high in benefits (e.g. good health care, retirement) and low in upfront salary.

My smaller impression is that most teachers I had didn't seem to work that hard after their first three - four years of teaching.

<comment><USER18> I'd say that "teachers make shit for knowledge workers". Yeah, they're not going to the poorhouse (provided they can find a job in the first place and get entrenched), and there are a lot of problems with union contracts, but if you're educated enough to get a masters and good enough at teaching/politics to make it through the first few years, you probably could've made more money elsewhere.

</comment></comment></comment><comment><USER19> Does the median investment banker really make that much? I was under the impression that the mean investment banker income was high, but there was a large amount of skew due to high salaries of the folks at the top.

I was also under the impression that the job involved a soul-crushingly large workload...

</comment><comment><USER20> This should be recommended reading for anyone suffering from self-doubt before making the leap into self-employment.

<comment><USER21> You're not necessarily wrong. You're just damning the article with faint praise. The point of the article wasn't "Do you want to start a business? Yes you do. Go start one now."

It's more "Do you want to start a business? Yes? Go do it! No? No sweat! Just make sure you're making yourself happy and not just toiling away to make someone else happy."

The ultimate theme behind this blog post is to make sure your life is about _you_ and your relation to other people. Otherwise, you get trapped into believing a lot of shoulds: you should get a bachelor's degree, you should get married, you should work long hours for terrible salary, etc.

</comment></comment><comment><USER22> RE: Working harder is not correlated to more money

But what about working smarter? Sure, such a thing is harder to measure, but it's pretty much the only gauge when you're talking about meritocracy. Working harder, not smarter, is the make-work bias.

<comment><USER23> I think it is also unfair to compare working hard between different industries. That is like comparing apples to oranges, surely a harder working software engineer will make more money than a lazy one.

<comment><USER7> _surely a harder working software engineer will make more money than a lazy one._

I know two offices in NYC at an employer that I probably shouldn't name. In one, an engineer toils away for 90 hour weeks and earns about $40k per year. In the other, an engineer works fairly typical Manhattan hours (my understanding is that that would be a little south of 50), and makes $120k.

The mistake made by the engineer in the first office? They were asked a fairly consequential question by a HR department three years ago, and said "Yes." instead of "No." Literally. One word.

The specific question was "Are you OK with your employer of record remaining our Japanese branch office?" The right answer would have been to get their employer of record transferred to the American subsidiary, which pays Manhattan wages to Manhattan workers, rather than Nagoya wages with a 25% hardship premium. He gets a gold star for loyalty, though.

That is about as close to a pathological case as I could think of, but in general, "hard work gets rewarded" is not something we repeat because it is accurate.

<comment><USER12> does the first employee get paid 40K at the Japanese branch or in the states?

<comment><USER24> "I know two offices in NYC"

</comment></comment></comment></comment></comment><comment><USER25> > My friends also tell me that I'm almost a different man these days than even > two years ago. The most striking quote to me, from my best friend: "You > look… healthy." Apparently the old day job was beating me down so thoroughly > that I looked about as bad as I felt, and even on those days when I wasn't > dog tired I walked with a bit of a stoop. These days, I even stand > straighter. I think that is almost too convenient to be true, but hey, it's > a story.

Could be testosterone; it's extremely sensitive to status changes, see the review "The Role of Testosterone in Social Interaction" (abstract: [http://www.sciencedirect.com/science/article/pii/S1364661311...](http://www.sciencedirect.com/science/article/pii/S1364661311000787) ; PDF: <http://dl.dropbox.com/u/5317066/piis1364661311000787.pdf> )

</comment><comment><USER26> "Money is also the convenient method of keeping score for optimizing businesses, which feels like a game to me. I really enjoy winning games with complicated rules sets, especially by optimizing the heck out of play, because optimization is often as much fun as actually playing the game."

It reminds me a very inspiring talk by Seth Priebatsch called "A game layer on top of the world". I was at SXSW 2011, you can listen to it here: <http://schedule.sxsw.com/events/event_IAP000325>

</comment><comment><USER27> A (humorous but) very engaging similar story: <http://lifelessboring.com/less- boring-life-start-time/>

Less facts, more stories, but another perspective on the 'be high status' concept.

</comment><comment><USER19> In three words: "Be high status".

</comment><comment><USER28> Fantastic read. People in general, but it seems developers particularly, greatly underestimate their worth and talents. A friend of mine was looking for work as a freelancer and asked me to what he should ask for by way of a rate. I asked him how much he'd be happy with, he replied "60". I said, "so ask for 100 and negotiate down if you must". He was blown away that someone would pay that much.

</comment><comment><USER11> There is a strange layout error on Patrick's site. When I reach the end of the article, suddenly some kind of overlay pops up, and makes the text unreadable. See <http://www.michielovertoom.com/incoming/kalzumeus.png> for a screenshot.

<comment><USER29> A better question is why is it in comic sans for you? Do you have a user- defined masochistic stylesheet or something?

<comment><USER11> Oh, do not let the font distract you. Comic Sans is my all-time favourite; I use it as a default/standard font on all my machines (Windows, OSX, FreeBSD+KDE, Ubuntu etc...)

You know what they say: beauty is in the eye of the beholder. I just find Comic Sans a nice font to read and to program in. It's exquisite rounded shapes are nice on my eyes.

<comment><USER29> O_o

 _Do not let the font distract you_ Not so easy.

You're just trolling me now right? I guess… I mean… agh. OK. Sure…

I've never thought it a particularly ugly font, I just always thought it was overused and often used in the wrong contexts. I can't imagine programming in it.

<comment><USER11> No, I'm not trolling. I agree with you that Comic Sans is often used in wrong contexts (although the situation is becoming better).

It's not wrong for programming either, in my opinion, see [http://www.michielovertoom.com/incoming/comic-sans- python.jp...](http://www.michielovertoom.com/incoming/comic-sans-python.jpg) for an example. I dislike monospaced fonts for programming, and with that I'm in the minority.

For games Comic Sans is also great, see [http://www.michielovertoom.com/incoming/wow-Luyt-of- Khadgar-...](http://www.michielovertoom.com/incoming/wow-Luyt-of-Khadgar-PVP- healing-champ.jpg)

</comment></comment></comment></comment></comment><comment><USER30> These are old basic ideas[1] on pursuing happiness, in a slightly rehashed way, with the ask culture (how does that work in Japan?) thrown in with some randian self determinism.

[1] Schopenhauer <http://www.gutenberg.org/ebooks/10741>

</comment><comment><USER31> Your skills don't just scale down to asking out a date or going to city hall. They can scale up to $ billion mergers

Maybe the world would be a better place if you had influence over that kind of semi-arbitrary wealth transfer as opposed to whoever has it now.

</comment><comment><USER32> Thank you for the inspiring write-up!

Btw, is it intentional that the blog suggests sharing the link on Delicious? Is Delicious still a secret weapon perhaps?

<comment><USER7> I'm testing out a Wordpress plugin that I'm writing for a client, and I figured I'd inflict it on my readers before I did it on their readers. (It will get OSSed, eventually, after I iron more kinks out. Someone reported it broke printing -- who knew?)

I hate TwitBook sharing buttons, for a bunch of reasons. Conversely, I _love_ the delicious button -- I slap it on (typically) geek-friendly reference content and a) it gets a lot of instantaneous loving and b) it sends relevant traffic for a long, long time.

Not too much an issue for my blog but very relevant to clients: many people have Delicious -> blog setups. This means that a save on Delicious sometimes counts as a link, in a way that tweets and FB activity typically do not. You can imagine the SEO benefits of that one.

<comment><USER33> "inflict" is a good word choice for that blue bar :)

<comment><USER11> I dislike these boxes that slide into view when you reach the end of an article. It distracts the eye from the text, like any moving thing or animated GIF on the page. Just some static text below the article would be better, like 'Read other articles: ABC, DEF, XYZ' and perhaps some static tweet/facebook button.

<comment><USER32> Then again most advertisements aim to be at least a little bit distracting. What would be the point of an ad that nobody sees?

</comment></comment></comment></comment></comment><comment><USER34> Good article, but have serious reservations as to if he knows the full extent of being a paperboy. That's a surprisingly hard job.

</comment><comment><USER35> the confidence to charge more is very important.

if you know what you are providing is quality, you can charge for it and people will pay for it. Sure you'll get a bit more rejection...but those cheapskates wouldn't have appreciated your work anyways.

and hey if they say no, you can always go back a few weeks/months later, and tell them that you are running a discount

</comment><comment><USER36> Many things one can relate to in there. For example, I just realized I also like praise for vanity/insecurity reasons. That's also the reason to write this comment.

Confidence? You need to become a little macho to survive in business, but it's also addictive. Overconfidence is a double edged sword, it's good to keep the humility to yourself.

Whether having your own job/business can change you? I believe not, it just allows you to be 100% yourself, disinhibited, not trying to cover up the sharp edges of your character that you usually cannot display when you are a gear in a corporate machine. For me it was also sort of like going back to childhood.

And it's a lot of fun (but i think that's the endorphines from the sense of power you get).

Historically, excluding feudal and industrial/postindustrial europe people were a lot more entrepreneurial, they would either be farmers, cobblers, smiths; in general people were in charge of their art. Maybe they were also happier back then.

</comment><comment><USER37> This is an excellent article, and fascinating to read. However, 5/6 of the way down the page, a blue share bar appears on top that I cannot click out of. It is quite annoying.

<comment><USER38> If you happen to use Firefox, I can recommend the iReader extension. <http://www.samabox.com/extensions/iReader/>

<comment><USER11> Thanks for the tip. There is also the Readability AddOn (<http://www.readability.com/addons>) but that somehow hides the comments at the bottom of the article. iReader does not.</comment></comment></comment>


HAML Brings Seaside  To Ruby - <AUTHOR> http://gilesbowkett.blogspot.com/2009/01/haml-brings-seaside-awesome-to-ruby.html <comment><USER2> _when you're writing HAML, you're programming more and marking up less . . .If you like programming and you don't like writing markup, then the advantage is you have more fun._

I second that. I used Sinatra and HAML when I wrote Feedstomper.com and the whole thing just felt lighter and more fun than some Rails apps I've written (when I was also using erb).

Granted, the whole concept was lighter than those apps, but still -- I like HAML.

One issue: sometimes you can stumble over javascript: [http://b.lesseverything.com/2008/2/19/haml-doesn-t-like- java...](http://b.lesseverything.com/2008/2/19/haml-doesn-t-like-javascript)

Oh, and if you're interested in Sinatra (and why not, while we're waiting on Mrailerbs), you can learn it from just this page:

<http://github.com/bmizerany/sinatra/tree/master>

<comment><USER3> I read your comment, and was a bit taken aback.. "isn't that what :javascript is for?"

Reading through the comments, though, :javascript was developed specifically in response to that post - it wraps everything indented in script tags, and does the right thing with special characters/etc.

<comment><USER2> Ah -- I didn't know about that. I was just putting my script tags in strings. Thanks!

 _The More You Know_

<comment><USER3> No problem. I don't think I caught it until I went through the Haml docs a second or third time - lots of handy little tidbits floating around in there I missed the first time.

</comment></comment></comment></comment><comment><USER4> The real amazing part of Seaside is how is uses continuations to turn the http request/response cycle inside-out. HAML doesn't appear to do anything like that, so comparing it to Seaside seems misguided.

<comment><USER5> I'm pretty sure the article was just trying to compare HAML to a small part of Seaside. ("Seaside packs a lot of ideas into one framework. _One_ innovation [ed. not _The primary_ innovation]: you don't write HTML.")

I think the real point wasn't even that Seaside's HTML generation is smart/powerful/fun. It's this:

 _I enjoy programming in Seaside because when I'm programming in Seaside, I'm programming. I'm not wrestling with markup; that's for computers to do. I get the same pleasure out of using HAML._

<comment><USER6> " I'm programming. I'm not wrestling with markup; that's for computers to do. I get the same pleasure out of using HAML."

Anecdotal counterpoint:

I'm one of those who has the opposite experience with Haml. It's a constant fight. OTOH, XML/HTML is stupid easy; my editor takes care of the annoying parts, and I never fight with cryptic errors. It's easy to cut-n-paste for assorted sources, and use WYSIWYG editors if and when I want to.

I think I could live with Haml (I'm sort of compelled to deal with it since I took over an abandoned Rails project) if it did not use significant indentation. It works ok for small chunks of text, utter pain when there's much nesting going on.

The application of the description "terse" is quite on the money. It's not a feature.

</comment></comment></comment><comment><USER7> I get why some people will object, since Haml is an alternate markup language, and Seaside is a framework. I basically agree. However, the point of this post, and the point of the discussion here, should be about how awesome Haml is.

I wanted to hate it. I don't like significant whitespace _at all_ and so dismissed Haml at first as not something I would ever look at. Enough people told me it was awesome that I had to try it for 10 minutes, and it really grew on me.

Like Sinatra, it's just fun. They pair really well together.

<comment><USER8> "One innovation: you don't write HTML. You tell Seaside what HTML you want, and it does all the dirty work."

I'm sorry. I really think it is legitimate to dismiss Haml out of hand. The ideal framework writes everything for me _but_ the html. If there is one think about the web that _works_ , it is html. HTML is the first markup language used widely by non-programmers. You can come up with whatever argument you want for its undesirability but its like trying to fight the need for a qwerty keyboard in a PDA.

Not only is Html a great, proven, standard language for representing rich text on a page, it is a language that even your customers can understand (not to mention your web designer..). I'm sure someone once came out with a great, non-ascii word processor...

<comment><USER9> HTML is nothing more than a syntax that represents a tree of nodes with attributes, that's it, and there are other syntaxes that can also represent that same structure just as good.

When you have a language who's syntax is directly capable of representing that structure natively, it's a huge programmatic boon to simply write the markup directly in the host language.

In Seaside for example, since HTML is written in Smalltalk directly, I can use all of Smalltalk's automated refactoring tools on it, extracting methods, renaming things, pushing methods up and down the class hierarchy, etc. You can slice and dice pages in a way not possible with text files.

This is a huge advantage over raw HTML templates for the programmer. Seaside firmly insists that the programmer, not the designer, should be generating the proper markup; the designer has CSS. If this fits your work style, or if you're both the designer and the programmer, this style will benefit you and is much more enjoyable that raw HTML.

<comment><USER10> > When you have a language who's syntax is directly capable of representing > that structure natively, it's a huge programmatic boon to simply write the > markup directly in the host language.

 _IFF_ the other people you have to collaborate with, such as designers, artists, new programmers, etc... are all fluent in that language. That's a big 'if' in my opinion. I can hand someone a Rails template file, and they can hack at it even if they don't know Ruby.

<comment><USER9> It's not a big if at all, representing a tree of nodes with attributes in an alternate syntax doesn't change the semantics of the markup. If they know HTML, they can learn an alternate markup style in minutes, it ain't rocket science.

</comment></comment></comment></comment></comment><comment><USER3> In addition, Sass (Haml's CSS counterpart) is almost worth the price of admission by itself - the way it handles nested CSS rules and families is very smart, and that's not including constants and calculation functionality.

<http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html>

<comment><USER11> I really enjoy using sass with compass... it makes css much more bearable...

</comment></comment><comment><USER12> I have yet to see a good case made for when abstracting HTML back is a "really great idea".

<comment><USER13> I wouldn't call HAML "really great", but after using it for a few months I can say it's a pleasant improvement over writing straight HTML. It's just a matter of taste.

</comment></comment><comment><USER14> If HAML's not your thing then ok, to each his own. But the people here dismissing HAML out of hand because it's "easier" to just write the HTML by hand sound like people advocating typewriters over word processors. The whole reason to abstract HTML away is because it's easy. Writing HTML by hand is repetitive and boring. If you still enjoy it, you probably haven't been doing it for very long.

</comment><comment><USER15> He totally misses the point of seaside. It isn't about slick html generation. It's about keeping the client state entirely in the server through continuations. Seaside would be nearly as powerful if you still had to generate all of the html by concatenating strings.

Having said that, I think Seaside is headed the way of the dodo as javascript clients become easier and more powerful.

</comment><comment><USER16> well, both technologies are interesting on their own. but comparing them is a stretch.

Instead of bringing seaside to ruby, can we bring a merb-like framework in smalltalk? seaside's continuations are very cool. But I do not need them for most interactions, just the more complex ones.

</comment><comment><USER17> The minute you have to start working with designers HAML is a no-go.

</comment><comment><USER18> even after reading this, i can only speak to haml. it does beautify your markup, but like anything... it can still become a pain to read when files become verbose.

<comment><USER6> It seems that, as with YAML, examples tend to be quite short, with limited indentation.

</comment></comment><comment><USER19> Does Python have an equivalent to HAML?</comment>


Ask HN: a lightweight contact db that is Not a CRM - <AUTHOR>

(This is pretty long, my apologies).
I'm looking for a very specific, very lightweight kind of contact database, and I'm having trouble finding it. Most contact db's are CRM solutions geared towards sales, which is overkill, and makes them harder and slower to use.
For this db the most important quality is to be able to create and export custom lists based on a very large number of attributes (which may be added and deleted over time).
CONTACTS
Of course, the db has to hold a large number of e-mail addresses, phone numbers and attributes like country, place of work, but also relatively long (and non-fixed) lists of specialties.
Every CRM or mailing program like Mailchimp can do this. The problem being that Mailchimp (and other mailing engines) allows only a limited number of groups or tags and that's simply not enough for the granularity needed in this db.
On the other hand, CRM's (like Highrise) are simply overkill for this. We don't want to track relationships with these contacts in the db.
LISTS
The db has to be able to produce lists of contacts based on combinations of attributes: "X and Y", "X and Y and/or Z", "A and X but not D".
EXPORT
The db then has to be able to export this list with a number of attributes (name, place of work, phone,...) to Excel.
CLOUD
Of course, we'd like to use this as a kind of cloud service and accessible by the whole team.
The solution has to be used by relatively junior staff. We tried Grubba but exporting from it proved too much of a hassle for said junior, non-technical staff. Thanks in advance for your help. <comment><USER2> Depending on just how much data we're talking about, I would suggest using a tab-separated text file. To test attributes, use a column that is just a comma-separated list and use awk to match against that column. Excel can already read TSV.

<comment><AUTHOR> Since multiple people (including interns) will use the list (both to input new entries, change entries and export lists from it), this would be way too easy to erase I'm afraid.

I'm looking for something with a minimum of interface and 'fool proofness'.

</comment></comment><comment><USER3> If it doesn't have to be integrated into your own system, why not just google contacts?

<comment><AUTHOR> It's not easy enough for junior staff to make granular search. (We're really talking stuff like radio buttons and pre-set "and/or" possibilities here).

<comment><USER3> [http://productforums.google.com/forum/#!topic/apps- script/aL...](http://productforums.google.com/forum/#!topic/apps- script/aLwXLHre9CQ%5B1-25-false%5D) Use google forms to create a fool proof interface for adding them, and do the same to search?

</comment></comment></comment><comment><USER4> Perhaps I'm missing something, but why not just use a Google Spreadsheet?

</comment><comment><USER5> Why not develop one for yourself?</comment>


Microsoft says IE9 faster than Chrome, but is it? - <AUTHOR> http://blogs.zdnet.com/Google/?p=1837 <comment><USER2> Well I'm sure it is since it doesn't handle css properly.

</comment><comment><USER3> That's a pretty worthless article. But of course, anything bashing Microsoft will do well with the HN crowd.</comment>


How to build your own CDN using BIND, GeoIP, Nginx, Varnish - <AUTHOR> http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-using-bind-geoip-nginx-and-varnish/ <comment><USER2> If you want a non-patched server, built for this task, consider pgeodns: <http://geo.bitnames.com/>

It is used by svn.apache.org, CPAN, the NTP pool, etc.

I personally have my doubts about any value created for static pages doing this though, there are relatively cheap CDNs on the market now, rather than trying to find VMs in a dozen countries.

In addition you have to be careful about services like OpenDNS which for example, made svn.apache.org always resolve to the EU even for users in the US, due to how their DNS anycast is setup.

<comment><USER3> > I personally have my doubts about any value created for static pages doing > this though, there are relatively cheap CDNs on the market now, rather than > trying to find VMs in a dozen countries.

Please share the options.

My scenario is that I transfer around 800MB in static content (images, CSS and JS) per month. I'd simply want that part CDN'd.

I used to use SimpleCDN but found them too expensive after they changed their pricing model.

<http://www.simplecdn.com/pricing>

<http://www.simplecdn.com/savings>

The cost of 2 additional Linodes would be (2 x $19.95) = $39.90 per month.

My bandwidth usage isn't so great as to make the cost of an off-the-shelf CDN solution beneficial, yet it's great enough that a couple of Linodes would make a visible speed difference to the 100,000 unique visitors per month that visit my site from North America.

To my mind there is a gap between small site and large site into which running a couple of VMs to provide a cheap CDN is an advantage.

Although if you can show me cheaper drop-in (pass-through) alternatives to SimpleCDN then I'm very eager to hear about them.

<comment><USER3> I got my numbers wrong thanks to an early morning typo... 800GB bandwidth per month, not 800MB.

Of the options recommended:

Max CDN = $39.95 per month deal (1TB), usually $99.95 = Same price as DIY on the deal, or more expensive normally.

SoftLayer = $140 per month (1TB) = More expensive.

CacheFly = $299 per month (2TB) = More expensive and have to upload files to server.

Rackspace CloudFiles = $176 per month (based on current 800GB bandwidth alone - other costs not yet factored in) = More expensive.

Amazon CloudFront = $131 per month (based on current 800GB bandwidth alone - other costs not yet factored in) = More expensive and you have to upload files to the server.

So yeah... DIY looks substantially cheaper. There's still a big gap between small site and large site. For a few days of my time I can easily save myself a lot of potential cost as well as speed up my website. I can't really see why I wouldn't set up my own CDN.

<comment><USER4> But the $19.95 linodes have a 200GB/month limit - so you'd need at an absolute minimum of 4 to do 800GB/month, and given you won't have perfect geographical spread, about 6-8 is perhaps more realistic. So you'd be looking at least $120 for the VPS, plus the time/hassle of setting this up and managing/monitoring it.

So it's just as expensive, and there's no way the DIY model would be cheaper in terms of TCO.

<comment><USER3> I already host with Linode and they pool the bandwidth allowance for all Linodes in your account.

As I've already got nicely layered VMs some have a totally unused allowance. For example my MySQL nodes only transfer traffic on the private network at Linode and so both the master server and slave use virtually zilch of their bandwidth allowance.

I'm fairly sure that most Linode users with more than 1 node will be using only a fraction of their allowance.

My total pooled bandwidth allowance with Linode is close to 4TB, of which in total I'm using only 1TB with 800GB being static content.

My point was simple: The DIY solution with Linode looks to be a really good idea as I already am with them and placing CDN servers in other datacenters should mean good routing internally within their network (or peers) as well as being extremely cheap.

I have yet to be shown that for my scenario there is a cheaper option and that this is solved. I am very happy to be proven wrong as it will save me some work, but so far DIY is winning.

</comment></comment></comment></comment></comment><comment><USER5> This is an interesting article but one thing I don't yet understand (which may become clear in part 2) is why both Nginx and Varnish are needed. Nginx can certainly do this on its own, and as far as I know, so can Varnish which has been designed to handle slow backends.

<comment><USER6> 1) Nginx is a fully fledged Web server and has some performance penalty compared to Varnish. The latter is lightening fast.

2) Nginx is no match for Varnish's VCL for header/cache manipulation

Regards

<comment><USER7> 1- yes but at the very highest loads 2- you don't need that much manip. for simple load balancing. 3- can you backup your claims with reference(s)?

<comment><USER6> 1 - not necessarily 2 - it depends on app complexity. Most people that read Y need it. 3 - Benchmarks? sure :) <http://www.unixy.net/apache-vs-litespeed>

<comment><USER8> What does an Apache v Litespeed benchmark have to do with anything?

<comment><USER6> The above post proposed that Varnish is not needed because Nginx could handle the task well with the best performance. But Nginx is a bit slower than Varnish. It's been shown in benchmarks that Litespeed is a bit faster than Nginx. By inductive reasoning to show that Varnish is faster than Nginx, I posted a link to show that Varnish is faster than Litespeed, which in turn is faster than Nginx. So Varnish is faster than Nginx.

Let me know if you have any question/comment.

Regards

<comment><USER8> My question is how you manage to stay in business with such flawed 'reasonings'.

That benchmark in particular is so full of crap that people will become dumber after reading it.

<comment><USER6> I'm not going to respond to your personal attacks; just the factual content of you post(s).

I understand that you perceived my posting of the benchmark link to be inappropriate and I agree with you to an extent. It remains to say that the link represents my proof within the context of the conversation chain from earlier.

You seem to be a long-term contributor here and I'm sure it's appreciated. I would be interested if you addressed the flaws or issues with the benchmark results. I do make mistakes just like anybody but own up to them at the end.

Let me know if you have any question and I'll be happy to discuss.

Regards Joe

<comment><USER8> Flaws with the benchmark:

1\. Misrepresentation

The title says 'Apache vs Litespeed', when in reality it is 'Varnish vs Litespeed', Apache has nothing to do with this particular benchmark.

2\. Questionable results

Varnish serving 217.05 req/sec for a static page at 100 concurrency level? Something is seriously messed up in the setup; Varnish can easily handle thousands of req/s for something as simple as looking up a cache entry and returning a static file for 100 clients. Oh wait, 11177.99 [Kbytes/sec] - looks like you saturated the pipe, making it a test of how fast your network is, and nothing to do with Varnish.

3\. Flawed benchmark testing procedure

You can't expect a simple `ab -c 100 -n 10000` to provide any insight whatsoever towards the general handling of a server. The only thing obvious is that Litespeed has been saturated with 100 concurrent connections. If you're going to do a benchmark, you must post varying concurrency levels at least (along with exact setup configurations). Likewise, cpu and memory usage are just as important to providing valuable insight.

4\. Comparing apples to oranges

I'm not entirely sure what Litespeed is doing (eg. does it cache statically?) since you haven't specified it exactly, but considering that almost 70% of the requests failed and almost all requests after the first few had a different content length, I would assume that Litespeed is returning a dynamic request each time, whereas Varnish is returning a static file. I have no doubt in my mind that if you ran the same scenario (ie. Litespeed serving a static file as well) the results would be much different.

5\. Irrelevant to the article benchmark

Saying "But Nginx is a bit slower than Varnish", then linking to a terrible _irrelevant_ benchmark and using circular logic (based on another completely crap Litespeed vs Nginx for serving _php!?_ benchmark) to infer that Varnish is faster than nginx hurts my brain.

I ran a really simple benchmark on Varnish 2.1.3 and nginx 0.8.49's proxy_cache directive on a single url; nginx is faster.

However, what if we test a heavy config with a bunch of complicated rules? Varnish's VCL compiles straight to C and might give it the edge in those cases. What if we use test a million different urls and really test how each one handles their cache hit/miss procedures. How do they fare under real world scenarios where thousands of different clients on various connection speeds are connected? I know nginx is damn efficient memory wise when dealing with a load of keepalives.

6\. Conclusion

Good benchmarks are difficult.

<comment><USER6> 1\. All is disclosed in the page. Varnish is indeed mentioned on the page as being the crucial piece that made is all happen. But mea culpa, the title "Apache vs Litespeed" does need the Varnish bit added. I'll correct it shortly.

2\. You're making the assumption that varnish/VCL is caching the first server- side result indefinitely (ttl). That is not the case. So apache is still doing work behind the scenes, albeit less work than it's used to. Whatever hosting conditions we imposed on Varnish/apache are the same imposed on lsws. It's fair game (for better or worse).

3\. Actually Litespeed is able to handle more than 100 concurrent connections. What choked it apparently is its inability to manage the 100 PHP requests well. It actually ran out of memory during the experiments. Again, Litespeed was given the same amount of memory and was under the same conditions as Apache/Varnish. While the environment/conditions are not optimal, both varnish/httpd and Litespeed started equal. At first, we started with -c 10 and -n 10000 but both setups performed fairly well. So we upped it to -c 100. Checkout the load average from the Litespeed node below.

4\. One of the goals of the experiment is to install stock Litespeed and stock Apache (RPM). No configuration changes were made to either. Litespeed has static object caching (20MB) enabled by default. Varnishd was given a 16MB cache. Stock installs are common in the Web hosting business, which is the scope/interest here.

5\. Based on experience with client portals, Varnish as a cache seems to perform better than Nginx as pure cache. It could a perception. We use Nginx and/or Varnish where it makes sense though. They're both free and open so why not!

6\. Can't agree more. Just for the record, we didn't select the hardware and environment to favor either web server. We had a vacant server, network, and resources and went from there. The fact that this environment did not produce good results for Litespeed is purely coincidental.

FYI, Litespeed Tech noticed the benchmark and mentioned that they're working on developing a cache module that will ship with Litespeed web server. We'll see.

[root@lsws_node /]# while [ true ]; do uptime; sleep 3; done 19:45:37 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:40 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:43 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:46 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:49 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:52 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:55 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:45:58 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:46:01 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 19:46:05 up 0 min, 0 users, load average: 2.88, 0.60, 0.19 19:46:09 up 0 min, 0 users, load average: 5.45, 1.17, 0.38 19:46:12 up 0 min, 0 users, load average: 7.82, 1.73, 0.57 19:46:15 up 0 min, 0 users, load average: 7.82, 1.73, 0.57 19:46:18 up 1 min, 0 users, load average: 10.08, 2.30, 0.76 19:46:21 up 1 min, 0 users, load average: 10.08, 2.30, 0.76 Segmentation fault Segmentation fault Segmentation fault -bash: /usr/bin/uptime: Cannot allocate memory -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done -bash: fork: Cannot allocate memory [root@lsws_node /]# while [ true ]; do uptime; sleep 3; done 19:46:40 up 1 min, 0 users, load average: 18.36, 4.66, 1.56 19:46:43 up 1 min, 0 users, load average: 17.53, 4.72, 1.60 19:46:46 up 1 min, 0 users, load average: 17.53, 4.72, 1.60 19:46:49 up 1 min, 0 users, load average: 16.13, 4.64, 1.59 19:46:52 up 1 min, 0 users, load average: 14.84, 4.56, 1.58 19:46:55 up 1 min, 0 users, load average: 14.84, 4.56, 1.58 19:46:58 up 1 min, 0 users, load average: 13.65, 4.49, 1.57 19:47:01 up 1 min, 0 users, load average: 13.65, 4.49, 1.57 19:47:04 up 1 min, 0 users, load average: 12.56, 4.41, 1.56 19:47:07 up 1 min, 0 users, load average: 11.55, 4.34, 1.55 19:47:10 up 1 min, 0 users, load average: 11.55, 4.34, 1.55 19:47:13 up 1 min, 0 users, load average: 10.62, 4.27, 1.55 19:47:16 up 1 min, 0 users, load average: 10.62, 4.27, 1.55 19:47:19 up 2 min, 0 users, load average: 9.77, 4.20, 1.54 19:47:22 up 2 min, 0 users, load average: 8.99, 4.13, 1.53 19:47:25 up 2 min, 0 users, load average: 8.99, 4.13, 1.53 19:47:28 up 2 min, 0 users, load average: 8.27, 4.06, 1.52 19:47:31 up 2 min, 0 users, load average: 8.27, 4.06, 1.52 19:47:34 up 2 min, 0 users, load average: 7.61, 3.99, 1.51 19:47:37 up 2 min, 0 users, load average: 7.00, 3.92, 1.50

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER3> Nice.

The instructions assume some familiarity with BIND and Varnish, what I'd love to see would be a Linode article explaining how to use their datacenters to do this.

Specifically I'd love to put noes in 2 US datacenters and the London one to help reduce my page load speed for the US visitors, whilst leaving the dynamic nodes all in London where most of my users are.

</comment><comment><USER9> I would use Powerdns instead of BIND. It's opensource and already comes with a geo backend (among others).

<http://doc.powerdns.com/geo.html#AEN6738>

The doc says, Wikimedia uses PowerDNS' geo backend.

</comment><comment><USER10> [http://poramin.com/post/818944318/install-bind-with- support-...](http://poramin.com/post/818944318/install-bind-with-support- geoip-on-ubuntu)

</comment><comment><USER11> Relying on MaxMind for your CDN location targetting is not how I would recommend doing this.

Anycast is better these days as it will taking routing topology into consideration over a hardcoded list of IP addresses. And routing topology can then be adjusted to account for congestion and other variables.

</comment><comment><USER12> Great article to help me understand a bit more on how CDNs work! As others have pointed out the cost-effectiveness of deploying your own CDN is questionable in this climate, but the KNOWLEDGE of how your leased CDN works is certainly valuable!

</comment><comment><USER13> Great article. I always wondered how this is done. I was aware of varnish and nginx, the missing link was the patched bind9 version. Many thanks.

(btw. a little typo: varnish forwards to nginx on port 90 -> should be port 91)</comment>


Ask HN: Do you maintain two laptops for work and life? - <AUTHOR> I've been running my business stuff from my personal laptop. Moving forward I was by default going to get a second laptop: I've had a work laptop" at all my "real" jobs before. But is there any particular benefit? (everything important is on a server somewhere) What do you guys do? <comment><USER2> If your work laptop is issued by your company and you work on side projects whose IP you want to continue to fully own, you need a separate home device. Surely you don't want your employer to have ownership over your personal emails? Your contract may even have policies that when read closely or interpreted conservatively prohibit doing things like social media browsing, gaming, or online shopping on your work computer.

Even if you're founding your own startup, keeping IP separate can be worthwhile from a legal and governance perspective.

I find it can also help with getting into work vs relaxation mindsets to configure the UIs a little differently to create a sense of boundaries between the two.

</comment><comment><USER3> One thing to keep in mind if you use one laptop/phone, if there is ever a case / investigation against your employer your personal device might be called in.

</comment><comment><USER4> I think it is highly dependent on the work you do.

If your two lifestyles are developer (work), and gamer (leisure), then purchasing 2 workstations to accommodate that could be prohibitively expensive.

However, if you're a developer by day, and say, love to work on your house at night, having a decent development workstation, and a simpler pc for browsing ideas and sketching things out, I would imagine that could be beneficial.

It's all about reviewing the situation that you're in, and seeing what fits your income and organizational needs.

Personally, I switched to a single laptop for everything. I purchased a laptop powerful enough to run WoW in the most vigorous situations, and something that maintains a semi-regular keyboard layout and proper specs to build small to medium sized applications.

</comment><comment><USER5> One laptop, but I VPN -> Remote Desktop into a work PC and keep work stuff isolated there. This works fine for development/Microsoft Office/etc. It may not work for all industries though.

The biggest downside is that it assumes a data connection, but given the development I'm typically involved in that is largely unavoidable regardless.

I do try to keep the Remote Desktop host clean of work files on purpose, in case it is lost, I quit, the machine dies, or I want to use a different machine on a whim. As long as I have my physical 2F key and a Cisco Anyconnect client I can work from any machine.

</comment><comment><USER6> Separate. On my personal laptop(s) I can do whatever I want. On my work laptop, things are somewhat locked down. Even if it was not locked down, keeping things separate is just a good idea. It's cleaner.

</comment><comment><USER7> I use my work laptop because I have an iMac with a huge screen at home where I do most of my personal stuff (personal dev, licensed software I use outside of work, accounting, storage, etc)... I end up having to synch both machines anyway when I'm on the go since I only have one laptop. Most of that synch comes from the cloud anyway. The benefit of having one single laptop is that you can switch contexts when you're traveling, etc. You can connect with work while doing your personal stuff. The iMac is where I store all my personal files like photos, etc.

If you need a second machine for personal stuff I'd highly recommend a larger screen. A desktop machine seems to be a great add-on to your life.

<comment><USER8> The larger screen and compute too! I used a MacBook for the last 5 years but after switching to a 24 core, 64gb RAM desktop I'm never going back... the extra horsepower makes my ide, debugging and startup times buttery smooth ...

</comment></comment><comment><USER9> Virtual machines for work. One per client, never cross the beams. Host OS is for own stuff.

<comment><USER10> Here too, all on ultraportable laptop docked to large screen.

</comment></comment><comment><USER11> Its better to have separate laptop for your day job and your business. You can use a virtual machine on your day job laptop and back up your VM on your hard drive.

</comment><comment><USER12> I do as of a couple a weeks ago.

Benefits as far as I can tell: mental compartmentalization (this is big; I wish I could write this in 24-pt red Impact font), makes writing off the laptop simple rather than having to estimate personal vs. business use.

Downsides: Travelling with two laptops is going to be annoying, expensive if you're paying for the laptops out of pocket.

This situation was kind of an accident for me, but I like it, enough that I might go to the trouble of maintaining it.

</comment><comment><USER13> if you are an employee, then for love of god, dont cheap out and buy another laptop for your personal work / side project. My roommate who used to use company laptop as a personal one, had to go through a lot of legal hurdles when he moved to a different company.

<comment><AUTHOR> I am currently, but this is more for the post-employment universe :)

</comment></comment><comment><USER14> if you're working as an employee then i'd recommend isolating as many devices and accounts as feasible. share nothing between work and non-work.

if you're working for your own business and there's any chance you might like to sell the business to someone else in future, it might also be a good idea to think about how to decouple the business from the rest of your life. (perhaps less value in isolating laptops than isolating bank accounts, credit cards, email addresses, *aas accounts, etc)

</comment><comment><USER15> Separate. Work laptops and personal laptops. A better work/life balance is a benefit. It helps you focus when there's less distractions on your laptops, it also looks more professional.

</comment><comment><USER16> Dual-boot.</comment>


Ask HN: New OSS Projects: Go or Java? - <AUTHOR> I'm thinking of working on building something new and open sourcing it. I know java really well so my first choice is to build it in java (pure java - no J2EE or other bloat) but Go also looks like a great alternative. Plus I'll have an excuse to learn Go.
Since I'm hoping others in the community will want to contribute, I thought I'd ask here before making a decision.
What do folks think - should I build it in Java or Go? Would you prefer to contribute to a Java or a Go codebase? <comment><USER2> I think you should decide what your single most important goal is:

1) launch a project

2) learn a language

Learning a new language will derail your project completion and launch indefinitely, often permanently.

<comment><AUTHOR> This is actually a great point.

<comment><USER3> Totally. IMO it's equivalent to deciding whether to write a book in your native language or in another language you don't speak because they have more words in the domain of the book's topic.

<comment><USER4> You wrote this in English? What kind of comment-writer are you? English has so many spelling inconsistencies and homonyms it's a wonder that anyone can understand anyone else. Everyone knows that real authors write in Spanish. Neruda, Borges, Márquez. Spanish's clear pronunciation rules, elegant conjugations, and separation of mutable state (`estar`) from immutable state (`ser`) ensure you'll never run into any dangerous misunderstandings. Consider this sentence:

        "¡Hola, mundo!"

Note that the sentence is one character shorter than the corresponding phrase in english (`"Hello, world!"`) - this kind of efficiency is quite common when you write in Spanish. Also note that the extra space won by removing a character was then used to add a pre-exclamation flag (`¡`). This flag is a neat optimization to ensure that the interpreter knows to prepare for an exclamation ahead of time.

Better interpretation, pronunciation, efficiency. Why are you not writing Spanish today?

</comment></comment></comment></comment><comment><USER5> > What do folks think - should I build it in Java or Go?

There is an old quote that when people ask for advice you should carefully figure out what they want to hear and then tell them that.

In this case even more so: if you are starting an open source project I'd strongly recommend optimizing for long-term motivation. Whatever that means in this case I'm afraid I cannot tell.

> Would you prefer to contribute to a Java or a Go codebase?

I personally would have a way simpler time contributing to a Java project than a Golang project.

</comment><comment><USER6> I was wrestling with the same question a few months ago and ended up choosing Scala! I got to learn something new but could still fall back to things I liked about Java.

</comment><comment><USER7> The most important thing is to use the right tool for the right job. If the project has networking and doesn't involve building a GUI or graphics, then Go is a great choice. (Not that Go can't do GUIs or graphics, but there aren't very robust and mature libraries for those things yet).

<comment><USER8> Does Go do networking better than Java?

<comment><USER9> Go's standard library is pretty nice.

<comment><USER8> I know that Java's standard library is very complete. I know very little about Go's, but I presume that it's not more complete than Java's. Is Go's library easier to use than Java's? Is it _significantly_ easier?

<comment><USER10> Go is through it's integrated support goroutines (green-threads) very efficient at IO, while still presenting it in a traditional fashion (like blocking IO).

Java can also be very efficient, but only provides the lower level NIO library out of the box. To use that you either have to build und understand a lot of components for yourself (e.g. an IO Reactor, timer handling, etc.) or include one of the bigger frameworks for this purpose (e.g. Netty).

</comment></comment></comment></comment></comment><comment><USER11> Get to read so much good about Go and I want to try. But then you see the syntax of Go - its plain-ugly - why ?

<comment><USER12> plain-ugly is a lot better than unclear-ugly

<comment><USER11> What qualifies as unclear-ugly ?

<comment><USER13> This:

        $,="\t"; print readlines.map{|r| s=r.split; [s[0].to_i,r]}\
        .max{|a,b| a[0]<=>b[0]}

It's a ruby one-liner that prints the largest first field and the lines that contains that field.

</comment></comment></comment></comment><comment><USER14> Between Java and Go, definitely Go. I think you'll find it surprisingly easy to learn, although a bit constraining compared to Java.

OTOH, if the project will require heavy loads you might want to consider Phoenix/Elixir. That's would be learning something truly different too.

</comment><comment><USER15> Given the scope of the question, if you are thinking about creating something useful in the OSS space, then I would clearly recommend to start with Java since you would be laying the foundation of the project in a language you know.

Otherwise pick Go.

</comment><comment><USER16> personally if I were you I would use this as an excuse to learn Scala especially as you have a Java background.

</comment><comment><USER17> What's the nature of your project? If you want people to use it and maybe create a community around it, the language might play a big role.

My impression is that Java is used by enterprise and more established sectors, whereas Go is popular with hobbyists and early adopters.

</comment><comment><USER18> I tried to start another project in Go instead of Python/Flask. I never really started.

If you want to learn, Go is a good choice. If you want to get things done, use what you already know.

</comment><comment><USER19> How about C?

</comment><comment><USER20> whether you want to ship or you want to learn more?</comment>


Why the case against Comcast-Time Warner Cable is evaporating - <AUTHOR> http://www.cnet.com/news/why-the-case-against-the-comcast-time-warner-cable-merger-is-evaporating/

<comment><USER2> The problem with this line of reasoning (essentially, we're both too small to constitute a monopoly, so we should be allowed to merge) is that if it's accepted often enough, then the last holdout will rightly complain that they can't compete with the "big boys" unless they merge with one of them.</comment>


After The Hype - <AUTHOR> http://www.avc.com/a_vc/2011/09/after-the-hype.html

<comment><USER2> _The thing to do is focus on those who remain, service them incredibly well, and start building from there. Forget about the hot app crowd. They may or may not be back. Your loyal users will._

This is consistent with what pg and Paul Buchheit say about making a small number of people extremely happy being better than having a huge number of lukewarm users. But did they come to this conclusion independently, or is it high-profile investors listening to each other?

<comment><USER3> i did not come to this point of view because of PG and PB, although I have heard them express it. i came to it watching the companies we invest in succeed and fail.

<comment><USER2> For me that's extremely valuable information. Thanks!</comment></comment></comment>


ZetaVM, my new compiler project - <AUTHOR> https://pointersgonewild.com/2017/04/29/zetavm-my-new-compiler-project/ <comment><USER2> Your mission seems to be matching with what we are trying with Graal and Truffle. The Truffle API aims to be stable as well. We also provide basic building blocks like an object model. I am curious how you plan to support speculative optimizations that need to deoptimize and reconstruct interpreter stack frames? In my experience that's essential for building high performance dynamic language implementations.

<comment><USER3> > essential for high performance dynamic language implementations

Is it? Objective-C is a dynamic language (AOT-compiled) that doesn't have these features, and it is possible to write very high performance code with it.

<comment><USER4> I don't have any numbers, but I think it's generally possible to write very high performance code in Objective C... by not using the dynamic language features of it such as message sends.

Objective C I believe does a globally cached method lookup for every message send (!) and so can't inline through message sends (!), and since inlining is the mother of all optimisations I would imagine this would severely limit performance if you tried to use a lot of message sends in your inner loops. We should actually think about doing that experiment to see what the cost would be.

In a language like Ruby almost all operators, even basic arithmetic, are dynamic method calls, so you can't avoid using message sends anywhere. I think if you tried to do that in Objective C things might grind to a halt.

Objective C also lacks many dynamic language features which are the ones solved through speculative optimisation, such as integer overflow, access to frames as objects, and so on.

I'm not an expert on Object C though so happy to be corrected.

<comment><USER3> > I don't have any numbers

I do :-) Wrote about a book about it, in fact.

> but I think it's generally possible to write very high performance code in > Objective C... by not using the dynamic language features of it such as > message sends.

Yes, that's a common misconception...with a grain of truth. In my experience, you get the best performance by judiciously mixing dynamic and static features. And yes, that means eschewing some dynamic features in some inner loops (The 97:3 rule applies). However, you can also often gain significant performance by hiding behind a polymorphic dispatch.

For example, I reimplemented Apple's binary plist parsers+generators in Objective-C (from C) for a significant speed boost: the polymorphic implementation allowed me to put in override points for things such as lazy loading, and interface-based (de-)serialization removes the need for a generic intermediate representation. Compared to those advantages, the cost of message-sends is negligible (and optimizable if it becomes a problem).

> Objective C I believe does a globally cached method lookup for every message > send(!)

Yes. It's quite fast and despite what people fret about rarely a problem.

> and so can't inline through message sends (!),

If it does become a problem (measure, measure, measure!), there are techniques to avoid the lookup: IMP-cache, convert to C function call, convert to inline function, convert to Macro.

> since inlining is the mother of all optimisations

Hmm...the mother of all optimizations is measuring and removing unnecessary code. Then comes eliminating/reducing and "sequentializing" memory access.

Very few of these can be automated.

Inlining is nice, too.

<comment><USER4> Thanks for that extra info.

How do you think Objective C would perform if every operator was a dynamic method call as it is in Ruby? Surely then you'd start to get frustrated with the overhead? That's why languages like Ruby need the speculative optimisations.

<comment><USER3> > How do you think Objective C would perform if every operator was a dynamic > method call as it is in Ruby?

Depends very much on what you mean with "every": the 97:3 rule applies, and is almost certainly even more highly skewed today[1]. So for the vast majority of code, it wouldn't matter. Correction: _doesn 't_ matter. For example, Apple's Swift language produces code that is incredibly slow when non-optimized, loops and the like can easily be 1000x (a thousand times!) slower than optimized, and yet Xcode's debug builds default to non-optimized and people don't report that their debug builds are unusable.

Another example: I implemented the central re-pagination loop in my BookLightning imposition app[2] in my Objective-Smalltalk language[3], which currently has just about the slowest implementation imaginable (an AST-walker inefficiently implemented in Objective-C), at least an order of magnitude slower than Ruby. Despite that, BookLightning is at least an order of magnitude faster than the OS-X print system, which is largely written in C. Why? It computes by page (which is sufficient for this task), rather than by individual PDF graphical element. That difference is so great that the steering code controlling the computation just doesn't matter.

> Surely then you'd start to get frustrated with the overhead?

As long as Objective-C were still a hybrid language: probably not, because I could always eliminate the overhead in the (very) few places that mattered, and could do so reliably/predictably [4]. In fact, for Objective-Smalltalk I am very much leaning towards that approach (Smalltalk-ish by default, optimizations optional), and so far things are looking good.

> That's why languages like Ruby need the speculative optimisations.

Or C libraries, which is what I believe high performance Ruby code does.

p.s.: I think Truffle and Graal are awesome, and as a researcher I wish I'd come up with them. When doing actual practical performance work, I prefer simpler and more predictable tech.

[1] "The Death of Optimizing Compilers" [http://cr.yp.to/talks/2015%2E04%2E16/slides- djb-20150416-a4....](http://cr.yp.to/talks/2015%2E04%2E16/slides- djb-20150416-a4.pdf)

[2] [http://www.metaobject.com/Products/](http://www.metaobject.com/Products/)

[3] [http://objective.st/](http://objective.st/)

[4] [http://blog.metaobject.com/2015/10/jitterdammerung.html](http://blog.metaobject.com/2015/10/jitterdammerung.html)

<comment><USER4> But going back to the original argument that was being made - you say that you don't need speculative optimisations to make something like Objective C fast. But you say to do that you don't use the dynamic features where you need performance - use macros and C functions instead.

So yes you don't need speculative optimisations... as long as you apply similar optimisations manually in the source code yourself. I'm not convinced therefore :)

<comment><USER3> > you don't need speculative optimisations to make something like Objective C > fast.

There is a difference between "make X fast" and "write fast code in X", a distinction that is hugely important in practice.

So no, I don't need speculative optimization to write fast code in Objectice-C, but I would need speculative optimization to make Objective-C code fast [without touching the Objective-C source code].

> But you say to do that you don't use the dynamic features where you need > performance

No, I did not say that at all. I said I mix dynamic features and non-dynamic features where necessary, and that I need both to make things fast. And (more importantly), that the most important optimizations have nothing to do with either (which counters the assertion that inlining is "the mother of all optimizations").

> So yes you don't need speculative optimisations... as long as you apply > similar optimisations manually in the source code yourself.

The point being that (a) those optimizations are such a small part of the overall optimization process, which in turn is applied to such a tiny part of the overall code-base, that automation is not needed. Which invalidates the assertion that these optimizations are "necessary". Nice to have? Yes. Necessary? No.

The other point (b) is that optimizations by the compiler/JIT aren't as good as those applied manually for many reasons, one being that the compiler/JIT has to make the transformations indistinguishable at a fairly low-level, whereas the author has a higher-level overview and can adjust the semantics to fit. So doing it manually is also worth it.

The third point is that I cannot rely on the compiler/JIT making those optimizations, there is no guarantee that they will be applied. And with today's performance landscape being what it is, reliability is paramount, meaning that being able to guarantee even a slightly higher bound is more important than meeting a lower bound some of the time or even on average.

> I'm not convinced therefore :)

As long as I am _capable_ of applying those optimizations manually, I have made my original point which is that having these optimizations done automatically is not necessary for performance, but at best "nice to have". Which doesn't mean that more compiler support wouldn't be nice, the process in Objective-C is too ad-hoc.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER5> I'm wondering how different languages implemented on top of this VM could be, especially at the semantic level.

Having different syntaxes on top of the same VM is nice and all the JVM languages show that there is room for a good variety and for different paradigms.

On the other hand, the choice of a VM sets some constraints while providing important features. Think for instance at the differences between the languages running on the JVM and the languages running on the BEAM (Erlang's VM).

I think there is a lot of untapped potential for innovative ideas at the VM- level but for some reason most of the effort goes into proposing new syntaxes that reuse the same concepts all the other languages are using.

<comment><USER6> I have been playing with toy languages for the guile VM, and you can do quite a lot of things before the VM limits you much.

With some exceptions though: Java VM does not support tail call optimization, which limits how you implement loop constructs.

</comment></comment><comment><USER7> How does this project compare to nekovm? Sounds very similar.

<comment><USER8> Not familiar with Neko, but superficially, it seems that VM is designed for a specific programming language. It uses a bytecode IR whereas Zeta uses a textual one. Neko is also farther along, more mature and feature complete than Zeta.

I intend to take a more experimental direction with Zeta. It won't have an FFI, for instance. It will only provide a small set of minimalist APIs. The VM will be intentionally designed to avoid code rot and breaking changes.

Another thing I would like to experiment with is transparent compilation of pixel shaders to run on GPUs, the ability to run code in any language running on Zeta (given some restrictions) on both the CPU and GPU. I believe I have found a way to make this work, based on my type-specialization research.

<comment><USER9> Hmm, I haven't heard this idea before that the FFI or surface area of libraries in a language causes bitrot. Could you elaborate on the connection? I can take version 1 of the C sources of Vim from back in '92 and compile them without trouble. I'm not aware of dynamic languages like Javascript or Python 2 having any bitrot issues either. Backwards compatibility seems like a pretty big constraint for everyone.

 _Edit 16 minutes later_ : I just tried your benchmark with my VM-like language ([https://github.com/akkartik/mu](https://github.com/akkartik/mu)), and the time taken was almost identical. Interesting exercise! Here's the Mu and Plush/0 programs side by side:

      $ cat fib.mu
      def fib n:num -> result:num [
        local-scope
        load-ingredients
        base-case?:bool <- lesser-or-equal n, 1
        return-if base-case?, n
        n <- subtract n, 1
        fib-n-1:num <- fib n
        n <- subtract n, 1
        fib-n-2:num <- fib n
        result <- add fib-n-1, fib-n-2
      ]

      def main [
        local-scope
        x:num <- fib 29
        $print x, 10/newline
      ]

      $ cat benchmarks/fib29.pls
      #language "lang/plush/0"
      var fib = function (n)
      {
          if (n < 2)
              return n;
          return fib(n-1) + fib(n-2);
      };
      var r = fib(29);
      print(r);

<comment><USER8> C has been fairly stable across time, but you gave to admit, a C program from 1992 still compiling as-is, that's an exception rather than the rule. The reason Vim from 1992 might still compile is actually because it doesn't have that much dependencies apart from standard C and POSIX APIs.

JavaScript has massive bitrot issues. The HTML DOM is huge and constantly changing. I have had my own web apps break multiple times over the years. As for Python and C, if you stick to the core language, and minimize dependencies, you might be Ok. The problem is that the more dependencies you have, if any one of them break, they can render your program broken... And if you're not there to fix it, your program remains broken forever.

My argument for reducing API surface and keeping APIs low-level and minimalist is that the smaller an API, the more difficult it is to implement it wrong. It's easier for two implementations to implement a smaller API and have the same behavior. It's also easier to test small APIs for conformance, etc.

<comment><USER9> I think I see what you mean. However, all these previous languages would claim that the parts they control have not suffered from bitrot. The dependencies you're thinking of are not considered part of the language in each case. Is that right? How would you keep people from creating new libraries in your language for unanticipated use cases? Say a self-driving car library, or a command-and-control module for all the IoT devices in a house from 2029?

It seems to me that bitrot is fundamentally a result of change in the outside world. The only way to opt out of bitrot when the world changes rapidly seems to be to disengage from the world and become irrelevant. I'm fairly certain Mu will not suffer from bitrot in 30 years -- but it'll only be because nobody ever built anything with it :)

<comment><USER10> I have come to the same conclusion as tachyonbeam, it is interaction with the outside world that causes bitrot. Rather than have APIs, we need communication protocol with simple semantics. The VM should interact over a constrained, well defined protocol, that protocol could implement a POSIX io model, but that would be up to the client to offer that abstraction over messages.

The surface area of POSIX is too high to build systems that can run for 10s or hundreds of years. Look at the design of Lua over Python. The assumptions it makes of the underlying platform are much much cleaner, thus it is more portable and easier to debug platform issues.

<comment><USER9> Interesting. Can you show an example of how Lua's interface to the underlying platform improves on Python? Doesn't replacing APIs with protocols merely shift the breakage to higher-level logical errors rather than lower-level mechanical ones?

<comment><USER10> Lua is under-coupled with the base system. For the longest time it wouldn't even support dynamically loaded modules because it wasn't portable. It wasn't part of C89.

So when one uses Lua, it is up to the user to supply IO. This threading through the needle or hour-glass allows the users (embedder) to define how the scripts interact with the base system. This makes them more resilient over time, the interactions are better specified and highly mediated.

Somewhat analogous to the library vs framework dichotomy. Libraries survive better than frameworks do.

<comment><USER9> Fascinating! Seems to have some commonality with dependency injection, which is one of my interests ([https://github.com/akkartik/mu#readme](https://github.com/akkartik/mu#readme))

Can you point me at any Lua docs where I can read more about overriding IO in Lua?

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER11> +1 for the amazing domain name

</comment><comment><USER12> Why do you need Tag member in the Word union?

<comment><USER8> Author here: sometimes you want to get the tag of a value, and operate on that tag as a value, but I guess this may not be necessary in this system, given that the get_tag instruction will produce an immutable string.

EDIT: removed it. It was probably left over from old code, previous VM's I've written: [https://github.com/maximecb/zetavm/commit/7ef746f06113530468...](https://github.com/maximecb/zetavm/commit/7ef746f061135304684c5029820631a688c399fa)</comment></comment>


Nuand abusing the term "Open Source" for non-free Software - <AUTHOR> http://laforge.gnumonks.org/blog/20160601-nuand-adsb-not-open-source/ <comment><USER2> I looked at the post by Nuand, and it doesn't say "open source", it just says "we are releasing the source". Maybe they've fix the post not to say "open source".</comment>


Show HN: Generate hard-to-crack passwords for easy to remember patterns. - <AUTHOR> http://firewordgen.herokuapp.com/ Ok. Don't be angry. I am just starting out with writing code that someone other than me see. <comment><AUTHOR> Ok. Don't be angry on me. I am just starting out with writing code that someone other than me see.</comment>