Ask HN: Self-host a blog securely – how? (WP? Staticgen?) - <AUTHOR> I have some material for a tech blog I'd like to put someplace.
I'd like to self-host it, but sometimes the part of the drive that enables creativity contradicts / is interfered with by the part of the brain that is required for technical planning, even something as minor as a tech blog setup.
At least for me.
I'm thinking I host a WordPress instance privately, at home, and I use a staticgen system (Pelican??) to export and push that out to a STATIC public site on a VPS I control.  It still feels like a lot of work though.
I'm a systems guy and I'd like the WYSIWYG-type platform on which I can focus on ideas and post my blog without worrying about security, hosting, etc.  And it needs to be at least somewhat pretty, with a discus or other commentary plugin at the bottom and ability to show pretty screenshots.
Has anyone experimented with Wordpress -> Pelican or is there something better?
If I spend too much time hacking away at edge conditions, then that's less time I get for creativity.
Any ideas would be appreciated. <comment><USER2> We are using SimplyStatic ([https://wordpress.org/plugins/simply- static/](https://wordpress.org/plugins/simply-static/)) for genrating a static site from WordPress. It has many options which make genrating and deplying a static site with WordPress easy.

If you want to host site on S3 you can use the fork of Simply Static [https://github.com/kennu/simply-static-s3](https://github.com/kennu/simply- static-s3)

<comment><AUTHOR> Wow, I think this has the most potential. I'm a fan of simplicity. I downloaded a theme, made a few edits and ran this plugin, and so far so good as a POC.

This is faster than having to learn Pelican and even those other systems which might also be great, but a bit heavy weight for my purposes.

Thank you, this might be the solution I was looking for.

</comment></comment><comment><USER3> > I'm thinking I host a WordPress instance privately, at home, and I use a > staticgen system (Pelican??) to export and push that out to a STATIC public > site on a VPS I control. It still feels like a lot of work though.

What is the purpose of this exercise? Blogging or learning WP->static page migration path? If your purpose is blogging and you have no interest in admin and revenue generation, just host on WordPress.com. If you want more flexibility, just self-host WordPress.

Why make it more complicated by adding another path of WP->Static Pages?

<comment><AUTHOR> _Why make it more complicated by adding another path of WP- >Static Pages?_

WordPress can pretty insecure if not micromanaged. It's often a vector for hacks, and requires meticulous updating.

<comment><AUTHOR> Here is some support for the claim that WordPress is insecure:

[https://www.wordfence.com/blog/2016/03/attackers-gain- access...](https://www.wordfence.com/blog/2016/03/attackers-gain-access- wordpress-sites/)

</comment></comment></comment><comment><USER4> Hugo with Discus will do the job you're looking to complete: it's the approach I've taken with nearly all my sites these days, precisely because of the performance and security headaches.

You don't even need to run a VPS, although if you do so you can set up a nice publication pipeline with Git. But you can equally just throw the static content up on S3 or Google Cloud Storage, optionally with a CDN in front of it.

You can also run your blog on Gitlab if you feel inclined: they have a CI process meaning that when you commit new source content to your git repo, it'll automatically get built and appear on your site. I found the domain support a little flaky there when I tried it, but apparently they've updated their setup since then.

</comment><comment><USER5> Just use Caddy server with built in Hugo generator (you can choose it as an option when you download)

</comment><comment><USER6> I am hosting a whole webshop about developer stickers(WallOfStickers.com) on a static web page.

Simply put your file in an S3 bucket and point the name server.

If you need a httpS connection (and I needed to take payments) simply use cloudfront and you are set.

</comment><comment><USER7> FWIW, I hand coded my first blog, moved it to self hosted Word Press to try to focus more on content, less on the back end stuff and later moved to BlogSpot. I have been much more satisfied with BlogSpot.

They also have very recently released new themes.

</comment><comment><USER8> Ghost is great

</comment><comment><USER9> Jekyll + Netlify (CMS) and hosting.

</comment><comment><USER10> Why self-host?

<comment><USER11> With Ghost specifically it's because they charge way too much for the hosted service. $29/month ($19/month with annual commitment) for a blog is not worth it to me. If they offered a $5–10/month plan, I would probably use them over self-hosting.</comment></comment>


Why (and how) I pay for Netflix outside the US - <AUTHOR> http://micho.biz/access-netflix-from-outside-america/

<comment><USER2> You might look into running openvpn on your slicehost. If you use an ssh tunnel and then watch netflix, you'll be tunnelling UDP packets using TCP packets. TCP windowing can make your connection decidedly sub-optimal.

Openvpn also has nice windows and OSX gui clients so you don't have to monkey with SSH and socks proxies every time you want to invoke the setup.</comment>


Tablets are waiting for their Movable Type - <AUTHOR> http://37signals.com/svn/posts/3334-tablets-are-waiting-for-their-movable-type

<comment><USER2> Tablets already have their Movable Type. It's called... Movable Type. I understand that the current fad is to go back to native, from HTML5, but for very content-centric app (i.e. one designed to make text easy to read), it makes sense to write it as a webapp. You're not transferring massive amounts of data. You're not dealing with the same level of interactivity requirements as, say, a game. Your job is to display text in a clear, easy-to-read fashion. I think this is something that mobile browsers can already do quite well. There's no reason to reinvent the wheel with a native app, when we can build on Movable Type (or some other blogging platform) to make it more mobile friendly.

<comment><USER3> I agree with this in almost every regard. I really don't like the drift towards sandboxed apps where HTML will do just as (or more) nicely.

But: money.

Solve subscriptions. This is what the apps do. Adobe DPS, which I mention below, is so totally geared to creating _paid_ subscription content.

The Readability fiasco was unfortunate since I'd like to see other non-ad based approaches to paying open content publishers/creators. Unfortunately, no one on the vested interest side of the fence (including Apple) has any real motivation to solve for this.

<comment><USER2> I don't see how apps solve subscription any more than a (paid-access) website. In fact, thanks to Apple's draconian 30% cut of all in-app purchases, it can be argued that apps are _worse_ , when it comes to subscriptions. At least when you're serving content through the browser you're not automatically losing 30% of your revenue.

<comment><USER4> 1 tap (or 2) purchasing and lots of accounts with credit cards attached

</comment></comment></comment></comment><comment><USER3> Actually, to publish a magazine style app you don't need to be very technically capable. Adobe Digital Publishing Suite is a surprisingly capable tool and can spit out newsstand/iOS compliant apps. A lot of large/legacy publishers with teams used to an InDesign workflow use it.

<http://blogs.adobe.com/creativecloud/dpsse/>

It can be clunky in places and I've seen terrible magazine apps created with it, but that can be said for native apps as well. There is the Adobe creative cloud price to factor in, but if you are doing anything with creative cloud already, you have access to this.

As for actually getting into the actual iOS _newsstand_ as a magazine, that I'm not clear about. I have the impression that Apple has tight relationships with legacy magazine publishers and gives them priority.

<comment><USER5> DPS pricing is ridiculous. Completely untenable for small publishers. Not only do you have to pay to use the software, you have to pay to publish each issue with them, and then pay when someone re-downloads a file, which happens often because Newsstand is built that way. You don't control your code, and you can't take your magazine anywhere else without re-creating it. If you ask me, its a steaming pile of dung. If you're a small publisher, I ask that you please take a look at Baker, an open source framework for publishing magazines on the iPad. We use it (but are not the people behind it) and we love it. The newest version supports free Newsstand apps.

<comment><USER3> It used to be ridiculous. It's now downgraded to merely comical. I'd check out the link above, but my understanding is that you don't have to pay to publish an _app_. You might be referring to just publishing strictly to the newstand, though. In that case there are both "multi-folio" and "single-folio" options.

I think the bigger issue, besides pricing, is content lock-in, as you note. I've seen some other systems (not Baker, I'll check that out) that offer "free" app wrappers for magazine style content but tightly control the creation process as a lock in mechanism (and I'm not _even_ referring to Apple here).

Curious: are you actually publishing to newsstand or standard apps? I'm wondering what the barrier to entry to the newsstand is in terms of approval vs. apps. At least with ebooks, it gets weird quickly on Apple's end (long long approval times for independent publishers unless you go through an "approved" broker, etc.).

<comment><USER5> Newsstand apps use the same approval process as regular apps, there are no barriers to entry except figuring out how to code for Newsstand. Once you go Newsstand your "content" no longer needs to go through any Apple approval process. You just publish content any time you like, and a Newsstand App updates automatically. The only thing that needs to be approved is changes to your code. Overall though, Newsstand is not very well explained in Apple's documentation, and paid subscriptions are a mess.

We publish a standard app at the moment, because Baker did not support Newsstand until a short time ago. We will be updating in the next week or so.

DPS pricing is still bad. Single edition only gets you one issue. One freaking issue! You need to upgrade to professional ($495 per month!) or above to publish multiple issues, and then pay $.30 every time someone downloads one of your issues. Compare that to setting up Baker (free) and setting up Amazon S3 free account (15GB data out per month) and DPS looks like a total scam.

</comment></comment></comment></comment><comment><USER6> Considering the recent publishing-related posts coming out of 37s, along with Jason's teasing announcement of a new product (and their history of building up hype leading up to a product launch), I put good money that their product will be a publishing app/service.

<comment><USER7> This. The idea is so good I was ready to "drop everything and do it" but I can smell from the post that 37s is about to release the service they're asking for and would blow me out of the water.

<comment><USER8> Not really. Their last product (sortfolio) did not really do that well:

<http://37signals.com/svn/posts/3196-sortfolio-lives>

They do have a good reach and that will definitely help them, but the tablet market is now big enough for multiple players.

</comment></comment></comment><comment><USER9> If you publish through Kindle it works everywhere, you don't have to do anything but upload a Word or HTML document, and you get paid regularly.

</comment><comment><USER10> I recently researched tools that are designed to help people make book or magazine apps (mobile apps). There are many options. I decided to share my findings here:

[http://www.mobilechameleon.com/toolkits-to-develop- magazine-...](http://www.mobilechameleon.com/toolkits-to-develop-magazine- apps-and-book-apps.html)

<comment><USER5> Please add a link the Baker Framework (its not linked, but its a great resource) <http://bakerframework.com/>

<comment><USER10> Thanks! I also added Pugpig, which is similar but can also publish to Android.

<http://pugpig.com/>

</comment></comment></comment><comment><USER11> Everyone had a web browser. Not that many people have access to the Apple store thing. Maybe if it was more universal.

</comment><comment><USER12> RSS didn't fail because it was too nerdy, it was systematically shunned because it has no DRM.

Systems like newsstand and Google currents seem nice because of their ui/ux, but that's only because its so hard to compete with such giants that have relationships with giant content creators who want surgical grade DRM.

<comment><USER13> people are rediscovering RSS , what people need is good RSS reader softwares, not the usual crap out there , people need to understand things like ping- backs , get a server somewhere and they will never need facebook or twitter anymore.

</comment></comment><comment><USER14> Baker Project is so far the closest I've seen.

<comment><USER5> This is what we use and we love it. The guys behind it do a lot of hard work and the newest version supports free Newsstand subscriptions. <https://github.com/simbul/baker>

</comment></comment><comment><USER15> This is a conflation of the idea of a desire to publish, with the theory that that publishing must be de facto available on any platform in it's native format. In the same way that we don't need desktop apps for reading a blog, or a website, or anything else, we don't need a tablet or phone app either.

In this case, a website works perfectly well, with the advantages of being searchable and sharable in far more granular and broader formats than an app, thanks to the likes of Google, likes/retweets etc.

<comment><USER16> > _This is a conflation of the idea of a desire to publish, with the theory > that that publishing must be de facto available on any platform in it's > native format._

No, it's a conflation of the desire to publish with the desire to target the best electronic devices for reading (tablets), with the best format for _each_ platform (native), with easy 1-click access to monetization (already stored credit cards and people known to buy things).

None of the above are solved by a website.

And much less it solves stuff like background updates, large volumes of data and pictures being readable offline, etc.

</comment></comment><comment><USER17> Glad to see two big dogs from 37Signals calling for this a day apart from each other. www.pen.fm is actually moving straight into this direction as a platform to allow self-publishing of all sorts of mediums. Super-clean and perfect conversion is a hassle, but if we can track/mark each component to begin, everything regarding styles and rendering becomes so much easier to control. Currently we're on stories and going into manuals, but I can see magazines being the next hit. :)

</comment><comment><USER18> What would such an app provide, compared to a normal ebook? I guess the point is simply to be able to get paid via the app store? If so, it seems the wrong solution to me, the app store should change instead of people having to create clunky, temporary workarounds.

</comment><comment><USER7> Google Currents?

</comment><comment><AUTHOR> The only problem here is the review process, you probably can sell customized binaries, but still have to wait</comment>


Chinese company uses leaked photos to copy, patent iPhone 5 design - <AUTHOR> http://www.bgr.com/2012/09/05/iphone-5-design-copied-patented-goophone-i5/ <comment><USER2> I would not say this for any other company, but Apple somewhat deserves it.

<comment><USER3> For re-inventing the smartphone back in 2007 and for not wanting others to clone the best features?

<comment><USER4> Innovation and inspiration, patented by Braun [1], errr, I mean Apple.

[1] <http://visual.ly/braun-or-apple>

<comment><USER5> A false comparison that was debunked some time ago, even by the Braun lead designer: "I have always regarded Apple products — and the kind words Jony Ive has said about me and my work — as a compliment. Without doubt there are few companies in the world that genuinely understand and practise the power of good design in their products and their businesses".

"I very much doubt there is a single designer at Apple who has felt flattered by Samsung. And, on the flip side, I doubt there is a single designer at Samsung who sees their work as homage to Apple. " <http://daringfireball.net/2012/09/homage_vs_ripoff>

<comment><USER6> The fact that Dieter Rams is flattered doesnt make it a false comparison, au contraire, it means he sees obvious "influence". Also how can daringfireball's opinion be considered an unbiased source.

<comment><USER7> Influence is not the same thing as imitation.

<comment><USER6> These lines are for courts to decide (I didn't know the braun radios myself, but the iPad and the iPhone calculator seem pretty much imitations)

In the end, depending on the financial damage at stake, some people will sue, while others may be flattered.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> Sad to see this is the top HN story. The fact that this seems to be being taken seriously here is crazy. Obviously, a patent of someone else's design, no matter how it was come by, is not a valid one.

[Decline of HN, jumping the shark, get off my lawn etc.]

<comment><USER9> I see it as the the cult of Apple's totalitarian grip on HN-discussion finally letting go.

It's already a few years past due.

<comment><USER10> When was that? Could you quote some threads from the past that display "Apple's totalitarian grip on HN-discussion"?

<comment><USER9> Sorry, but I don't feel like hunting specific threads.

I just remember back in the days (before I quit HN and then later rejoined) people would get down-voted to heck for speaking against Apple, people would get slow-banned and people would get stern emails from PG if they spoke too crossly against Apple when Apple did all the questionable things Apple constantly does.

You take my word for it or not. I think it qualifies as "cult of Apple's totalitarian grip on HN-discussion".

<comment><USER10> Ah anecdotes, the facts of the internet. I'm only 1135 days here, this must have happened before my time on HN. Wished I'd experienced the "stern emails from PG".

"You take my word for it or not."

Well, not. Sorry, too much science education to think anecdotes are relevant in any way.

<comment><USER11> So are you calling him a liar or not?

<comment><USER7> Well, josteink refused to show any evidence, so why should he be taken seriously?

<comment><USER11> That isn't what I asked. Either you think he's lying and need to call it out directly and state your reasons why, or you don't.

Difficulty: "Because he didn't provide evidence" is not proof of deception. Either what he's saying did happen, or it did not. Dismissing something as anecdotal only matters in scientific discussions about statistics, notsomuch real life. If we followed such rigorous rules for everyday discussion, nothing would ever be talked about.

<comment><USER7> >>Either you think he's lying and need to call it out directly and state your reasons why, or you don't.

False dichotomy. Lying implies the intent to deceive, which he may not have. He may simply be remembering things incorrectly, or viewing past events through a reality distortion field. This is why anecdotal evidence is utterly meaningless in discussions like this: when you are making statements about "the way things used to be" you need to provide actual evidence supporting those statements.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> Hilarious as this is, it's a bit baffling that so many people seem to think it "serves them right" when in fact it makes the perfect case for why design patents exist.

If you're the sort of person who thinks a rounded rectangle shouldn't be patentable, this should annoy you.

</comment><comment><USER13> Their fake iPhone (Goophone Y6) apparently retails for 250$ USD. <http://shop.goophone.hk/product-28.html>. I suspect the quality is pretty bad... Also, Google apps such as Maps, YouTube, etc. might not be available since they require a license from Google. I'll try to get a hand on a sample this weekend if I pass by Huaqiangbei (mostly out of curiosity).

<comment><USER14> And that one obviously does break Apples design patent. Apple could easily sue them over that.

<comment><USER15> Apple does have a design patent in China?

<comment><USER16> ...and judges to enforce it?

</comment></comment></comment></comment><comment><USER17> So they did an apple on apple itself? :) [Yes I know its extreme but Apple is a company that sued MOTOROLA inventor of cellphones with cellphone patent]

<comment><USER18> You got your facts mixed.

</comment></comment><comment><USER19> People defending GooPhone and making stupid comments about Apple? I agree Patent system's kinda broken. But if this is real, is real stupidity and height of IP theft.

<comment><USER20> How do you steal IP? Has someone broken into the patent office and rifled through the filing cabinets?

<comment><USER21> Technically it _is_ possible to steal a copyright, by falsely claiming to be the owner. I presume you could do something similar with a patent.

</comment></comment></comment><comment><USER14> On the subject of Chinese phones, check out the Mi Two.

<http://www.xiaomi.com/mi2>

Qualcomm Snapdragon S4 Pro APQ8064 Quad core, 1500 MHz, Krait Adreno 320 2GB RAM

Pretty impressive, especially for the price.

<comment><USER22> These guys are pretty well known for running a very polished custom ROM as well, MIUI.

Ran it on my devices until 4.x was (kind of, not really, in a crappy way) available. If you have an older android handset which won't receive any future upgrades: Might be worth checking out these guys.

<comment><USER23> Same here. I ran it until my device (HTC Desire Z, T-Mobile G2 in the US) was discontinued by the MIUIAndroid folks.

</comment></comment></comment><comment><USER24> [http://img03.taobaocdn.com/imgextra/i3/101108915/T2dGR5XhBXX...](http://img03.taobaocdn.com/imgextra/i3/101108915/T2dGR5XhBXXXXXXXXX_!!101108915.jpg)

The last picture on their website...

</comment><comment><USER25> Would be interesting to hear if they can ban Apple's _exports_ from China.

<comment><USER23> That would in fact be pretty devastating for Apple I believe.

<comment><USER26> Depends on how fast Foxconn builds new facilities in Vietnam.

<comment><USER27> They are already in Brazil.

</comment></comment></comment></comment><comment><USER28> As far as I know, design can't be patented. It can only be a matter of authorship and thus copyright. Apparently there seemed to be some confusion about this in the Apple vs Samsung case. Maybe it is only the media that is making such type of confusions.

The problem with China is that its legal system is told to have a strong bias in favor of Chinese companies/people.

I expect such situations might incline countries to retaliate in the same way and on similar basis instead of fixing the patent system.

<comment><USER29> There is a category of patents called "design patents".

<http://en.wikipedia.org/wiki/Design_patent>

In Apple v. Samsung, Samsung was found to infringe some of these, see e.g. [http://arstechnica.com/apple/2012/08/ban-this-apple- lists-8-...](http://arstechnica.com/apple/2012/08/ban-this-apple- lists-8-samsung-devices-it-wants-kept-out-of-the-us/)

</comment></comment><comment><USER30> LOL, the goophone website even tell consumers to avoid getting a fake goophone and to report all fakes...

</comment><comment><USER31> Maybe the best demonstration of how broken the patent system is.

<comment><USER32> Except this is the Chinese patent system, not the American one. Both systems are broken, but in entirely different (and opposite) ways.

<comment><USER33> What do you mean? Could you please highlight the attributes of the Chinese patent system?

</comment></comment></comment><comment><USER34> Seems like a slam-dunk leaked photos = prior art.

<comment><USER35> ...if only Chinese courts cared about such obtuse concepts as 'facts' and 'logic'.

<comment><USER36> What is your experience with Chinese courts regarding patent cases? Any sources?

<comment><USER35> I live in China. A friend of mine was recently assaulted in a bar. Family of the perpetrator came to the hospital with the policeman assigned to the case and pressured my friend to accept money in lieu of pressing charges. Depending on how much 'guanxi' the perpetrators family have, if he does press charges, documents and evidence may get 'lost' and my friends employer could get in trouble with the local government, lose it's license etc. Although I can't talk about patent law, I know there are really no 'laws' in the city I live in - everything is negotiable and rests on how much you can spend and what your standing is with government officials. I love living here, but China is a mafia state.

<comment><USER36> Thanks for your insights.

</comment></comment></comment></comment></comment><comment><USER37> Can anyone translate this? <http://www.goophone.hk/> \- I've noticed they mention iPhone 5 on the actual site! Also, it looks like it's Hong Kong, not China (different rules to play by)

<comment><USER38> I just got my wife (Taiwanese) to read it, and she translated the red block of text. She wasn't very clear, but it says something along the lines of:

"Beware of imitation products. The genuine goophone has a 'small bee' logo. If you see any phones with a similar design to the goophone but without the 'small bee' it is an imitation. Report counterfeit products by calling 0755-88877119"

I've been laughing for the past 5 minutes ...

<comment><USER39> And thousands of people will call to report a counterfit product with apple in it instead of the 'small bee'.

</comment></comment></comment><comment><USER40> This whole thing is a difficult issue. Who is to decide what devices look similar enough, to deserve calling it a "copy"? In principle what we do here is: we implement a neural network for object recognition, and train it to recognize a certain device. Now we run this classifier on other devices and need to settle for a confidence value which says if a device is a copy or not. But who should decide what exactly this confidence value should be?

For example, what if we decide to say that a 0.921 value means a device is a copy, and we find out that Samsungs older devices get a 0.884 confidence?

All those values are very artificial.

<comment><USER41> > _This whole thing is a difficult issue. Who is to decide what devices look > similar enough, to deserve calling it a "copy"?_

Here's a guideline: if there is a document in your company saying ("let's copy this thing") --as in Samsung's case--, it's a copy.

Or if you created your design from leaked photos of prototypes ("as in this case") --it's a copy.

For the rest, how about a "jury" (i.e impartial to both parties common people)?

<comment><USER40> Even when we directly say "We'll copy it!", it could still come out as having the classifier outputting a small confidence value. So, in my opinion this should not count. There should be a confidence value of a neural network involved.

In the case of a real copy, the classifier should have a confidence of 1.0, or be enormously close to it.

</comment></comment></comment><comment><USER42> What goes around comes around.

</comment><comment><USER43> "... the company has actually patented the knockoff design in China and is poised to sue Apple if it launches the next-generation iPhone in China later this year."

Take that, Apple!

</comment><comment><USER44> live by the sword, die by the sword ?

</comment><comment><USER45> As if Apple didn't already file the same patents. As if the leaked photos aren't already prior art.

</comment><comment><USER46> "... the company has actually patented the knockoff design in China and is poised to sue Apple if it launches the next-generation iPhone in China later this year."

Seems like the Apple vs the rest of the World patent war is taking on new heights...

</comment><comment><USER47> You better watch out for the skin deep.

The best rebuttal Apple can make to any of this, is to polish their OS and their core apps as much as possible. It's ropey software that takes the polish away from supposedly glamorous devices.

</comment><comment><USER48> I'm so tired of these stupid phone patent wars. Is there a realistic solution to this or will it just phase out and be replaced by the next rebecca black- esque tech-reporter-BS?

</comment><comment><USER49> I'll be surprised if Apple has not patented iPhone 5 in China by now, their second or third biggest market.

</comment><comment><USER50> 'First to file' FTW. /snark+depression

</comment><comment><USER51> How serious does the Chinese government actually take copyrights? =p

<comment><USER52> Copyrights well... it's like you make up some deals (in your western family) and then you go somewhere else (to the east) and ask people there to live by your deals. Because you see yourself as the One everybody must follow. And it works as long as you have a (military) might to protect your interests. BTW this is the principle how any legal system works, all over the scale from a family law to international law. And now imagine yourself loosing that might: two lost wars, economic crisis... well, deals made up by clowns have never been taken seriously.</comment></comment>


Ask HN: Client refused payment, told us to come back with lawyers - <AUTHOR>

My company performed about $12,000 worth of work for a well-known ecommerce company about 6 months ago.  They were running late with payment but told us payment was coming.
Then they stopped responding to e-mails, phone calls, you name it they ducked it.
We hired a collections agency and sent them in to pursue the matter.  The collections agency came back and said they were told that the company had been sold and the agency would have to pursue the matter with the parent company.  They would not name the parent company however and the agency apparently isn't able to figure out who the new parent company is and said they wanted a bunch more money to continue the case as it's gotten very complicated.
Anyone have any experience with this sort of situation?  It's very frustrating.  My instinct is to go complain about it publicly, but I know intellectually that won't get us our money, plus it will brand our company as whiners and losers who allowed themselves to get dicked over.
Thoughts? <comment><USER3> onceburnt: This does not constitute legal advice, I am not representing you, and you are advised to consult a lawyer licensed to practice in your jurisdiction regarding this matter.

However, as a matter of general experience, I can tell you that, generally speaking, a company cannot rid itself of its obligations (liabilities) simply by selling itself to another company. Things like the type of entity of the debtor company (was it a corporation? a partnership? a sole proprietorship?) may determine who ultimately has to foot the bill, as well as the structure of the sale (e.g. the acquiror may have merged the target company into itself, which generally means it assumes the target company's liabilities; or the acquiror may have purchased only the target company's assets, leaving the liabilities behind with the company). These are questions your lawyer can help you figure out.

Independently of the question of liability, however, when a creditor has sufficient evidence to establish that it is owed a debt by someone, the burden generally shifts to that someone (to the alleged debtor) to show that he's free and clear of debt.

Bottomline: I would consult an attorney, and show him your correspondences with the company, including the correspondences with the purported acquiror. He will then decide against whom you should pursue your claim.

</comment><comment><USER4> This comes up all the time on HN & I post this link:

[http://vimeo.com/22053820](http://vimeo.com/22053820) \- Mike Monteiro - <USER2> you, pay me!

You're probably gonna take it on the chin, but here are a couple options:

You can get around half through small claims courts, which won't cost you a lot.

Find a sole proprietor attorney, preferably a young one, and see if they'll take it on contingency.

Let the company know you'll be hitting their DnB and then do it. Same with the BBB, trade organizations, etc.

</comment><comment><USER5> You client didn't give you bad advice at all. Retain counsel and file a lawsuit if you must.

This is exactly why the judicial system exits -- as alternative to shooting up your enemy's village for example.

</comment><comment><USER6> Here's the only useful answer you're going to get: "Get a lawyer."

</comment><comment><USER7> First question is, did you have a Contract? Secondly, surely there is paper trail if the e-commerce company was sold? In the UK for instance, all companies details are on publicly accessible register (Companies House), surely its the same in the USA (not 100% sure how it works in the states)? Either way, sounds like best to speak to a lawyer.

Edited to add: Having a non paying client is a problem that will affect most freelance developers at some point. It won't appear as whining but best not to name and shame. It could prejudice your case if you go to court. Speak to a lawyer.

<comment><USER8> I think you meant "Do you have a paper contract?". In the US a verbal contract is perfectly legal, although in court you'll get into more "he said/she said" type situations, so it's always best to get things in writing. Having an attorney is always great advice.

<comment><USER9> In the United States, a verbal contract is valid up to a contract value of $500.

If someone tells you they'll give you a $10,000 to do or say something ridiculous (eat a week old pizza, drink milk through your nose, etc), you can't sue them when they don't deliver; They aren't on the hook for $10,000.

<comment><USER10> > In the United States, a verbal contract is valid up to a contract value of > $500.

This depends on both what the payment is for, and which US jurisdiction's law binds. There are circumstances in California, e.g., for which there is a $5,000 limit -- and circumstances for which there is a $100,000 limit.

Which is one reason why you should go to a lawyer.

</comment></comment></comment></comment><comment><USER11> 1\. Get a lawyer. 2\. Get a lawyer. 3\. I'm not a lawyer. 4\. Always have a bargaining chip

Unless you have something in place, it's probably not worth much a legal action. Maybe some threatening phone calls, and letters from a lawyer. If they are BIG they will attempt to drive you to the ground.

Watch the video posted from Mule Design and take this as a hard lesson learned.

</comment><comment><USER12> Use an attorney, there is no other viable option. Consider 10-30% of your 12k as a collection fee and pay the attorney. At best they respond to a single letter from the attorney and pay, at worse you wind up paying about 40% of the money owed to the attorney. If the attorney asks for more than that find someone else.

</comment><comment><USER13> As everyone else has said, use your lawyer.

Secondly get on with working with your paying clients and spend the least amount of time as you can in debt recovery. Let your lawyer defend your T's & C's, (hopefully they also wrote them for you) so you don't turn a 12k loss into a 24k loss.

</comment><comment><USER14> Best case: You get a lawyer for something like $250/hr and hopefully your case is clear enough that the lawyer can send a few simple "nastygrams" in a couple hours worth of billings. The company comes back with either full or partial payment and you move on.

</comment><comment><USER15> I'm sorry I can't offer you a solution. However, I'd like to suggest you do _not_ do something like this => [http://nycfreshmarket.com/](http://nycfreshmarket.com/)</comment>


Go 1.11 Beta 1 is released - <AUTHOR> https://groups.google.com/forum/#!msg/golang-nuts/vpVOVVMLa08/oQQQWX3rCgAJ <comment><USER2> This change is interesting:

crypto: randomly read an extra byte of randomness in some places.

[https://go-review.googlesource.com/c/go/+/64451](https://go- review.googlesource.com/c/go/+/64451)

Firefox has a similar testing feature called "chaos mode" that tries to shake out bugs by doing things like randomly forcing short file or socket reads or changing hashtable iteration order. Due to the increased chance of buggy behavior or performance issues, this isn't the sort of thing you would do in production (unless you're on Netflix's chaos engineering team. :)

<comment><USER3> I thought an "interesting" part of the change was actually how they made a 50% chance work for the extra read. They select across a closed channel twice -- and it results in a mostly even distribution of chance.

        for i := 0; i < 100000; i++ {
            select {
            case <-closedChan:
                a++
            case <-closedChan:
                b++
            case <-closedChan:
                c++
            case <-closedChan:
                d++
            }
        }

Results in an almost even distribution across the select choices!

[https://play.golang.org/p/cnAXBEZJm2B](https://play.golang.org/p/cnAXBEZJm2B)

(fixed playground link)

<comment><USER4> You're printing `b` three times in that Playground which makes it a look skewed.

        a: 25100
        b: 25080
        c: 25080
        d: 25080

vs

        a: 24973
        b: 25010
        c: 25013
        d: 25004

<comment> cup-of-tea So it's deterministic. I got the same numbers.

<comment><USER5> On the Playground or on your PC? The Playground has an execution cache, so the same input code always gives the same (thus "deterministic") result.

<comment> cup-of-tea Ah OK, it was on the playground. Is it deterministic when not cached?

<comment><USER6> It is not deterministic on playground if it is not cached.

You can add dummy code to the file to break free from the cache.

<comment><USER7> Adding some white space also does the trick

</comment></comment></comment></comment></comment></comment></comment></comment><comment><AUTHOR> Go 1.11 Release Notes: [https://tip.golang.org/doc/go1.11](https://tip.golang.org/doc/go1.11)

\- Go 1.11 adds experimental, integrated support for package versioning (vgo).

\- Go 1.11 adds an experimental port to WebAssembly (js/wasm).

<comment><USER8> Official vgo proposal: [https://github.com/golang/proposal/blob/master/design/24301-...](https://github.com/golang/proposal/blob/master/design/24301-versioned- go.md) Github tracking issue: [https://github.com/golang/go/issues/24301](https://github.com/golang/go/issues/24301)

Official wasm design doc: [https://docs.google.com/document/u/1/d/131vjr4DH6JFnb- blm_uR...](https://docs.google.com/document/u/1/d/131vjr4DH6JFnb- blm_uRdaC0_Nv3OUwjEY5qVCxCup4/edit)

</comment></comment><comment><USER9> Anyone ever notice that the assignment + declaration syntax looks like a sideways gopher? :=

<comment><USER10> I've seen it called the Zoidberg operator, too -- but I can see the gopher now that you mention it!

</comment></comment><comment><USER11> Wow, vgo seems pretty reasonable. ...I have to take one of my "damn it, go" complaints back.

Interesting to see their critique of bundler/et el...AFAICT isn't this vgo min version just old-school Maven resolution + semver major version in the import path?

Tools to auto-bump semver by examining the code's own public API would be nice.

<comment><USER12> The "go release" command is intended to support selecting the right version for a new package release. The golang.org/cmd/api command detects incompatible API changes and so can serve as the basis for an auto-bump feature.

I'd also like to see a command to generate a new major version as a wrapper of the previous major version (or vice versa), to simplify creating major versions that can coexist within the same program.

</comment></comment><comment><USER13> Oh, it's looking like the ground work for future RISC-V support is happening too.

[https://go-review.googlesource.com/c/go/+/106256](https://go- review.googlesource.com/c/go/+/106256)

That's really good news. :)

<comment><USER14> Almost complete, but stalled, and based on Go 1.8: [https://github.com/riscv/riscv-go](https://github.com/riscv/riscv-go)

</comment></comment><comment><USER15> I'm not fully versed in the what the transition to the `vgo` proposal will look like, so pardon my ignorance.

Will it be available behind an environmental variable like the vendor experiment was?

</comment><comment><USER16> [EDIT] Will leave the questions up have delved deeper into this myself and the above questions I have are basically answered but I am surprised at the route taken. Seems like everyone should be including the major version in their import path from the very beginning and every subsequence version which seems... ehhhhh.

\</comment><comment></comment><comment></comment><comment>

Not a Go dev:

Is the mantra of "the new package must be backwards compatible with the old package.", which is an underlying requirement for vgo to work, actually followed in the Go ecosystem? It seems crazy to me that a package would have to change its name if it wants to introduce a backwards incompatible change.

Has this happened in practice? How does it work? Are people going to suffix packages with "Really major major" version numbers separately from the actual version number?

The criticisms of bundler in the proposal seem to be be a bit wierd when the solution is to force a new paradigm on developers to make vgo's job easier.

Why even use Semantic versioning at that point since a major version can never be incremented.

<comment><USER17> I the context of versions I think Rickey puts it best, actually there are no guarantees of compatibility.

Even a minor update can eventually break someone's code that relied on the bug.

"Spec-ulation – Rich Hickey"

[https://www.youtube.com/watch?v=oyLBGkS5ICk](https://www.youtube.com/watch?v=oyLBGkS5ICk)

</comment></comment><comment> dis-sys Free lunch is over for me. For the past 4 releases, each delivered 3-5% performance boost to my Go application. Go 1.11beta1 marks the end of that, it is sadly 1-2% slower than Go 1.10.

Not complaining, just trying to hear numbers from other developers using their production software...

<comment><USER18> If something got slower, file a bug with details. We look into all such reports.

</comment></comment><comment><USER19> I think I just realized something about golang as I was walking down the hall. This is something which confuses many people in a way which many respond to with unwarranted emotion, since they are unable to make this connection.

Since Go uses Duck Typing, having certain methods is effectively a Type Annotation for a given type implementing an Interface. Many programmers, failing to realize this, become outraged at "boilerplate." It is a design trade-off forcing the programmer to specify all cases when implementing an interface, in much the same way that golang's exception handling eschews tools that let you create clever catch-alls and requires you to specify everything. It's just the "no magic" tradeoff.

<comment><USER20> > requires you to specify everything

That's not my experience. checking for errors is completely optional. I'm probably just a bad lazy programmer that leans to hard on the compiler. I like the catch everything and then refine error handling as i get more understanding of failure modes (i'm from java, i avoid runtimeexception).

Go makes me feel like i need to understand all possible error cases for every line as i type it. I feel like i have to handle it right now, forever, or i'll forget that line can have an error. I really miss being able to gradually refine error handling, because i can rely on the compiler to remind me about all the stuff that can go wrong.

<comment><USER21> Indeed, Go's position is that your style of programming produces fragile programs, and that it is better to consider the failure modes of each expression as you type it, rather than afterwards.

<comment><USER22>
      if err != nil {
              return nil, err
      }

is ceremony that requires no thought and adds no value. There should be sugar for this so it doesn't completely swamp the tiny minority of cases that actually do something.

<comment><USER23> I actually rarely type that very snippet. In like 3/4 of the cases, I make the error more specific, like

        if err != nil {
            return nil, fmt.Errorf("could not parse file %s: %v", path, err)
        }

the remainder being either the snippet you put above or more complex error management.

<comment><USER22> You can enrich err.Error(), but when you do you lose the type of the original error and any other fields it may have had. This is something the language can and should do more reliably (i.e., sugar could mutate err.Error() and prepend "MyStruct.myMethod failed: ", or better yet add a damn stack trace).

</comment></comment></comment></comment></comment></comment><comment><USER24> What are some good use cases for compiling Golang code to wasm?

<comment><USER25> Writing most of your front/backend business logic in Go is one possibility, but I think that easily moving complex logic to the web as a platform (especially for web demos, see these[0] example with gopherjs) is the most compelling possibility. Generally, I'm excited that this democratizes the web programming space, because the best use cases are often the ones no one has thought of yet.

[0]: [https://hajimehoshi.github.io/ebiten/](https://hajimehoshi.github.io/ebiten/)

</comment></comment><comment><USER26> Ok, ninja edit, this whole comment was based on a misunderstanding and adds no value to the discussion. I've been corrected below, the rest does not need to be preserved. Downvote it to the bottom for me please; I can't seem to delete it.

<comment><USER27> They never said vgo would be production ready for 1.11, they said experimental until 1.12: [https://github.com/GoogleCloudPlatform/runtimes- common/issue...](https://github.com/GoogleCloudPlatform/runtimes- common/issues/683)

<comment><USER26> Thanks for pointing that out, I've been trying very hard to keep up but somehow missed that detail. Perhaps it should be in the release notes!</comment></comment></comment>


Half of the top 50 Wikipedia contributors are bots - <AUTHOR> http://slightlynew.blogspot.com/2011/05/vandalism-second-chances-and-bots.html

<comment><USER2> Before everyone freaks out about this, the bots that we're talking about are janitorial, doing things like add dates to wikitags added by human editors.

You can see this right now; go find a page to add a (legit, please) {{clarify}} or {{who}} or {{where}} tag to. Add it without a date, and wait 5 minutes; Smackbot will date the tag for you.

This is a good thing for _obvious reasons_.

Similarly, I'm guessing the "reversion" stat here is misleading. Reversion isn't deletion; anything that moves content around the page is likely counted as well. Write a graf or two on any well-trafficked WP page and you'll probably see it moved around pretty quickly.

More importantly, reversion isn't permanent. On any popular article, someone is bound to disagree with the merits of your edit. The normal way of things when I was wasting time at WP was, edit, revert, talk page, re-post copy.

<comment><AUTHOR> And that's genuinely valuable; it's helpful to know that someone's thought that this has been unclear for 2 days versus 2 years. The compressed diff will be quite small, but Wikipedia incrementally gets better.

Have you ever taken too much penicillin? You'll lose some of your good bacteria and you'll get a fungus from opportunistic infections. (See <http://en.wikipedia.org/wiki/Antibiotic_candidiasis> and <http://en.wikipedia.org/wiki/Candidiasis> for examples.)

Same thing with Wikipedia. Bots are really helpful for regular maintenance.

</comment></comment><comment><USER3> I'd like to know how many are plagiarists

<http://en.wikipedia.org/wiki/Wikipedia:Plagiarism>

or persons who misrepresent their identities,

<http://en.wikipedia.org/wiki/Wikipedia:Sock_puppetry>

especially after some infamous incidents

[http://www.roughtype.com/archives/2007/03/head_wikipedian.ph...](http://www.roughtype.com/archives/2007/03/head_wikipedian.php)

[http://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/20...](http://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2010-11-01/Arbitration_report)

of editors with a lot of trust in the Wikipedia editing community who were abusing that trust. I don't find it easy in the culture of Wikipedia to gain trust by referring to reliable sources and checking what those sources say.

After edit: The phenomenon of edit wars

<http://en.wikipedia.org/wiki/Wikipedia:Lamest_edit_wars>

goes a long way toward explaining why most Wikipedians have had contributions reverted, as the submitted blog post reports.

<comment><AUTHOR> As I was manually going through the top 50 list, "Darius Dhlomo, 920829" seems like someone who was banned, based on significant copyright issues.

Also, plagiarism is difficult, because there are a lot of articles based on the kernel of public-domain texts, of which citation is not required. And sock puppetry is difficult, because some people keep bots that do productive work, but if human beings have trouble sensing that, I imagine it'd be much more code than the hundred lines of code that it took to process this the first time: [https://github.com/lsb/ugc-contributors/blob/master/mh- diffs...](https://github.com/lsb/ugc-contributors/blob/master/mh-diffs.rb)

</comment></comment><comment><USER4> <http://en.wikipedia.org/wiki/Wikipedia:Bots>

Learned something new today. I didn't have any idea Wikipedia was partially controlled by bots. I for one welcome our new NLP powered overlords.

Based on that page, though, how are bots _contributing_? Editing, yes. Creating, how?

<comment><USER5> The biggest editing bots tend to do template maintenance (so correcting formatting issues and adding dates to templates). Bots simply do tedious work (that would have to be done anyway) faster - so hence a big edit count.

My bot (which notifies English Wikipedia of image deletions on Wikimedia Commons) edits about three times more than I do each month (and I am somewhere around #500 activity wise).

The very top bot ClueBot NG does more than double the edits of anyone else per month; that is an anti-vandalism bot, it catches about 50% of vandalism on Wikipedia each month. So pretty crucial :) Cydebot (#2) does some sort of category maintenance (not sure what, never seen it before). SineBot (#5) goes around and signs peoples comments when they forget (handy beast).

Basically it is just infrastructure; but because of the nature of the Wiki it is more visible than other forms of infrastructure :)

</comment></comment><comment><USER6> "Over three quarters of contributions from registered users are from someone who's had a contribution reverted."

Well this makes sense entirely since it is peer reviewed and the articles are a living ecosystem which are built off of and on top of prior submissions and versions.

<comment><AUTHOR> I approached that question from a purity standpoint: if you only limited Wikipedia to people who did things "right", where would you be? And the answer turned out to be that you wouldn't be very far.

I think urban planners have found that neighborhood cohesion and community watches are far better than gated communities and lawless knifefights outside, and the online textual equivalent of community dynamics agrees with that.

<comment><USER3> _if you only limited Wikipedia to people who did things "right", where would you be?_

Although it's notionally possible that a first editor who got something "right" (factually correct based on reliable sources) was later reverted by someone edit-warring to score a point. Sometimes a particular edit makes Wikipedia worse rather than better. If NONE of my edits had ever been reverted (several have been), I would think that I wasn't trying hard enough to check sources and correct commonplace errors. However, it's not clear at the moment whether the editors with the lowest percentages of reverted edits are those who do the best edits, or just those whose prejudices (and topic choices) avoid scrutiny by the mob of other Wikipedia amateur editors. I am conscious of this issue because I was a professional editor and researcher to make my living long before most members of the general public had ever heard of the Internet, and because most wikipedians are so young and so devoid of editing experience that they readily mistake good edits for bad.

 _I think urban planners have found that neighborhood cohesion and community watches are far better than gated communities_

It would be interesting to see citations to research on this issue, as well as the latest citations to research on forming online communities in which fact- checking and encouragement of careful scholarship become the group ethos. I live in a crime-free neighborhood with an annual block party and NO crime in a typical year, not gated, with good community cohesion, but also isolated from a lot of passers-by simply because it isn't a shortcut to anywhere else. Wikipedia is so exposed to the outside world, including spamming advertisers and propaganda agents of warring governments, that it may take more vigilance to protect than just an informal consensus among volunteer amateur editors.

<comment><AUTHOR> A guy I knew at the Media Lab said that Marvin Minsky tried to correct his Wikipedia article, but someone reverted it. The IP address came from inside the Media Lab, so it might have very well been him.

The small-community-far-from-everything is quite similar to Wikipedia in its early years. Look at 2002-2005 and you'll see lots of anonymous Good Samaritans contributing helpful content. (Look for R6 and R7 on [http://slightlynew.blogspot.com/2011/05/who-writes- wikipedia...](http://slightlynew.blogspot.com/2011/05/who-writes-wikipedia- information.html) to see a time series of anonymous contributions from 2003 to 2010.)

</comment></comment></comment></comment><comment> alok-g While, strictly speaking, this is unrelated to this topic, something has been bugging me that I would like to bring to the attention of HN readers:

BOUML is a free UML2 tool for C++, Java, Python and others. The developer, Bruno Pages, has stopped its development due to some issue with Wikipedia administrators.

I attempted to get more information from Bruno but he is upset enough to not talk about it. The following is quoted verbatim from <http://bouml.free.fr/> and is all I know:

"Due to the continuous license violations, attacks and insults from people of wikipedia ( the worst of them were the administrators Bapti (commons)/ Bapti (fr.wikipedia)/ Bapti (de.wikipedia) , Dereckson (commons)/ Dereckson (fr.wikipedia)/ Dereckson (de.wikipedia) and Esby (commons)/ Esby (fr.wikipedia) ), I have decided to stop work on Bouml except to fix bugs. Bruno Pagès."

</comment><comment><USER7> Oh! The number of articles I have read lately where I have gone and looked up actual books and discovered that the wikipedia content is copied verbatim from the books, yet with sentences that do not correlate strung together in a way that results in totally incorrect information.

And then there is the fact that for ages the Jean Claude van Damme article said he had killed 100 men with his bare hands {expletives deleted}.

Many of the mathematics articles contain appalling errors. You post about the errors in the discussion page and the issue is totally ignored. There seems to be no way to work with the community process to get things fixed.

I use wikipedia a lot for things that don't matter, e.g. as a structured skeleton for notes on a particular topic that I am writing for my own benefit and understanding. But as a project, I think it has basically reached its limits.

There's no way to move it significantly past what it is now.

<comment><USER8> If there are significant errors, fix them yourself. There's no need to go to the discussion page.

<http://en.wikipedia.org/wiki/Wikipedia:BOLD>

<comment><USER9> Except I find most of my changes get reverted, even if referenced or simply deleting incorrect and unreferenced information. I don't have time to enter a life-long battle keeping an article correct.

<comment><USER10> Something does not compute there. If your changes are getting reverted, obviously someone cares enough to notice, so it follows that they should care enough to check the discussion. Are you sure you're not just getting hit by a bot? Maybe you did not tag your changes properly? If anything, there might be a problem that the admins should look at. I would like to see some of these changes you are talking about.

<comment><USER11> My experience with Wikipedia has been hit or miss. Sometimes I'll find an older article and fix it up a bit and it will stay. Other times I get my edit reverted by an over zealous neck beard who can't handle being wrong on the internet. I don't have the time to battle these types of people. This is what sunk, "Wikipedia is not a creditable source" into my brain.

</comment></comment></comment></comment></comment><comment><USER12> It'd be cool to see how this was calculated. Though considering the amount of auto-spellcheck and similar that goes on, it's kind of surprising to see that half of the top contributors are _human_.

<comment><USER13> The source is linked from the OP. Here it is: [http://slightlynew.blogspot.com/2011/05/who-writes- wikipedia...](http://slightlynew.blogspot.com/2011/05/who-writes-wikipedia- information.html)

The author draws a wonderful parallel between bots in the Wikipedia ecosystem and bacteria in the human body.

<comment><AUTHOR> Thanks for your kind words! I was fascinated by that talk.

And if you want the code + data, you can just xargs [https://github.com/lsb/ugc-contributors/blob/master/mh- diffs...](https://github.com/lsb/ugc-contributors/blob/master/mh-diffs.rb) over all of your pages-meta-history.7z files from <http://dumps.wikimedia.org/enwiki/20110317/> or get the sqlite database from Infochimps from [http://www.infochimps.com/datasets/entropy-per-revision- of-w...](http://www.infochimps.com/datasets/entropy-per-revision-of-wikipedia- pages-beginning-with-m)

</comment></comment></comment><comment><USER14> The idea that a human and a program would use the same interface is a good one if your goal is to allow the humans to focus on adding domain knowledge and the machines to focus on the boring repetitive tasks. Consider it a design pattern, not an evil plot.

</comment><comment><USER15> The stat I found interesting is this one [citation needed]: while a majority of edits are done by few editors, most of the content is generated by either a) anonymous accounts or b) people who have contributed 2-3 times and haven't returned since. The editors, like the bots, represent maintenance edits.

Keep that in mind the next time Jimmy Wales gives beaucoup credit to editors, or some super-user gets power-happy.

</comment><comment><USER16> What is the motivation for this? Why would someone write a bot to add content to wikipedia?

<comment> T-hawk Also gray-to-black hat spam with links. Just like the content farms that plague Google's results, they'll push in any low-quality content in hopes of trolling some clicks to their ad- or malware-laden sites.

<comment><USER17> These are pretty easy to spot, and they get banned very quickly.

</comment></comment></comment><comment><USER18> I think these are bots that add links (external) to Wikipedia by some Spammers. I have seen some people doing it.

<comment><USER19> I think most of those are probably officially endorsed bots that do things like correct common misspellings, crosslink between different langauge Wikipedias and do huge one-off tasks like category reorganizations.</comment></comment>


Ask HN: Who are the best designers in Silicon Valley? - <AUTHOR>

Who are considered the best designers in Silicon Valley? Pretty simple question, just looking for a list.<p>Hope to model my work off theirs. And potentially bother them for feedback one day since they're close to home. <comment><USER2> Jesse James Garrett gave the closing plenary at IA Summit 2009, and he asked a question of the audience, name some great designers.

And the audience shouted out names.

Then he asked, name the works of design they are considered great for.

And the audience was silent.

...

Don't look for names. Look for works, and then find out who made them.

If you don't know what's considered good work, don't ask like you asked this question. "Good" is subjective, and design is not art; design has a purpose, is backed by research, has metrics, supports a business model. Rather, you want to study work that _solves the problem the designer intended._ Maybe they intended to make it easy to book an airline ticket, or maybe they intended to appease ten different executive vice presidents. Pick any work, and learn why it was made that way, and determine if it's great or not (or, more likely, if there are _aspects_ which are great _for a particular use case_ ). You could do in-depth interviews, you could do contextual inquiry, you could ask the designer, you could usability test it, you could go through heuristics, you could do GOMS, there are any number of methods.

But don't look for names first.

<comment><USER3> >" Good" is subjective

I'm not sure how true that is. There are principles of design, across fields, within fields, and in specific use cases, and you can judge based on the principles how good a design is. "Good" may be hard to define in general and in each context, but it's not as subjective as people think it is.

</comment></comment><comment><USER4> Try finding the designers behind Microsoft's Metro. Based on the amount of copying by iOS and Android since then, they must be one of the best.

<comment><USER5> The Metro design philosophy is the defunct Zune team's true legacy. Their work on the PMP went to waste mostly due to timing, but their design work has lived on in everything else Microsoft has done since. Virtually all the core tenants of Windows Phone and Windows 8's design, from typography as hierarchy to live tiles and colorful flat design, were first seen in the Zune desktop software and Zune HD's UI.

<comment><USER4> Very true, at least the rest of people were smart enough to keep evolving their concepts instead of going to mainstream same ol'.

</comment></comment></comment><comment><USER6> Probably not what you're looking for, as he does industrial design, not web design, but Jony Ive is definitely up there.</comment>


The Narcissism of Small Code Differences (2008) - <AUTHOR> http://raganwald.com/2008/05/narcissism-of-small-code-differences.html <comment><USER2> With 10+ years of being a professional programmer I think you will automatically get the insight of being agnostic is really the only way of surviving and keep your passion for your work.

Those who fail at this will stop working as a programmer, move out in the woods, build a cabin and live happy as a farmer.

When you're young you will inevitably always have an attraction for styles that ring the most true to you. You have one single hammer you have learnt to use or even worse, have heard really good programmers at Hacker News prefer to use, and therefore you use this hammer for everything.

You are a poser.

Most programmers have been there. Posers can be extremely sharp and useful if they get to do what they're good at, but they are posers nevertheless and at the start of a humbling journey to agnosticism - getting shit done instead of bickering and posing.

<comment><USER3> I don't know. Greatly influential hackers such as Torvalds, van Rossum, pg, rms, etc. do not seem to illustrate agnosticism very accurately to me.

<comment><USER4> My opinion: there isn't one single _good_ way to do programming. Often, you want your interfaces to be referentially transparent (stateless). Usually, it's best for source code to be in the functional style as well-- but not always. Sometimes, mutable state is exactly what you need. But it shouldn't be the default, unless you're working at a very low level.

There are, on the other hand, a lot of _bad_ ways to do programming: FactoryFactory nonsense, software-as-spec systems, waterfall methodology. We've seen them several times in our careers and have a hair-trigger sensitivity to stupidity, because we've seen it cripple or kill projects.

Great programmers tend to be unforgiving in their condemnation of the bad ways of doing things, but hesitant in accepting one programming model-- even a very good one like Lisp-- as being the One True Way of doing things. As soon as you have a One True Way, some very smart people disagree with you-- and that's a good sign that you're at least partially wrong.

In other words, it's good to be passionate about using the right tools for the job. It's a problem when people think the same tool is right for every job.

<comment><USER5> software-as-spec is out of vogue now? I may have misunderstood, but I thought software-as-spec is the same thing as test-driven-development, which I could have sworn is still lauded.

<comment><USER6> Can you explain why you think they are the same? SW as spec is problematic because whatever the sw does is interpreted as being what it is supposed to do. So how do you identify bugs? At least with TDD the tests serve as some kind of documentation.

I'm no fan of either, generally, but I also don't work on "move fast. break things" type projects.

<comment><USER5> I'm not a software developer, so I could easily have misunderstood what sw-as- spec is.

I definitely do not work on "move fast break things" projects.

</comment></comment></comment></comment></comment></comment><comment><USER7> Oh my god, I've been in this situation. We had an executable that had the behavior "if the program is started with '-s', it's a server. Otherwise, it's a client that connects to the server". While the rest of us moved on to the next feature, a Purist came and rewrote that code to use a dependency injection framework ("Guice", in this case).

On monday, we said "hey, there's a new bug - when started in Server mode, this code still tries to open a connection upstream! It looks like a Client class is getting created when we don't need it! ... and hey, where did our code go?"

The Purist said "oh, well, that's a _weird thing to want_ and isn't supported by the framework, but I can put a kludge in here...." The kludge is, unfortunately, too weird to describe in english - he played a game with lazy loading and well-when-this-happens-then-that-makes-this-happen. And the rest of us had better fights to fight so we just let it stay.

<comment> loup-vaillant To this guy, and many others like him, I would ask one question: "Is your code _shorter_?". If not, then I can be quite confident the modification was worse than nothing. (Most of the time, "simpler" and "shorter" mean the same thing.)

When I rewrite code, at least I make sure the result is simpler than whatever I started with. If not, I simply revert back to the the previous version.

<comment><USER7> well, the thing is, his version replaced all the code with type annotations. So, in some sense, he replaced a 5 line method with no code at all!

</comment></comment></comment><comment><USER8> True Agnostics don't write unit tests. In the real world, agnostic code starts with just four lines that hide a single business rule, but balloon into gigantic 600-line methods that everybody is afraid to touch because weird business rules from the Singapore office are hidden away in strange code constructs in the middle someplace.

But the agnostic developer doesn't even consider refactoring it, because it "just works".

90% of devs are true agnostics, never refactoring, never unit testing, barely above the fizzbuzz level. Raganwald's example isn't an agnostic at all: he's a faithful parishioner, dutifully worshiping at the Church of St. Agile of the Clean Code but wisely avoiding the fanatics and the church politics.

</comment><comment><USER9> It's unclear to me what the author is criticizing. If the argument is that putting form over function is bad, where form is more important than the thing actually working, then I agree with the post. And that's what happened in the example, the rewrites all turned out not to work. Replacing working code with broken code is never good.

If the argument that form is irrelevant as long as everything works, well then I disagree entirely.

Just working doesn't mean it's good enough, and really the big reveal in the post is completely beside the point because all those rewrites did not work but that's not what the author is criticizing.

Code has to be maintainable, it needs to be readable, and that matters.

Also it's pretty much cliché at this point to trot out the straw-man turns everything into a verbose classes programmer. I've never seen anyone turn a simple one line function into 3 files of classes with tons of unnecessary methods ever in my career. In Java you do create classes for a single function sometimes, but that's because you have to.

<comment><USER10> > It's unclear to me what the author is criticizing.

The author isn't criticizing so much as observing. From TFA:

 _The post is not about the Agnostic or his code, it's about the dynamic of programmers eager to rewrite code in their own image, and the hypothesis that our (I am equally guilty of this behaviour) motivation for doing so is to emphasize the small differences between ourselves and others._

<comment><USER11> Aren't you the author?

I love how people missing the point actually reinforces the point. Well done.

<comment><USER10> I was the author. Now I'm a guy who wonders if those are my memories, or Tyrell's niece's memories ;-)

<comment><USER12> I've had the experience of violently agreeing with a comment I found on the web, only to find I wrote it years ago and had forgotten about it. Strange days.

<comment><USER13> I've had the experience of disagreeing with a comment I found on the web, only to realize that I wrote it years ago and had forgotten about it. I'm not sure if that's better or worse.

</comment></comment></comment></comment></comment></comment><comment><USER14> > _Update: Reviewing the comments made elsewhere, I see that this post fell > into the Fizzbuzz Trap: By quoting a programming problem—no matter how banal > and contrived—the article was bound to provoke a huge amount of dicussion > around the correct way to solve the problem, while ignoring the point of the > post._

For his next blog post, maybe Raganwald should write about the pitfalls of using allegories.

<comment><USER15> I'd read that, but only if he actually used an allegory to illustrate his point.

<comment><USER16> Same here. Although i wouldn't read it if he used a self-referential allegory.

<comment><USER15> You wouldn't be able to because it would rip a hole in the space time continuum.

</comment></comment></comment></comment><comment><USER17> I always find it fun to read through these kinds of stories, particularly when we all know we've been there, are going to be there at some point, or are sitting there right now. For instance, myself and two other co-workers were working on a project several years back that involved passing around an array of values. I was building out a Swing based UI layer and infrastructure to wrap their logic and database access layer. At some point, something broke in the backend and I tracked the issue down to a block of code that was taking an array of values and constraining it to have no duplicates. The problem being that our dataset could easily have and should have duplicates. I fixed the issue with the comment "This imposed set semantics on something that is not a set."

Granted, I could have written the comment a little better, i.e. more context as to why set semantics were an issue. My co-workers later told me they found my change and spent 3 hours or so trying to figure out if I was right or not, eventually concluding I was. Of course, I was just down the hall and neither I or them thought to go ask the other about why things had changed or if it was a valid change in the first place. A little communication could saved a large amount of time ... Ah well, live and learn.

<comment><USER18> I made this same mistake refactoring a function to not process duplicates that the original dev caught in code review. I argue that assumptions (intentionally re-processing duplicates) should be explicitly communicated through comments, unit tests, or assertions.

In the article, author states that existing unit tests checked that two digit zip codes were invalid. The question remains how a refactor that fails unit tests was pushed to master.

</comment></comment><comment><USER19> _For no matter how good or bad the Agnostic's code is, why did the Librarian rewrite the Ascetic's code?_

Because rewriting code that looks ugly is one of the ways people use to begin to identify with the codebase and make it easier to understand for themselves. The example in the article is clearly made up to show how stupid it it to change things that "just work". Except in reality those things are usually ugly, large and complicated, and _eventually need to be changed anyway_. The way to deal with them is make people responsible for their own code, so that they add tests or at least some comments that explain why and how things are the way they are. Simply being fearful of change and blaming the last person who touched the codebase for all its problems is not a viable long-term strategy.

<comment><USER20> I think you missed the point. It isn't to show how stupid it is to change things that already work. It is to show how often the motivation for trivial changes is just to make your code appear sophisticated and stand out.

<comment><USER19> The point isn't very clear from the article. Frankly, I've _never_ seen anyone changing working code simply for the sake of showing off their sophistication, so it feels like a straw-man argument. What does happen quite often is what I described above: people changing code to make it more comprehensible for themselves. If that happens a lot to your code, the answer isn't felling butt- hurt (which seems to be the case with the author) and blaming it on "dysfunctional" personalities of other coders. The answer is to write comments, do better job naming stuff, be clearer about things in general.

<comment><USER20> The point is very clear. For example, changing a library written in a functional style to a hierarchy of classes and interfaces might be totally reasonable to someone who lives and breathes OOP. To them, the first style is not comprehensible and therefore "wrong". But does it actually solve any problem?

</comment></comment></comment></comment><comment><USER21> What did I learn from this? Srtick to "no ticket -> no change" If you spot a problem write a ticket and discuss the problem.

If there really is a problem it will be fixed. If it is not considered a Problem it will be archived and documented as "NOT a problem".

And if the 'fix' breaks the system you will not be toasted because hey we talked about this and all(including the boss) agreed we should change this.

</comment><comment><USER22> > it was only supposed to pre-pend one or two zeros when importing zip codes > from CSV files. Anything with fewer than three digits is supposed to be an > invalid code

The true problem here lies with the poor choice of function name on the part of the original author and lack of commentary. The name "formatted_zip_code" automatically primes people to expect that you passed a (possibly mal-formed) zip code and the function should format it properly. Under that metric, the original code was indeed deficient and should have been changed. Whether it retained the original style is secondary, but there were clear functional deficiencies.

"Anything with fewer than three digits is supposed to be an invalid code" is not reflected in the code (why does it return digits and not trigger an error there?) and apparently there are no comments, so it should be no surprise that it needed to be fixed.

<comment><USER23> This is the correct code:

      def formatted_zip_code(digits)
        case digits.size
        when 4 then "0#{digits}"
        when 3 then "00#{digits}"
        # 2 or less digits is an invalid input
        else digits
        end
      end

<comment><USER24> I'd improve that because of this:

-> if the argument doesn't conform to contract, an assert/exception should be thrown so that the caller can recognize the existence of an incorrectly used function.

<comment><USER25> Are there zip codes that are 2 digits? I'd fall fallacy to this post and once again argue to the contrary. If this function is about formatting zip codes with leading zeros, and zip codes are either 4 or 3 digits. Why would an invalid zip code be passed to this method, a formatter?

Normally I'd agree with your argument about failing to meet a contract, but why would this formatter method get anything but a valid zip code.

<comment><USER22> The first 3 digits of a zip code represent the sectional center facility code, the smallest of which is 005. One would assume that 00501 is the smallest zip code (which apparently maps to HOLTSVILLE NY )

[http://pe.usps.com/text/LabelingLists/L002.htm#xd_L002](http://pe.usps.com/text/LabelingLists/L002.htm#xd_L002)

[https://tools.usps.com/go/ZipLookupAction!input.action](https://tools.usps.com/go/ZipLookupAction!input.action)

</comment></comment></comment></comment></comment><comment><USER26> So, as a programmer with at least "a lot" of experience (these things are hard to judge, especially among folks here), I'm trying to extract some learning from this.

I'm not at all sure about my classification. Probably somewhere between Librarian and Purist, perhaps (but these things feel somewhat harder to apply when most of the code is in C).

Should I fight the urge to re-write code that I see as broken, since it's just me wanting to re-shape the code in my image? That's emotionally somewhat difficult (bad code hurts the eyes) but certainly doable, but it also seems a bit counter-productive since I really think there can be some value in sharing experience. It's also, of course (?) hard to really believe that it's all narcissism, to me bad code feels objectively bad. If that even makes sense.

I guess it boils down to "co-operation is hard" for me, right now. :)

<comment><USER27> The point is, the code wasn't broken. It just wasn't done the "right" way.

I've had to fire people because they could not stop "refactoring" code that wasn't broken. Their commits were half in the code the were supposed to be working on and half scattered, random changes like the changes from the article.

You're not "sharing experience"; you're wasting time, money and energy. You are insulting your co-workers intelligence. You are pissing off your boss.

Worse, your co-workers now have to merge your random edits into their work because they were actually assigned to work on the section of code you "fixed".

There is nothing worse than doing a pull and finding a bunch of small, conflicting and ultimately useless changes on the head, ruining your morning coffee.

<comment><USER26> Heh. Your comment actually made me blush. :)

I certainly hope I do whatever I do with a bit more finesse than what you imply. So far co-workers do not seem to be offended, and no boss has ever seemed pissed off to me.

From your remark, it sounds as if you consider "refactoring" to be almost a swear word, and something that should never happen. I just can't agree with that, even with code I've written myself I sometimes realize I did it wrong.

I practice commenting on other people's code a lot online, that seems to work pretty well, too. Of course it's even harder to notice if I'm offending people online.

<comment><USER27> > From your remark, it sounds as if you consider "refactoring" to be almost a > swear word, and something that should never happen. I just can't agree with > that, even with code I've written myself I sometimes realize I did it wrong.

Ha! Not really, in my career I think I am still "net negative" for lines of code; I once refactored a 100K line medical diagnostic program down to ~10K lines for instance. What is a swear word is people who use "refactoring" as an excuse to start dicking around with stuff that doesn't need to be fixed.

Refactoring certainly has it's place, but needs to have a purpose: new feature set that requires the rework, performance, what have you. Too many developers just pick something that is working and "refactor" it ... then you end up with the same thing you started with, just "better" and with different bugs.

</comment></comment></comment></comment><comment><USER28> Here's an amusing code snippet for you:

        >>> (datetime.datetime.now() - datetime.timedelta(days=2007)).__str__()
        '2008-05-14 18:32:57.195554'

Looks like this old goldy originally turned up when hacker news was just a yearling...

[https://news.ycombinator.com/item?id=188873](https://news.ycombinator.com/item?id=188873)

<comment><USER29> ...

why would you call `__str__` explicitly instead of 1. using str() as you're supposed to or 2. just using print?

<comment><USER30> ... and Poe's law strikes again.

<comment><USER31> That's partially true, but note that Python does, to a fairly large extent, have One True Way of formatting code (i.e. PEP-8).

Although, amusingly, I can't actually find this rule in PEP-8.

<comment><USER29> Not calling dunder methods directly doesn't really need to be in PEP8, they're data model methods for overloading protocols, their whole purpose is to be used by some other "top-level" operation if and when necessary (nb: this may or may not apply when implementing or overloading dunder methods, but that's a special case)

</comment></comment></comment></comment></comment><comment><USER32> I have had the case where I wrote an immutable class and then later someone modified it so that a few of the properies were no longer immutable. That developer then complained that his changes broke a bunch of unit tests and that perhaps we shouldn't write immutable classes because they are too fragile and make it difficult to reason about and use the class in code. I disagreed with his view, but his view was no less true than my own. We had completely conflicting and incompatible coding philosophies.

This made me think about something(and perhaps it is a horrible analogy), but how would you play a game of chess if every few moves you had to let someone else make your move for you? Would the strategies that worked and allowed you to win by yourself in the past start to fail with this new constraint? Would you have to abandon certain types of plays or would you spend your time cursing the Gods because the other players couldn't see your strategy nor you theirs (even if you tried to discuss it)? Or perhaps you would realize that the problem is that chess is simply not a game that is meant to be played this way.

In the end, we had more success using clearly defined boundaries and trust rather than a collaborative process based on overlapping responsibilities and communication.

I'm not making a universal claim, I'm just telling my story.

</comment><comment><USER33> The whole problem could have been avoided if the agnostic had just added a simple comment stating that the code intentionally only handles strings of 3 or 4 digits.

<comment><USER34> They did. The unit tests covered that piece of functionality. The real issue with the story being why didn't any other the other dev's run the unit tests after making the change?

<comment><USER15> More fundamentally - why did they change the code in the first place?

<comment><USER35> Because it was shitty code?

<comment><USER36> The only thing shitty about it was that it didn't adequately explain the problem it was solving. However, that isn't apparent by looking at the code, the only way we could know that is either by reading/running the tests or asking the original developer. There would be no reason to rewrite until you had a reason.

</comment></comment></comment></comment></comment><comment><USER37> If you want to treat a number like a string, why not just treat it like a string? When people enter zip codes online they enter 07045, so why not just store that? Even forget about other countries like Canada it seems like the best way...

<comment><USER38> There are lots of way to accidentally lose a leading zero along the way. For a quick and realistic example make a csv file the looks like:

       01234,Hello

import it into Excel, edit something and export it as csv again. Unless you pay careful attention to what you're doing, you've just lost your leading zero.

</comment></comment><comment><USER39> I like all styles except the one of "Purist" in that example. In that example, the Purist code is way too bloated and boilerplate (if it indeed has tons of subclasses just for such a tiny problem), and I dislike boilerplate.

<comment><USER40> I'm pretty sure they were all caricatures. The ascetic's code uses a Y-Combinator, which (as I learned earlier today on HN!) is overkill even if you program in a functional style (basically FP's answer to OO's AbstractSingletonBeanFactoryStrategy). The librarian's code isn't particularly bad, but if you've never heard of that function, you'll have to look it up. This makes the code a little less readable.

I think the point of the article isn't to compare these different styles, but to deliver a bigger message: Style isn't that important, just write code that works.

<comment><USER41> > _...FP 's answer to OO's AbstractSingletonBeanFactoryStrategy_

That does not really belong to OO. You would be unlikely to find an AbstractSingletonBeanFactoryStrategy in a Smalltalk project for example (even one under the control of a Purist.) You _would_ find it in a JavaEE project, but even then it is not part the platform, it has more to do with convention that has built up around the platform (and the type of Purists it attracts.)

</comment></comment></comment><comment><USER42> I've played each role at some point, in several languages. Now, if I modify code written by a Purist for example, I try to use the purist style. I don't compromise on correctness however, which sometimes means commit messages are much longer than the diff itself. It works great if everyone is willing to learn from each other -- when ego doesn't get in the way that is.

</comment><comment><USER35> I'm currently working on a codebase written by "agnostic". Simply put, it's a terrible buggy mess bordering on industrial sabotage. Whenever I have to touch up some code, I have to rewrite the surroundings to my standards, just to keep my sanity intact.

<comment><USER43> Yes, I think there are two types of agnostics. The ones who can't code and the ones that can. If you know the techniques listed, use them where appropriate. In that example no one technique was better than the other, as the code was too simple to make any of them more relevant.

</comment></comment><comment><USER44> He left out the Test Driven Obsessive who insisted on writing tests much more devious than the actual input, and the Machine Learner who thought that iterated map/reduce should be able to generate an optimal function based on that input, and probably others.

<comment><USER43> The obsessive tester may have got it right.

</comment></comment><comment><USER45> This post illustrates the folly of valuing form over function. Certainly we should strive to write code that is readable and robust. However, it's important to remember that before all else the code should actually work.

The example used as a demonstration is a bit like an episode of Three's Company. The premise revolves around a simple misunderstanding, and it's a bit hard to believe that the misunderstanding went on for so long. The original code is a prime candidate for documentation, and there were even unit tests. If you accept the misunderstanding at face value though, the lesson works well enough.

</comment><comment><USER46> I'm far too insecure to force my taste in code on others like that. Though I find the Ascetics code utterly unreadable (is that why I still don't grasp Lisp?), and the Purist's code ridiculously over-designed.

But still, if someone writes code like that and I'm not the one reviewing it, my instinct is to assume there's a good reason for it to look like that. If I'm reviewing it, you can bet I'll want them to explain why they do it like that, and more importantly: explain what's so wrong about the original code that it needed to be changed.

</comment><comment><USER47> It seems to me that the core of the problem is that programmers are both writers and critiques.

Indeed, imagine a world in which authors would publish in a magazine both their own short stories and a review of a short written by another author for the same magazine.

Unlike our authors in this Magazine From Hell we programmers have objective criteria on which we can base our critique of the work of others when we _have to_ , namely a specifications, coding standards, etc.

</comment><comment><USER48> This really seems like a trivial problem but it's one that has been bothering me ever since. I've found it to be too stupid to even address this, even though I assume that a "non-trivial" amount of development time is wasted because of it.

As a perfectionist I'm more often than not engaged in rewriting code "the right way". Generally I've found it hard to accept that there are so many ways of doing things. Worse, some solutions perform better while others are easier to read. Even worse, there's usually a trade-off between those two.

To address this I've came up with two ideas. The first would be a language that would be ultra-restrictive, so that there could be only a limited number of ways of doing things. However my guess is that this has been tried and failed.

The other idea would involve some clever IDE and/or version control system, that would allow different versions of constructs to co-exist. In other words there would be different "views" on any piece of code. In fact, this is already the case with documentation which can be seen as a "natural language" view on the code.

This would solve the "The Narcissism of Small Code Differences"-dilemma, as every programmer could keep his favourite version. But what's more interesting: Based on the assumption that rewriting code for ideological reasons is common behaviour that can't just be stopped, it would be nice (and more efficient) if the rewritten code could at least serve some other purpose. As different versions of a function exist, they could be invoked based on some criteria (probabilistic or as a fallback) with the intent of increasing fault- tolerance.

Of course having a fallback is part of the motivation for version control systems, but these are not able to utilize different versions in a systematic way/at runtime, at least not as far as I know.

</comment><comment><USER49> I was expecting the story to be that even "trivial" problems have complications once I saw it was about zip-codes. :)

A few reasons I've seen where assumptions about how zip-codes work lead to not taking money:

Ireland - no zip-codes (outside Dublin) - dont do mandatory fields

UK - numbers and letters - dont assume only numbers in zip-code

Brazil - 9 digit codes - dont assume max of 6 or 8 characters

<comment><USER46> I'm always annoyed by forms that make "state" a required field. Yes, my country does have provinces, but they're utterly irrelevant to any kind of address or other info.

<comment><USER50> I live in Shanghai. China does have provinces, and they show up in your address. Shanghai isn't part of one; it's its own division of equal rank. Amazon requires a "state", though, so I had to have things sent to myself at <street>, Shanghai, Shanghai China.

</comment></comment></comment><comment><USER51> It's amazing what a comment and a couple of unit tests could have prevented.

</comment><comment><USER52> >Anything with fewer than three digits is supposed to be an invalid code

So then why if your code is outputting "57" to the input "57" while the librarian's cleaner and more reasonable solution gives you "00057", why is yours more correct? Shouldn't the function work something like

if digits.size<3 raise 'Invalid zip code'

digits.rjust(5,'0')

</comment><comment><USER53> The thing that always bothers me is that programmers throw around their own opinions like its their divine right. As if they are unappreciated artists.

Its a craft yes, but really its also a logical profession. Strongly held opinions suck all the joy out of conjuring bits to do your bidding. Can't we all just get along?

<comment><USER54> > Strongly held opinions suck all the joy out of conjuring bits to do your > bidding.

I'd say just the opposite. If you care about programming, you care about doing it the right way. The people who don't have strong opinions are generally the people who don't care, and don't enjoy their jobs, and don't produce good results.

<comment><USER55> There is a point where having strong opinions results in so much bickering that nothing gets done. Part of doing something the right way is reserving arguments for when they matter.

The solution is to have strong opinions, weakly held.

</comment></comment></comment><comment><USER56> Hehe, it's not often that you see the comments to an article prove its point so strongly ;-)

</comment><comment><USER57> Not sure why these are considered different coding styles. Besides the rather contrived examples of arguments regarding the right way to do things, this seems like standard refactoring.

</comment><comment><USER58> the lesson here is don't refactor known good code.

when you do so you introduce a risk of breaking it through lack of understanding.

more generally it introduces a potential point of failure when you refactor code. as with all things that introduce the potential for bugs and errors it should only be done if that chance seems less than the chance that it will fix a known issue of greater severity...

</comment><comment><USER59> If I had a nickel for every time I've heard "Why did you do it that way?"

Usually, it's because the simplest solution is the best one.

</comment><comment><USER60> Ruby is the perfect language for such a parable given its multi-paradigm nature and community's cultural obsession with aesthetics.

</comment><comment><USER61> >"Hey," he asked, "What happened to that piece of code? It was for zip codes, it was only supposed to pre-pend one or two zeros when importing zip codes from CSV files. Anything with fewer than three digits is supposed to be an invalid code. Empty strings shouldn't be converted to five zeros, as far as I know."

This is what comments are for, people!

<comment><USER62> Exactly, the proper response should be "Then why the fuck didn't you write _that_ down when you wrote the code?"

People not documenting the code's intention bring down the whole project. Sure, sometimes the code _may be_ right, but without documentation, you can never be sure... It inevitably results in a trust-no-one environment where you can't change a single line safely because it might be doing something else: the weird side effect might be used in some other module, or it's sanitizing data from library X that's no longer used, but nothing is documented anywhere, so you never know.

</comment></comment><comment><USER63> So agnostic code has a bug since doesn't raise an Exception in the else clause?

Anyway the others changed the algorithm, interpreting what they believed it should do. That's something unavoidable sometimes due to convoluted code and lack of documentation, but not in this situation.

</comment><comment><USER64> sometimes small differences have massive implications. consider: immutability.

</comment><comment><USER65> tl;dr chaos ensues because weird code was not documented.

</comment><comment><USER66> Librarian FTW

</comment><comment><USER67> I think there's a straw man here.

I don't think any sensible person from any paradigm would have objected to the code as it was originally written. The substantive arguments between paradigms happen at larger scales of code organization.

So it comes across to me that the "agnostic" is trying to make other schools of thought look ridiculous. The trouble is he's done it by cheating.</comment>