Live data from Hacker News

The Single Piece of JavaScript on HN

blog.watchandcode.com

61–70 of 195 posts

Re: The Single Piece of JavaScript on HN

#61

function hide(id) { var el = document.getElementById(id); if (el) { el.style.visibility = 'hidden'; } } function vote(node) { var v = node.id.split(/_/); var item = v[1]; hide('up_' + item); hide('down_' + item); var ping = new Image(); ping.src = node.href; return false; }

With closure compiler:

function hide(a){if(a=document.getElementById(a))a.style.visibility="hidden"}function vote(a){var b=a.id.split(/_/)[1];hide("up_"+b);hide("down_"+b);(new Image).src=a.href;return!1};

v and item are merged.

http://closure-compiler.appspot.com/home#code%3D%252F%252F%2...

Original Size: 212 bytes gzipped (318 bytes uncompressed)

Compiled Size: 164 bytes gzipped (182 bytes uncompressed)

Re: The Single Piece of JavaScript on HN

#63
post #43

Earlier quoted context omitted.

For the majority of cases that I've seen, these arguments are simply excuses to avoid doing real work. It's way more fun to decide whether your amazingly awesome Unicorn startup is going to use React or Angular, or Express vs. Rails, or whatever than it is to actually go through the hard work of building a customer base and making money.

Totally agree. One problem I find arises from this is that there are no boring workhorses. Time and time again I need boring crud screens, for the admin side of applications, but there is no easy default to choose. ExtJS tends to do the trick, but it's not cheap.

> Time and time again I need boring crud screens, for the admin side of applications, but there is no easy default to choose.

crud is often a feature of frameworks. crud should be an external tool like documention tools (doxygen...).

Re: The Single Piece of JavaScript on HN

#64
post #54

If we ever make it around to a second piece of javascript on here, can I request that it be a collapse comment function? I promise i won't ask for anything else.

I use this plugin, I don't think I'd visit as often if I didn't have it: https://chrome.google.com/webstore/detail/hacker-news-enhanc...

Thanks for the recommendation!

Re: The Single Piece of JavaScript on HN

#65

If we ever make it around to a second piece of javascript on here, can I request that it be a collapse comment function? I promise i won't ask for anything else.

What's the rationale behind not making this feature available for everyone?

Quality—don't want to make it too easy to ignore entire chunks of the conversation, and don't want to encourage adding chunks to the conversation that are worth ignoring.

As I understand it.

Re: The Single Piece of JavaScript on HN

#66
post #53
post #40

Earlier quoted context omitted.

I'm getting clobbered with downvotes. I need to ask less stupid questions. The problem is that I don't really have a way to know they are stupid.

The downvotes are how you know.

Now I see you are downvoted. I thought your comment was humourous which is always alright to me.

In My Humble Opinion downvotes are given out a little too easily here (OK, I'm ready for more downvotes). I hope when I get the downvote ability I will use it wisely, not that many aren't wise.

Re: The Single Piece of JavaScript on HN

#67
post #60
post #56

Earlier quoted context omitted.

It would be great if I could delete a post and get all the points back. (grin)

That would make the whole downvote system useless. Just post spam comments everywhere then delete them after a day and you’ll always have a positive karma.

> That would make the whole downvote system useless

This would not remotely "make the whole downvote system useless". The primary use of the voting system here is to sort out discussion by subjective value. That would only be very indirectly affected (through the very distantly secondary use of karma to confer downvoting ability).

If anything, it would debatably enhance the primary use of the downvote system, by giving authors of unpopular comments an incentive to remove from the discussion what the community has judged to be noise.

Though I would personally hate that, as a fundamentalist anti-deletionist, and as a frequent dissenter from this community's judgements of value.

Re: The Single Piece of JavaScript on HN

#69
post #60
post #56

Earlier quoted context omitted.

It would be great if I could delete a post and get all the points back. (grin)

That would make the whole downvote system useless. Just post spam comments everywhere then delete them after a day and you’ll always have a positive karma.

Ok, I"m facing an armageddon of downvotes but why the heck was this downvoted? He made a point, that while arguable, is a valid comment. Maybe the discussion of downvoting is bringing more downvotes.

Jeeez.

Edit: My upvote brought him back to zero, for now.

Re: The Single Piece of JavaScript on HN

#70

Earlier quoted context omitted.

For the majority of cases that I've seen, these arguments are simply excuses to avoid doing real work. It's way more fun to decide whether your amazingly awesome Unicorn startup is going to use React or Angular, or Express vs. Rails, or whatever than it is to actually go through the hard work of building a customer base and making money.

YES! totally agree For a subset of us, framework authors, open source contributors, etc. It's very useful to keep up to date on the latest trends. For example, the Angular team has borrowed techniques from React. It helps for them to keep up with things. For people like me though, let's be honest. I don't need to do the latest thing.

Funny you said that, I was looking into ng2 and they've borrowed a few things from the React community. It's all good, I'm glad to see that "framework A is better than framework B" mentality die away and everyone just uses the right tool for the right job.
Post reply on HN