7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 15y ago · link · parent
Never is a long time.
It's fairly easy for low-skill developers to write code that's time-consuming for high-skill developers to understand. In fact, making simple things hard to understand is pretty much the definition of bad code.
So, you use your judgement. If it's a particularly subtle and important part of the code, spend the extra time to make sure you're not missing anything. If it's not, then just rip it out and don't waste time in a maze of strange control flow, redundant code, useless invariants, and confusing assumptions.
comment 15y ago · link · parent
I just hope that I don't indirectly end up involved in this through my 401(k) or something.
comment 15y ago · link · parent
Usually any communication has two parties. So, you can collect information with neither party consenting (phone hacking, wiretapping, etc.), one party consenting, or both parties consenting.
I would think that most of the information they collect would count as one party consenting, so it's a step up from phone hacking. But it's still worrying, of course, because the single consenting party often doesn't know they are consenting (whether they should know or not is a different matter).
comment 15y ago · link · parent
What I would have appreciated was an article that took a step back and offered something more general about human nature, history, social movements, banking, various conflicts of interest, relationships between large corporations and government, small business versus large, etc.
I haven't really been following the protests, mostly because I'm waiting for them to start suggesting concrete actions and plans (which can take a while; I'm not disparaging them for not having a plan on day one). And even with essentially a blank slate, I read that article and learned nothing.
"My favorite comment this morning is geebee's"
While an interesting point, there are two problems: the comment format is not long enough to really flesh out an idea like that; and it's still well off-topic for HN. Regardless, every political discussion will elicit some insightful comments. There are plenty of other places to get something like that.
Anyway, it's pretty obvious that people wanted this discussion to happen here. The downvotes pretty much proved that I was wrong about the scope of HN.
comment 15y ago · link · parent
This is an honest question: is hacker news the place for that criticism? Of course, a site like hacker news is defined by its readers, so if you say "yes" you are at least partially right, and maybe entirely right.
It's just that I thought HN wasn't that kind of place.
comment 15y ago · link · parent
So, I wrote what I thought was a very innovative peer-reviewed feature to a prominent open source product, which took me a long time. Then, I carefully wrote an article about it and submitted it myself. It fell off the front page very quickly. That's OK -- maybe someone will think my next feature is interesting. But these things take me a while to do.
So, I'm really more puzzled by your comment than anything else. I write some truly new content (in every sense) that is highly applicable, and that gets little interest. A political op-ed piece gets upvoted. And then you criticize me for not contributing to the discussion.
comment 15y ago · link · parent
No association at all.
"This has ramifications for us all, most certainly including hackers."
By that reasoning, we should just post any political op-ed we happen to agree with, and we can just upvote as practice before the polls open. It's just not hacker news, or not what HN used to be anyway.
"I disagree that Krugman's piece is overly partisan"
I didn't say it was overly partisan. I said it was partisan. That's perfectly fine -- nothing wrong with being partisan. But it's just not the kind of thing I come to HN for.
comment 15y ago · link · parent
Oh well, I guess I'll stop coming if that's the way this site is going. I'm sure you won't feel any sense of loss. But I think something was lost -- a site where we could set aside these kinds of things and focus on the details objectively, or perhaps some personalities and interests that are more related to hackers and technology.
Perhaps Krugman has done some great research, etc (I don't really know). But this wasn't a link to his research or some summary thereof. This was just a run-of-the-mill political op-ed with no real economic analysis to it. No thanks.
comment 15y ago · link · parent
It's hardly news, the protesters have been there a while. And it's not an objective analysis of the economics involved -- in fact, there's hardly any economics in there at all.
Sure, he's a Nobel laureate. But this particular piece by him is clearly partisan. He calls parties and politicians by name.
Is this what Hacker News is going to turn into? Linking to partisan political columns?
comment 15y ago · link · parent
Well said.
NoSQL may have a lot to offer in some cases, but I think "easy" is an illusion when you look at the full picture.
comment 15y ago · link · parent
They don't owe any taxes if they keep the money outside the country.
People tend to think of taxes like "skimming" off the top, and like some kind of inevitable thing that doesn't affect your decisions. But that is the wrong way to think about it: when taxes are high enough to have a significant impact, they do affect taxpayer decisions.
You seem to be saying that they should keep making decisions as if there were no taxes, and then pay high taxes because of those decisions. But that's completely unrealistic.
When taxes are higher than a trivial amount, the correct way to think about them is as policy that will have lots of effects; some obvious and some not obvious.
comment 15y ago · link · parent
What about cell phones, and the communication revolution in general? While I'm at the park in the US, I can call someone in Europe riding on a train. Or, I can take the same phone to Europe and call someone back home. That's pretty amazing, if you ask me.
What about free/open source software? Someone can start a business with almost no capital at all, and get an operating system, an office suite, a web browser, and sophisticated database management software. And they don't even need to tell anyone that they are doing it. And when they need something better, they can fix it themselves or hire someone to fix it; they don't need to deal with the original vendor. That's just the business side of things -- the educational aspects of free/open source software are just as compelling.
I guess the problem is that none of these things are as impressive to look at as a 500-ton rocket.
comment 15y ago · link · parent
That's what errors are for, not documentation. It is pretty easy to forget something in the group by, and documentation won't help with that.
The dangerous thing is that the result returned from such a nonsense query looks valid in many cases, while being wrong in subtle ways.
PostgreSQL detects when the query is valid, and executes it if so. So, if you do a GROUP BY customer_id (a key column), you can also see customer_name without adding it to the GROUP BY list. But if you group by customer_zipcode (not a key), and try to select the customer_name, it will throw an error.
comment 15y ago · link · parent
The person to whom you replied did not say that. I read it more like "Oracle can mess up MySQL if they want, because we still have this great alternative called 'postgres'".
"without ever addressing the actual needs of the vast majority of MySQL-users."
Your comment struck me because I still have a piece of paper next to me with a list of all of the complaints and feature requests I saw in various discussions around the time of the postgresql 9.1 release. That doesn't mean that every single issue you have is addressed yesterday, but a lot of development is happening in response to the needs of the MySQL community.
The most obvious example is replication (9.0, but improved in 9.1), but there's also per-column collation. And you might also consider unlogged tables to be targeted at typical MySQL use-cases. And 9.2 is likely to have index-only scans (covering indexes), for which a patch has already been posted by Robert Haas -- I happen to know mysql users who have been waiting for that feature alone, but it took some groundwork development starting in 9.0.
Can you please cite something specific that you feel is not met or being addressed, so that I can add that to my list, too?
"touting 'advantages' that are completely irrelevant to them"
Well, they might be advantages to somebody -- they were developed for a reason. Postgres folks who have done something interesting like synchronous replication or K-nearest-neighbor indexing aren't going to whisper quietly about them.
"If they ever migrate to a different DB, it's more likely to be a MySQL-fork"
It's hard to get exact numbers, but a common theme at postgresql user group meetings is people migrating from mysql to postgres or mysql people starting their next project in postgresql. There was a noticeable uptick after 9.0 was released.
"than please stop pointlessly pissing on MySQL at every available opportunity"
People come here to learn new things and see (and take part in) progress. Please stop declaring the discussion over ("...we already know...nobody is debating that...") and products like MySQL good enough ("...it just works...").
comment 15y ago · link · parent
The most striking difference[1] is probably the cost-based optimizer and the availability of a lot more execution plans. Most often cited is that MySQL has no hash join, but there are lots of plans that make a huge difference in execution time, and (for the most part), mysql just doesn't have those execution plans available.
And these are algorithmic differences. Typically, you think of optimization as something that does your same algorithm, just a little faster. In a SQL DBMS, optimization means choosing a better algorithm.
And it's hard for MySQL to add new algorithms because it doesn't have a cost-based optimizer, so it would have no idea which ones to choose.
[1] There are lots of other differences, but sometimes differences aren't easily represented as convincing "check-mark" features. So I really think you are asking the wrong question. The right question is: if I were making non-trivial application XYZ in postgres, how would it be done (from both dev and operational standpoint)? And is it easier to develop and smoother to operate if I do it that way?
comment 15y ago · link · parent
The systems are quite different; I don't think it was ever really about preference -- it's more about the approach you take to development and operations.
It's hard to point to any one thing that you might find useful in postgres without knowing more about the kind of projects you work on. But if you start to do things the postgresql way, then I think you'll find some things that make development much easier and operations much smoother.
"Better" is a loaded word; but if developing a new application, I think it's a good idea to default to postgresql, and only use mysql if you have a specific reason (and there are a few good ones). I've been a postgresql community member for a long time and use postgresql much more than mysql, so take that opinion with a grain of salt.
comment 15y ago · link · parent
I disagree, in the general case at least. For one thing, you need to decide the granularity of "feature". It can be anywhere from the entire project to a single line of code. It can actually get even more specific when you start talking about combinations of things as a "feature".
If you try to apply a "only 5% of users will use this" rule to any significant project, I think it will quickly start to feel incomplete. Users can tell. They develop expectations about the features that should be present in a certain class of application. When they come across a need for the feature, even if very minor, they will be very frustrated if it's not present. That frustration will destroy the user community.
Another thing is that often software is bought in bulk for an organization. The accountants will demand support for X in the standard software package, and IT will demand Y, and pretty soon you need a full-featured product. If you say "only 4% use X and only 3% use Y", and eliminate both, then you've just lost an entire organization worth of users.
If you're a startup or have a new product, then I'm not saying you need to reach that level of maturity before 1.0 release. But when your product gets big, you will need to invest in this kind of completeness.
comment 15y ago · link · parent
I don't think that's the intention. Think of column collation as the "default" for that column, and you override it with the COLLATE clause. So if most of your ordering/range queries are based on american english, set the column collation to "en_US", and when you have a query that requires french ordering, then use the COLLATE clause by the column reference, and the ordering will change for french.
I agree that SQL makes all of these things more confusing than they need to be, but supporting the standard for this concept has some value.
"CREATE INDEX my_index ON my_table (a english_collation_ops);"
I'm not sure if you're aware of this or not, but CREATE INDEX accepts a COLLATE clause in addition to the operator class. So the collation is kind of an extra parameter to the operator class (or something like that).
So, it's not a question of capability, because I think the capability you want is readily there. However, if you are saying that it's more confusing than it needs to be, then I agree.
comment 15y ago · link · parent
In other words, it could show simply a greater variance in income within individual lifetimes rather than a greater variance in income between people.
For instance, if people spend more time at school, but their incomes a few years after graduation are much higher, that would appear as a quintile disparity because they spent years in the bottom quintile (college and just after graduation), and then jumped into one of the top quintiles.
Similarly, as skills become more important, then (whether you go to college or not), you'll spend more time at low pay before your skill level matures, and then your income will rise rapidly.
Also, income is not wealth. Upper-middle class and rich people often spend a lot of time in the bottom quintile (unless they are so rich that they have a lot of passive income).
I'm not saying there isn't a problem. I don't have the data. But that particular measure is quite deceptive in my opinion.
comment 15y ago · link · parent
The point of an economy is not to spend money, it's to create more wealth for more people by allocating resources efficiently. If someone "hoards" money, and prices are stable, that person is effectively staying out of the resource-allocation business. It doesn't mean that there are fewer resources to allocate, it just means that other people are doing the allocating (even though those people collectively have less money because of "hoarders", prices are lower because of them, too).
You can make an argument that everyone needs to take part in efficiently allocating resources, and that makes a lot of sense. But to say that buying a bunch of consumer junk is a good way to do that is ridiculous (and bad for the environment).
A middle ground is to buy the things you need, a few things you want, and make conservative investments. That allows most individuals to mostly stay out of the resource allocation business, but still enjoy the benefits.
comment 15y ago · link · parent
And at least you end up with educated people and the fruits of engineering work. The alternative is giving up: "I might as well not learn anything very useful, because there might be a period in the future where it's not so useful for a while."
comment 15y ago · link · parent
It happens that Solaris, FreeBSD, OSX, and windows (yes, windows) have taken a good, strong step forward to address this issue. Unfortunately, linux is behind. I say that mainly to show priorities -- one would think that any feature that fundamentally makes applications easier to write would be the top priority of an OS.
comment 15y ago · link · parent
However, there is some kind of a point here, which is that applications shouldn't be forced to deal with all kinds of error-prone methods. For instance, I think that filesystems are more low-level than most applications should have to deal with, and the hierarchical structure more often represents some arbitrary imposition than a useful organizational technique. It's 2011, and linux still doesn't offer a stable filesystem with snapshotting/versioning, CRCs, atomic operations, etc. Soon btrfs may be here, but it will be years before it's widespread enough for application developers to count on it, and the basic posix APIs won't make it easy to actually make use of these things.
comment 15y ago · link · parent
That doesn't solve the problem, or it is at least an oversimplification. How do you ensure that you are only writing out valid states, and not some state that is temporarily invalid (i.e. in the middle of some operation)?
I'm sure there's an answer for that, but that seems like totally the wrong direction. That's what a DBMS is for, and/or a modern filesystem with DBMS-like features.
I think that DBMSs and the fancy features in new filesystems are underused by applications. Perhaps that could be improved through greater standardization of the way to access basic ACID guarantees. Or, perhaps OSes should have these things more built-in and the lower-level APIs that are tricky to get right should be more obscure.
In any case, an oversimplified notion of persistence does not improve matters. Virtual memory just seems like the wrong place to solve these problems. How do you do a "rollback" of some operation when it's a direct modification of the in-memory state? (Note that a rollback is not the same as going back in time -- a rollback surgically undoes a single operation without affecting concurrent operations). If nothing else, a program bug can do a lot more damage (sometimes subtle and not detected for a while) within its own address space than it can to data already held by a separate program (like a DBMS or the kernel's filesystem) with its own consistency guarantees.
I think one of the most common software engineering mistakes is to not understand the role of a DBMS in application development, or to drastically oversimplify it (usually leading to a bad reinvention of the DBMS). The reality is that most applications would be greatly simplified by using a full DBMS (typed data, etc.), and almost all applications would be greatly simplified by relying on ACID guarantees.
comment 15y ago · link · parent
Unless someone is writing, of course, in which case you have to worry about isolation. So a single writer would block all readers, right?
"You mean a bug in our code that causes a problem?"
No, I mean like "I already wrote some data, but now a constraint has been violated so I need to undo it".
comment 15y ago · link · parent
What about transaction isolation? How do you keep one transaction from seeing partial results from a concurrent transaction? Sounds like a recipe for a lot of subtle bugs.
And all of the assumptions you need to make for this no-DB approach to be feasible (e.g. fits easily in memory) might hold at the start of the project, but might not remain valid in a few months or years. Then what? You have the wrong architecture and no path to fix it.
And what's the benefit to all of this? It's not like DBMS do disk accesses just for fun. If your database fits easily in memory, a DBMS won't do I/O, either. They do I/O because either the database doesn't fit in memory or there is some better use for the memory (virtual memory doesn't necessarily solve this for you with the no-DB approach; you need to use structures which avoid unnecessary random access, like a DBMS does).
I think it makes more sense to work with the DBMS rather than constantly against it. Try making simple web apps without an ORM. You might be surprised at how simple things become, particularly changing requirements. Schema changes are easy unless you have a lot of data or a lot of varied applications accessing it (and even then, often not as bad as you might think) -- and if either of those things are true, no-DB doesn't look like a solution, either.