Better HN
topnewbestaskshowjobs
Log inSign up

CodeMage

6,801 karma · joined Feb 26, 2009 (17y ago) · 1,367 submissions

Submissions

comment 16y ago · link · parent

I've worked with OOP a lot and I've also used FP, although less than OOP. In my experience, what you're saying is both right and wrong.

It's right, because FP really is fun and it really is just the way you describe it. But it's also wrong, because you believe that OOP can't be like that. It can.

Aggressive, continuous refactoring as a coding "process" (I hate using such an overloaded, overused word) is not exclusive to FP. Nowadays, I do my best OOP coding just like that, whenever I have the luxury.

And it really is a luxury. As soon as your code is "out there", available for the rest of the team to use and rely on, your days of aggressive, continuous refactoring are numbered. Unless you want to be known as "that guy who keeps yanking the rug from under our feet all the time", you have to settle down into the boring old routine of "I know this might not be the best way to do it, but I can't touch that other thing right now". Show me a team with two or more members and I'll show you bits of code left as a "compromise".

comment 16y ago · link · parent

None of those comparisons really matter in this discussion, except Java, which is clearly out of the competition anyway. Why? Because unless you're suddenly running Ruby, Python, PHP, C or OCaml as a client-side script embedded in your browser, you're comparing apples to oranges.

It would be interesting, though, if someone could point me (and everyone else) to a reasonable, credible comparison of HTML5+JS vs. Flash vs. Silverlight.

comment 16y ago · link · parent

Finally, a link I can send to all the people who ask me why I paid the same price for "Heavy Rain" that I would pay for a game like "Dragon Age: Origins".

comment 16y ago · link · parent

My take: there’s an optimal number of pixels you need to complete the tasks you need to complete. Worry about that number, not the number of monitors you have.

A bit more than a week ago, I would've agreed with that. My opinion changed after a visit to my ophthalmologist. He helped me realize that my eyesight was not deteriorating in general, but that my eyes were getting tired under certain circumstances, namely when I was working from home.

At home I use my company laptop and I hook it up to my 37" HDTV, with resolution of 1920x1080. The doctor explained that the combination of the resolution and the screen size made it impossible for my eyes to cover everything I need without doing lots of little "lookup movements". As a consequence, my eyes would get tired and I would have trouble reading stuff.

The suggested remedy was to either use a smaller screen or a lower resolution. Since it worked out really well for my problem, I'll keep believing that it's better to have two or more screens with not-so-high resolution, than one screen with huge resolution.

comment 16y ago · link · parent

Contrary to what seems to be increasingly popular belief, you don't need to cite studies to criticize an article like this. One can point out things like flaws in reasoning and logical fallacies, without having to cite any studies or research.

comment 16y ago · link · parent

I'm not a psychologists (or anything related), but it seems to me that the article is based on flawed reasoning. First it presents studies that demonstrate how "people give authority to people that they genuinely like", then they wonder why "when you give people power, they basically start acting like fools."

The subtle flaw here is the assumption is that people are given power in the same democratic way as in those studies.

When we have any power to hand over directly -- and the inclination to hand it over -- we will tend to hand it over to someone we like, true. But people like the ex-CEO of Hewlett Packard didn't rise to power just because someone said "Oh, here's a likable fellow, give him more power."

comment 16y ago · link · parent

Excerpt from the article:

For the first time ever, scientists have created an invisibility cloak made from silk, and coated in gold.

The new metamaterial, as invisibility cloaks and their kin are technically called, only works on relatively long terahertz waves (a region of the electromagnetic spectrum between radio and infrared light)

[...]

In other words, they haven't "created an invisibility cloak". They have discovered some interesting properties of a new material based on silk.

comment 16y ago · link · parent

Were you ever irked by a polite, yet completely groundless compliment, offered out of convention? For example, when someone who is completely unqualified to judge your work tells you "Great job!"

In a situation like that, I often feel two simultaneous reactions, one being "How would you know?" and the other "I appreciate the sentiment." Guess which one I choose to act upon?

Just as "great job" from someone who doesn't know anything about it is not such a big deal because it was simply a nice gesture, so can "too much time on his hands" be (sometimes) considered to be no big deal because there was no specific malice behind it.

In other words, while I agree with the sentiment, people sometimes need to grow a skin bit thicker than they have.

comment 16y ago · link · parent

Was the Enthusiast even attempting to produce something the Speaker could appreciate, or was it merely for their own amusement/edification? [...] What entitles you to make a pronouncement like that?

Interesting questions, especially because they don't have only one answer. Let's say I make a video of a "fringey" hobby I have; pick anything you would profoundly useless. Let's say I send that video to a group of my friends, saying "look what I did". If it somehow finds its way to a broader audience on the Internet, for which it was not intended, and some Joe Schmoe says "this guy has too much time on his hands", then you could say that he's being a Dick. You could also say my friends were Dicks for exposing me to Joe Schmoe's ridicule.

However, if I take that same video, post in on a public site, with no access controls (such as YouTube ), saying "look what I did", then I'm inviting people to give their opinions on it. I'm entitling a hypothetical Speaker to judge my work.

They're proclaiming that the Enthusiast's passion would be better spent elsewhere, which I suppose is a recognition of the mere existence of said passion, but it's hardly a gesture of respect, as you're implying.

I'm not implying it's a gesture of respect. I'm simply claiming that it's a recognition of that passion, because the Author's sentiment is that this passion is not recognized by people who use the phrase "too much time on his hands". Of course, we could quibble about the word "recognize". To forestall that, I'll explain that I'm using it in the sense of acknowledging something, not acclaiming something.

No, of course not, but neither is anyone entitled to actively _dis_ respect every flight of fancy they come across.

In other words: "Either offer a constructive criticism or shut up." That's okay, I agree with that completely. What I disagree with is reacting out of proportion to the disrespect. That kind of reaction usually comes from the false sense of entitlement, a feeling that not only people shouldn't disrespect your passions, but that they should keep quiet if they disagree.

comment 16y ago · link · parent

Sorry, but I disagree. A lot. For example, the author claims that "the slur brooks no possibility that the speaker has failed to appreciate some valuable, fulfilling element of the subject's hobby."

Here the Author claims that the Speaker failed to appreciate some element in what the Enthusiast produced. It could just as easily be interpreted as the Enthusiast's failure to produce something the Speaker could appreciate.

In condemnation of the phrase he hates, the Author ascribes malicious intentions to the Speaker who uses it. That's a misrepresentation. "Too much time on his hands" usually implies that the Enthusiast produced something for which the Speaker sees no use, which prompts the Speaker to imply that it would be better to apply the Enthusiast's energies and passions on something the Speaker finds useful. Along with passing judgment on Enthusiast's work (something that upsets the Author), the Speaker also recognized the Enthusiast's passion.

Of course, some of this stuff will surely be relegated to the scrapheap of history.

Let's face it, most of the "fringey" stuff is relegated to the scrapheap of history. For every misunderstood genius, you have many more harmless nuts who invent and patent "Method and apparatus for automatically exercising a curious animal"[1]. What changed is our ability to perceive them globally, or, to be more precise, their ability to broadcast to a wider public.

Having more freedom to direct your thoughts and opinions to a wider audience than before, does not mean you're somehow entitled to have those thoughts and opinions respected.

[1] http://www.freepatentsonline.com/6701872.html

comment 16y ago · link · parent

If the problem is how the taxes are being spent, do you really think that not hiring is the correct solution?

comment 16y ago · link · parent

Wait, I don't get it. What is he proposing as an alternative? Would he be happier to pay Sally $74,000 so that she herself can do the whole process of paying $30,000 for taxes and health care and stuff like that? Or is he proposing to pay sally $44,000 and let Sally pay $30,000 out of that? Or is he just whining?

comment 16y ago · link · parent

Is anything wrong with the rest? I don't own an iDevice, so I don't know for sure, but the rest seems spot on.

comment 16y ago · link · parent

That's how you define the "reliability" of a "media organization": they take what comes in and make sure it's reliable before publishing it. Incidentally, I have a similar thing to say about your statement: saying something with an attitude doesn't make it true, no matter how superior it makes you feel.

comment 16y ago · link · parent

The only thing notable about this is just how utterly devoid of useful content it is.

comment 16y ago · link · parent

Just to clarify for anyone who isn't familiar with Python: it's asterisk followed by "args". The problem here is that HN comments system interprets asterisk as italic formatting ;)

Edit: Parent comment fixed by postfuturist.

comment 16y ago · link · parent

I'm far from being an expert on statistics (and related stuff), but I'm still a bit leery of the "Women Build Great Companies" section. Don't get me wrong, I'm not saying they don't or that I'm against having more women start companies or anything of the kind. It's just this: all of the author's claims in that section are backed by statistics. That makes me wonder, if there are "so few women entrepreneurs starting high potential, high growth companies", doesn't that make it likely that there's some statistical bias in favor of those companies?

My reasoning is like this: if you can get into the XYZ college either by being rich or exceptionally smart, wouldn't a statistical analysis tend to "show" that poor people are exceptionally smart?

comment 16y ago · link · parent

It's always easy to claim something is okay when you "don't even know [language] yet", isn't it? ;)

All joking aside, the problem with this is not that "non-experts" don't understand what the code does at all. It's that they don't understand all that it does. If you never read anything that warns you about the difference between "and/or" and "&&/||" (or if you skim over it), it can bite you really bad.

comment 16y ago · link · parent

Depends on what you call "this kind of code". Operators like "and" and "or" facilitate some very useful and expressive idioms, so having that kind syntactic constructs is rather useful.

However, I think it's a big mistake to make those constructs use "and" and "or", because it overloads the semantics normally associated with those keywords. Yes, it's true that it's precisely the same logic under the hood, but you have to fight the "oh, boy, that's so neat!" reflex and think about all that could go wrong.

There's a similar gotcha in Python, where instead of ternary operator (a ? b : c) you use a combination of "and" and "or" (a and b or c). The gotcha is that it backfires if "b" evaluates to false.

All in all, it's probably not "worth it" to have nasty surprises like that, but that could be avoided by using different keywords, not "and" and "or".

comment 16y ago · link · parent

Yep, that's an important point: you should probably have chosen a different example. The one you used will either make people say "it's a lot better to write it in two lines" or "oh, cool, I can write one liners like that".

Your post is explaining and demonstrating the use of "and" and "or", whose purpose is to allow idioms which rely on short-circuiting logic to control side effects, but that particular example didn't involve side effects after the operator (which is the whole point).

Perhaps it would be a good idea to replace that example with one that shows what would happen if you used "and" in an "if". It would serve the same purpose as the one you have currently -- show the unintended effects of using the wrong flavor of operator -- without confusing people or unintentionally teaching bad practices.

comment 16y ago · link · parent

The contract part smells fishy, yes. But the admission is refreshingly honest.

comment 16y ago · link · parent

Flagged. Nothing new here, literally. No new breakthroughs, nothing newsworthy. You could replace this article with a link to Wikipedia.

comment 16y ago · link · parent

I've often wondered what it would be like to work on Open Source projects and contribute to something like that, but I've never done it before. This post piqued my interest, so I read it and followed the links and read the comments and, in general, spent more than an hour on reading the discussion.

Which leads me to my question: is this normal, widespread behavior in Open Source? I'm honestly interested in answers, because, frankly, to me this looked like a boatload of politics. I get enough of that at work.

comment 16y ago · link · parent

I believe that the risks are real, I really do. I'm not disputing that. The reason why the attitude tiring is because medical issues have been handled very badly in the last few years. To be honest, it might also be that I started paying more attention to it in those few years and it has always been handled badly.

My point is that it's becoming really hard for an average person today to decide how to react to information from medical field. Every now and then there's a report of a "new study" which "concludes" this or that about some disease or condition or disorder. More often than not, the study is not really a study but a theory, or it's not sound for this or that reason, or it's not new, or it doesn't really conclude anything yet, etc. Plus, on top of it, you get stuff like that whole fiasco with vaccines.

What I'm driving at is that the way this stuff is handled makes it really hard for ordinary people like me to make decisions. If it was just about me, then I wouldn't worry so much, but my son is three years old and each time a new "threat" appears, I have to decide what to do.

Finally, regarding the article, was it really necessary to start it that way? Yes, the risks are real, but how does stating them yet again contribute to the article?

comment 16y ago · link · parent

A severe influenza pandemic will kill many more Americans than died in the World Trade Centers, the Iraq war, the Vietnam War, and Hurricane Katrina combined, perhaps a million people in the USA alone. Such a disaster would tear the fabric of American society. Our entire country might resemble the Superdome or Bourbon Street after Hurricane Katrina.

Is anyone else tired of these doomsday prophecies? Everyone was hysterical about H1N1 and it turned out to be milder than "normal" flu in the end. I'm not trying to say anything about the rest of the article, I'm just really tired of the attitude.

It's estimated that, in United States, about 40,000 people a year die in highway accidents. If we adopted the same sensationalist attitude, we could compare it to the Vietnam War, which (according to Wikipedia) claimed the lives of 58,236 US soldiers, over the course of several years. Obviously, highway accidents will be the doom of United States, right?

Sorry, rant over.

comment 16y ago · link · parent

It would be even better to see support for scoped namespaces in Ruby...

comment 16y ago · link · parent

This is an excellent example of a common misconception about the Web:

I didn’t come to your site. You came to mine.

Yes, I did. You treat it as the equivalent of coming to your house to disturb you. That is the heart of your misconception.

Your site is not like your house, it's more like a ham radio frequency. You're broadcasting your thoughts and opinions at anyone who comes to listen. Not only that, you provide your listeners with a mechanism to broadcast right back on the same frequency.

Yes, "listening" to your "frequency" is voluntary, but that doesn't make it any less public. If you really don't want to deal with any negative comments whatsoever, I can think of two solutions: 1) protect the site with some authentication and authorization mechanism; or 2) restrict or disallow submitting comments.

Am I like this offline? Pretty much, yes. If I'm in the street and I walk by someone standing on a box and shouting at everyone, I'll probably ignore that person. However, if that person tries to call my attention by, say, yanking my sleeve, I'll talk back at them and I probably won't be very well disposed towards them.

How did you yank my sleeve? By linking to your site on HN. So let's not pretend people just "stumble" on your site and start harassing you out of the blue. If you try to attract attention and you give people a way of talking back at you, then you really should be prepared to deal with what they say.

comment 16y ago · link · parent

Society as a whole is going to have to go through some major contortions as people get their heads wrapped around the idea that everything -- and I mean everything -- is going to be digitized and recorded.

That is precisely one of the things that give me the shivers about the society today. I understand Mr. Graber's motivation. I also agree wholeheartedly that the "reasonable expectation of privacy" rule has to be applied consistently, i.e. if a police officer can videotape me over the course of his or her work, then I should be allowed to videotape that officer.

That said, what gives me the shivers is that our expectations of privacy, in general, seem to be sliding down a slippery slope of justified surveillance. The first time I read "1984", I was still in school (not even university yet) and it etched itself onto my mind precisely because it's so damn plausible. Everyone would love to think it's impossible because "we would never stand for it", but things keep changing slowly.

A commonplace example is your workplace, where your employer can monitor all your activities on their computers (and I mean all, not just network communication), record your business phone calls or videotape you. Also, it has become commonplace to have to do a drug test when applying for a job.

Another example is the highway toll system here in Santiago, Chile. Certain highways require you to have a device installed in your car to transit them. Instead of waiting in line at a toll booth, your device communicates with a gate under which your car passes and your billed monthly. Every gate also has cameras to record cases of infractions, when a car without the device passes under the gate.

Sure, there are laws and rules that control how all this information can be used. Yet it keeps creeping me out to think that this information is available to multitude of people. Now that information of all sorts can be shared easily and readily on a global scale, it seems even scarier. Now you can be embarrassed, humiliated, falsely accused or harassed literally in front of the whole world.

What creeps me out even more is that our expectations of privacy seem to be eroding slowly. If we're so indifferent to being under surveillance in public or at work because it makes it easier to prove who's right and who's wrong, why does it seem so implausible that in some future we would accept the same things in our homes? After all, wouldn't it help cut down on domestic violence and child abuse?

I hope I'm not coming across as a borderline paranoid nutjob, but I just felt the need to address the issue.

comment 16y ago · link · parent

Really? Wasn't it supposed to be funny, then? ;)

comment 16y ago · link · parent

It wouldn't, because you would still have to do something else after the recursive call to your function. That would prevent you from applying tail-call optimization, which is the point behind making your function tail-recursive in the first place.

For those who aren't familiar with tail-call optimization, here's a very simplified explanation: if the very last thing you do in a function is call it recursively, then instead of allocating the space for its local variables (and any other local state it might have) for another call, you can simply set the arguments to their new values, reset the local state and do an equivalent of "goto" to the beginning of the function.

1
394041
46