Better HN
topnewbestaskshowjobs
Log inSign up

programminggeek

5,207 karma · joined May 21, 2010 (16y ago) · 1,593 submissions

I am a builder. I build lots of things.
Submissions

comment 13y ago · link · parent

I like Luvit, but what makes node so awesome is people wrote evented drivers for databases and such. I'm not sure that there is a community there to do that again in Lua. Also, the openresty approach seems like an interesting way to get high performance web lua without writing evented code.

comment 13y ago · link · parent

hypermedia APIs mean that our API's basically become web pages and every client should act like a browser. That's great if you want... a browser app.

If you want to just expose data to let people build interesting things with it, hyperlinks in your api are a bit silly. They might be nice if you want someone to write a browser for your api, I don't see where else it would be awesome. Maybe if you want a web crawler to crawl your api.

Also, they add a layer of chattiness to your app. If you have well documented, unchanging url's people can write apps against those. If people have to go to a resource to find the url to another resource, you're going to have a lot of API requests just to look up URL's. People will realize that is a waste of bandwidth, and will hard code URL's anyway.

I rarely agree with DHH, but he's right.

comment 13y ago · link · parent

This doesn't need to be a Rails feature. Rails is for building web apps. There is a whole bunch of extra stuff Rails does that a web api doesn't need to care about. So, it really doesn't need to be a mvc web app framework feature.

Also, why tie this idea to Rails at all? Why not just make your own plugin or Sinatra app or frameowrk or whatever?

comment 13y ago · link · parent

I think this is actually a bad thing because at a certain point it discourages innovation and the creation of new things because competitors will just copy whatever you create. I'm not for patent trolls making money for simply owning someone else's invention, but I feel like if you invent something, patent your invention, and build a real product around that invention, then the patent should be upheld.

Otherwise, you might as well cut most R&D spending and focus on reverse engineering. Getting really good at following fast is probably a lot cheaper than getting really good at inventing new things that turn into products.

Also, then you could spend a smaller fraction of money to "acquire" (through various means) the schematics and trade secrets and produce your own version of the next big thing. Sure, that is probably unethical, but without any semblance of protection via patents, trademarks, other IP law, it seems like that is what you would get.

That being said, as it gets cheaper to distribute information and turn that information into physical goods, the amount of value in the production of physical goods is going to approach the cost to manufacture those goods. There will always be some money in service, repair, etc. but a lot of things value will be destroyed along the way and it is not yet clear if that is a net positive for society at large.

comment 13y ago · link · parent

Am I the only one who thinks that tying your model to the database is a bad idea and that adding "concerns" doesn't fix that fundamental problem?

comment 13y ago · link · parent

An Amazon phone is only interesting if it can do something interesting with phone plan pricing, but with all the strides that have been made in prepaid phone plans, Amazon could really do something interesting.

A $200 phone with a $10, $20, or $30 plan would probably do well. They could resell AT&T, T-Mobile, Sprint, or even Verizon like Straight Talk, Net 10, and Virgin Mobile USA so.

Prepaid is starting to hit a much more mainstream audience with smartphones, so Amazon could time this really well.

comment 13y ago · link · parent

HTML5 is cool and you can do a lot with it, but it has some very real drawbacks - like Android.

Also, if you are doing a bunch of optimizations to make it fast on HTML5, then you're basically doing the same work as writing a native app, so what are you gaining by doing a HTML5?

Seriously, at some point you can get a better user experience, have better access to native API's and can really leverage the full abilities of the device by going native. So, you know, go native.

Disclaimer: I have wrote HTML5 mobile apps and I think it's a great developer experience, but it feels worse as a user.

comment 13y ago · link · parent

Dell doesn't design hardware, it assembles it. Mobile phones are more about hardware design than assembly. Thus, it doesn't play to what Dell does at all.

comment 13y ago · link · parent

Oh sorry, and yes, you are right. It's kind of a screwed up system either way.

comment 13y ago · link · parent

4S was basically the best phone on the market until the 5 came out. 5 comes out and is the best phone on the market and now the 4S is cheaper and the 4 is "free" on many carriers.

For many people the 4S and 4 are beyond "good enough" and would save $100 by buying the 4S instead of the 5.

That being said, cheaper products tend to sell in higher volumes. How is this news?

comment 13y ago · link · parent

Maybe you don't understand. It takes 0 customer support to add 2 factor auth and lock out the original user. It takes several emails and support requests back and forth to finally get it sorted out. Also, maybe a few phone calls. If that happened to your google account, it would be INCREDIBLY unpleasant.

comment 13y ago · link · parent

Ok, I'm in. I have an idea that will cost precisely $37 dollars to start. This is such perfect timing.

comment 13y ago · link · parent

Yes, basically that, but using solar/wind to power the pumps, turning the lake into a giant battery to store the energy from the solar/wind power, which seems to be one of the major drawbacks of wind/solar.

comment 13y ago · link · parent

This is probably a bad idea, but couldn't you store energy basically having wind/solar power water pumps to pull water from one location to another? Something like 2 lakes side by side with a dam in the middle pulling energy off the transfer between when energy is needed and then water being pumped back in the reservoir when energy is being claimed from wind/solar?

comment 13y ago · link · parent

After being a WoW user, I think two factor auth only works if it is forced on all accounts.

Here's a scenario that plays out in WoW all the time and it happened to me. Basically, a user quits playing WoW and their account gets hacked at some point after they quit. The hacker then turns on 2 factor auth via the WoW authenticator app. It is now impossible for the original user to log in to the account or reset passwords. To fix this you must argue and explain with customer support that the account was hacked an that the 2 factor auth is preventing you from resetting passwords and such.

So, unless you turn on two factor auth up front for all users, it's going to actually make it worse for the end user if their account gets hacked. So, like captchas, it's solving one problem and creating another for the user. I'm not sure that is the best solution.

comment 13y ago · link · parent

To be fair, part of Amazon's stock price is the incredible durability it has shown as an internet company. It's one of the few companies that survived the .com bubble. Also, it's growing and innovating in about every direction. Five or ten years ago they were an online bookstore or an online store. Now they're an online marketplace more akin to eBay. And they almost singlehandedly made digital books relevant. And they are powering the infrastructure of huge companies like Netflix, Zynga, etc. And they have the most popular Android tablets. And... And... And...

Amazon's customers love them.

comment 13y ago · link · parent

Advertising based businesses are 100% about scale because making money with ads is about math. Take a CPM of $10. To make $10,000,000 you need 1,000,000,000 page views. Figuring each user views 10 pages (which is probably high), you are now down to something like 100,000,000 user sessions. Now, figure each user visits your site 10 times a month (which would be a pretty site), you're now down to needing 10,000,000 users a month to make $10 million a month. That is a per user value of $1 per month or $12 a year.

Now, compare that to a SAAS that charged $25/month/user. You're now talking per user revenue of $300 per year. It's a lot easier to build a company at $300/user/year than $12/user/year.

To make $10 million a month at $25/user a month you need 400,000 users. That's still a big number, but it's probably easier to reach 400,000 customers than it is 10,000,000 users.

comment 13y ago · link · parent

I think people looking at the Newsstand or apps for publishing are missing the point. It's not about formats or delivery mechanism. It's more of a fundamental business problem.

I knew magazine apps were doomed when there was talk about how beautiful the ads would be in them. How they could faithfully reproduce the fantastic advertising in the print editions of the magazines.

Media was able to charge both a subscription fee to the consumer and an advertising fee because they had high barriers to entry and a captive audience. People fundamentally don't want ads in their media, but media companies have made so much money for so long charging on both ends that they forgot why they were able to do so - there was a high barrier to entry.

Now that technology has made the barriers to publishing $1,000 or less, there is a shift in business model. Either the media should be free and ad supported, or paid with no ads. There just isn't the same market for something that does both anymore. Their answer thus far seems to have been "just add more ads" or "put up a paywall in front of the ad-laden content".

Also, with fewer barriers to entry, there will be fewer big content companies, and a lot of smaller ones. The economics don't make sense yet for a big media company that is Newsstand only yet, but there will probably be a lot of smaller, scrappier publishers like The Magazine that pop up.

Again, it's not about The Magazine having some formula right, or its publishing platform being so amazing. It's that the business model and economics of publishing have changed and The Magazine is a lot closer to that reality than traditional publishing companies. One could make the same argument about Redbox and Netflix compared to Blockbuster and Hollywood Video.

comment 13y ago · link · parent

I am quite fond of Heroku. It solves a lot of things for you and makes it more obvious that you should decouple things and use other services from the get go.

The time you spend doing sysadmin things could be spent writing code or otherwise growing the business.

Also, as you grow you aren't going to need to hire a bunch of sysadmins just to build, manage, and deploy more infrastructure. Saving even one $60,000 a year employee buys you what, $5,000 a month in infrastructure? That's quite a bit on Heroku + various addons.

comment 13y ago · link · parent

Nothing is stopping Microsoft from having a web presence that people use to purchase things at. Apple might be going a bit overboard to force their payment system as the "one true payment system", but it's also a lot better for the average user in most cases, which is what Apple builds for. They don't support many corner cases. Android does. Nobody is forcing you to have an app on iOS right?

Also, the process for setting up a dev account on Apple is far more pleasant than for the Windows 8 store. Also, Microsoft won't even let you publish Metro apps outside of the MSFT store, so who are they to complain about vendor lock in or requiring a cut of purchases and such?

comment 13y ago · link · parent

I don't think webOS is going to get a second chance for similar reasons that BeOS never got a second chance. Even if it has a lot of great ideas, apps, whatever, the groups who should be interested in webOS are using Android.

Look at China, there are some mobile phone companies in China that could take webOS and make it really awesome and sell to millions of customers, but they are busy building Android phones and are working on building Tizen. Mozilla could have taken webOS and built on that, but instead they are doing their own OS.

HP itself doesn't even seem to care about webOS, so it's hard to convince anyone else to do so either. It seems like webOS, Meego, bada, and all these other OS's are going to end up in the footnotes of the smartphone revolution similar to the many desktop PC os's that never quite took off.

comment 13y ago · link · parent

Have you seen the new iMac?

Now, imagine apple making that thin and beautiful of a screen at 32", 42", and 50". They could price them at $499, $749, and $999. People would buy that.

There are 2 things they could do to really pull people in - make TV easy and put iOS apps on your television.

Make TV easy - have a beautiful UI that makes it easy. Less clutter, easier to read channel guide. Simple setup. Etc. Maybe channel search via Siri. "Siri, I want to watch Fringe." And Siri finds you that episode via maybe a built in DVR, Apple's catalog, Hulu plus, or the cable company's on demand stuff.

iOS apps on your TV. Seriously, $1 games on your TV. Even $6 premium games like Infinity Blade. Compare that to $60 games like Halo 4 or even "cheap" Xbox 360 games at $15 or so. People would go bananas for that. The trickiest part for apps is the control mechanism, but for games, most of them could be made to use a game controller similar to what OUYA is doing.

If Apple can get those two things right, they will be able to charge a real premium for a TV. The reason TV's have low margins right now is that they have no value adds or differentiation. It's hard to justify spending $1,000 on a "smart" tv when a $400 tv has the same picture quality for the most part and every $50+ add on box and blu ray player has "smart tv" apps like netflix, hulu, amazon video, picasa, etc...

comment 13y ago · link · parent

The real problem for AMD and Intel is that ARM chips are too cheap and have better power profiles. As ARM chips hit that sweet spot of say 2 GHz and say 3-4 cores, they'll hit laptops and it will be game over. Why would a company pay $100 for an AMD chip that is a 50 watt or 100 watt chip when an ARM chip might be 5 watt and $10?

Once chips hit the "good enough" threshold where they perform well enough that the average user doesn't notice the increased performance, it becomes more of an issue of economics and $10-15 ARM chips are at a huge advantage over $100+ chips from AMD and Intel.

Also, Apple is certainly working on an ARM version of full OSX (as iOS is already basically OSX on ARM), Android obviously runs on ARM, Linux runs on ARM, and WinRT runs on ARM, so all of the major OS's can/do support ARM. Thus, there's not a major barrier software wise for ARM, it's more of a performance barrier, which won't likely last more than 3 years.

To AMD's credit, they're working on ARM for servers, but ARM is going to eat their whole business, so they need to move as fast in that direction as they can afford to. x86 is going to die a lot faster than anyone could imagine.

comment 14y ago · link · parent

Well, maybe it's my personality, but I expect people to be basically honest. I realize people lie constantly, but why should we believe anything that they say if we assume they are lying?

As in, if I believe that Steve Ballmer is lying about the iPhone being an overpriced product that won't sell, why should I believe him when he says that Windows Phone will sell millions of devices and that it's worth developing for?

I realize that nobody wants to admit that their competitors are making a good or better product than you, but I don't see why they wouldn't be willing to tell the truth.

Maybe it's a midwest thing, but if we assume that Jobs, Ballmer, and Rubin are all lying through their teeth, why would we ever buy their products? That is even dumber than believing they are telling the truth. The only thing dumber than trusting someone is buying from someone you don't trust.

comment 14y ago · link · parent

I totally understand what you mean.

I've gone to great lengths to determine what kind of architecture is needed to truly support TDD and what I've come to realize is that it's not so much about over-abstraction that is the problem, it's that testable code is pluggable, which is mostly at odds with how systems are designed.

For example, standard MVC apps tend to tie models to an ORM in some way shape or form. Think Rails and ActiveRecord and you'll understand what I mean. This makes writing a simple crud app fast, but testing it sucks because you have 2 things tied together - your actual data models and your database layer. Funny that nobody would ever do that with the filesystem, but it's super common with the database.

To make your models clean and easy to test, you need to pull out the ORM bit into something more pluggable.

The same principle applies to writing testable biz logic. A lot of times people don't know where to put it so it ends up in the View, Controller, or Model. All of which are the wrong place usually. Testing that code becomes not awesome because you then have to write a test against what the view outputs, the controller does, or possibly what the model is doing (usually by touching the database).

The answer I've found is to pull your business logic into a separate container that can be tested easily apart from any MVC structure.

None of this means you need to over-abstract anything. It just means you have to figure out the right abstractions and structure for the right layers. None of this is by any means obvious at first.

P.S. I'm working on an architecture framework that simplifies a lot of this to make doing TDD much easier.

comment 14y ago · link · parent

It's worth noting that Ballmer has publicly laughed in the face of two of the biggest innovations in the last 5 years - the iPhone and the iPad. Now they're racing to catch up.

It seems like Ballmer, Sinofsky, and Gates pushed out people building products along those lines - J. Allard and co. only to pick up their vision later with Metro UI and Windows 8. (J. Allard and his team were behind Xbox, Zune, and Courier which basically gave a roadmap to Metro UI, Windows Phone 7 and Windows 8. J Allard also wrote a famous memo about internet connected apps back in 1994.)

Sinofsky and Ballmer also pushed out Ray Ozzie who was trying to make cloud computing a meaningful part of Microsoft's future.

Now that all the big vision is gone, where is Microsoft going to go? Continue to be a fast follower of Apple and Google?

Microsoft is a company without vision because it already achieved what it set out to - a computer on every desk. They won that battle. In the meantime, people's desks already have computers on them and are putting computers in their pockets, purses, and appliances. Microsoft was too busy with traditional computers to have a vision for mobile computing.

Maybe Microsoft should change their company goal to a computer in every pocket. Or a Microsoft app on every home screen. Or every computer to be powered by Windows. Or maybe a computer on every surface.

Without a big goal, Microsoft is going to be just another big tech company like IBM. It won't change the world again. It already did. Now it's just following everybody else.

comment 14y ago · link · parent

TDD is awesome, if you have a codebase or a tech stack that makes it nice. TDD will quickly expose bad design through an unpleasant testing process. For example, slow tests, untestable code, or tests that you "always have to rewrite/maintain" are problems that only show up when you try and TDD your code that isn't designed to be testable.

TDD doesn't work well if you don't design your code to be testable because you very quickly become frustrated by the problems TDD uncovers.

1. Slow Tests - If your tests are taking a long time, it's probably because your code isn't written to be tested easily.

For example, if your code is hitting the database a lot and it starts to take minutes or hours to run your test suite, your code has a problem. For example, if your entities/models are coupled to an ORM like ActiveRecord, testing those is going to suck because they probably sholdn't be coupled to an ORM. Many people try to fix this by writing frameworks that make testing their code easier instead of writing better code that isn't tied to an ORM.

Tests should be fast. Most of the time they don't need to hit the DB. Slow tests make TDD suck. Avoid slow tests.

2. Untestable Code - I've run into this a lot and it sucks, especially in languages that lend themselves easily to untestable code (In my experience, that's PHP).

Until you try to test your code, you don't realize how untestable your code is. A lot of things that seem like reasonable design decisions are so untestable, that you end up doing incredibly lazy integration tests because to fix things you have to rewrite whole portions of the system.

I've been there and it sucks. The choice seems to lie between rewriting the whole system on the same platform to be testable one chunk at a time, or to rewrite the system in something that lends itself better to testing.

In either case, the answer is to take the time to learn how to write testable code. To start learning techniques like Dependency Injection. To practice writing portions of your system using TDD to see what works and what doesn't.

3. Maintaining Tests Sucks - Actually, if you don't want to maintain a test suite, don't write one.

At its core, your tests are a specification of how your system should work at a given time. When they start breaking it means your system has likely changed, so either it should be fixed to match the specification, or the specification should be changed to match the appropriate system behavior.

At a fundamental level, tests aren't something you write once, they are something you constantly rewrite to keep them in line with what your system should be doing. Thus, when they are broken, you know that either your specs need to change or something in the code isn't working right.

Test maintenance is a price you pay for wanting higher quality software. It's the same kind of cost you pay in designing a building with blueprints. If people build a building without following the blueprints, it's not going to be the building that was supposed to be built. Tests are a living blueprint of your system. If you aren't willing to treat it that way, TDD isn't going to help you.

TDD isn't for everyone because not everyone is willing to make those kind of investments in code quality and maintainability. Also, TDD doesn't make your code better if you aren't willing to let it make your code better.

comment 14y ago · link · parent

Well, once robotics takes over a large portion of Foxconn, it won't make as much sense to hire low wage employees overseas, thus why not have the robots building/assembling the products as close to the consumer as possible?

Apple spends a lot of shipping too, so I'm sure it's a balancing act between cost of labor/automation/shipping.

comment 14y ago · link · parent

In the section "What about attribute names?" I think they get it wrong by saying that camel case would be better than snake case because it would make more sense in Javascript that way.

The issue I take with that is you can't assume your API consumer is using Javascript at all. Thus, making it camel case might look right in Javascript or many other languages, but weird in Ruby.

There are a lot of good ideas here, but I think the author messed up on that assumption. A huge portion of modern API usage is in Objective-C, Java, PHP, Ruby, C#. So, attribute naming could be valid as FooBar, fooBar, or foo_bar.

I think the right point would be to be consistent in attribute naming style. Pick one format and use that.

Designing your API to be consumed by one language is mostly foolish unless you are the only one using the API.

comment 14y ago · link · parent

Because it's awesome?

I personally started using git because github made setting up hosted version control so darned easy and nice. Also, I hated using SVN from my work life experience, so I knew I didn't want to use that on my own projects.

Once I understood the power of git branching there is no way I could ever go back. Also, I tried mercurial and it always felt slower and "worse". Git commands might be cryptic, but it's always felt faster and had a community around it that makes better tools for it.

1
414243
54