skysight-inc/HackerNews huggingface dataset:
I'm a big believer in function level comments in code, in a sort of doxygen-ish style (I write mostly C).

It allows you to document the intended inputs and outputs of the function and state its purpose. This increases maintainability and reusability.

Functions themselves should be short and written as a sequence of logical steps.

I'm also a big fan of doing things right rather than just hacking until it works, which seems to put me in a minority.
Note that this isn't the "official" Haskell style guide. We don't have one (although we probably shouldn't). This is one of the competing guides out there.
Dota 2 caster reveals viewing figures for TI4 'n00b' stream
There's similar advice in the Ruby Style Guide - https://github.com/bbatsov/ruby-style-guide#no-comments

Comments often go out-of-sync with the code, so I think it makes a lot of sense to prefer writing comprehensible code instead of trying to explain with comments something totally incomprehensible.
I agree. The amount of flexibity is huge, especially if you deliberately want a different look on various pages.

And yeah, it feels good.
This comment strikes me as emotional :)

I didn't say I can rewrite all _their_ codebase in 6 months.

But if we are talking just about something working enough to get attention - why not?
Microsoft XP SP3 MQAC.sys Arbitrary Write Privilege Escalation
Digital Science invests in writeLaTeX
Yeah, and I think the version of the keys on your laptop and desktop can be copied and used to access your iOS device at a later date if someone gains brief access to any computer paired to it. GCHQ and the NSA apparently have tools to take advantage of this.
I don't want to sound mean, but most of them look very amateurish at best.
the frontend implementation is intentionally super simple but for any question feel free to drop me line :)
Not sure about this. It seems kind of wierd for the 'login' templates to have a confirm password box. In my book startbootstrap has an advantage.
Looks like the folks behind this are doing real estate tech. Can I ask y'all what the product is?
Websecurify Suite: Escapemode, Screenshot and Auto-formatting Improvements
One case of unexpected behavior which is best described in comments is when the simple and obvious solution to the problem is wrong, and has already been discarded.

(Preferably the reasons for discarding the simple solution should be provided as well, as circumstances may change.)
I recently discovered Computer Chronicles on archive.org and driven by nostalgia watched a few episodes and can only second this.
Google Faces Potential Fines, Criminal Charges In Italy
I generally sympathise with your sentiment - I think this jives fairly well with comments talking about 'why' rather that 'what'. I do favour function-level comments quite a bit for more complex functions.

That said, I think some of the commenters in this thread should spend time maintaining a MLOC+ sized code base before dismissing comments as 'code smell'. Even in well-written code, if you're a maintenance programmer who is unfamiliar with a particular functional area, a few comments talking about the overall purpose of the code and why it works the way it does can save you enormous amounts of time.

Finally, if people are letting comments go out of date, IMO they have a quality issue. Either the comments are useless and should be removed, or they're useful and should be kept up to date. If your developers are letting useful comment areas go out of date, it should get caught by code review.
Don't waste your time and just head to wrapbootstrap.com.

Even for a side project it's worth paying $15 to get an actually good looking template.
Depressed 404
At a low enough LOD it's not unthinkable to simulate such stuff using GPGPU (CUDA/OPENCL) for performing such simulations in realtime.
One reason may be the same reason Apple don't sell a truly low cost, budget iPhone. Some people who can afford to spend more, and otherwise would spend more if their only options were more expensive Amazon phone, would buy the cheaper model. That's revenue you just threw away. If there is a premium market for an Amazon phone, it makes sense to cash in there first.

Another reason is that this may well be Amazon's budget smartphone in 1 year, 2 years or 3 years time. Pay one tranche of development costs now and ride the economic price curve down to lower production costs and higher market penetration.
Comments are lousy for describing what you are doing, but there are no alternative to comments for describing why something is done.
I also like to add doxygen headers to functions, but have stopped adding the inputs and outputs. Refactorings causes the doxygen to go out of sync with the code.

Currently I only do the following:

/**@fn foobar
* @brief Does foo
*/

-edit formatting
I was about 13 years old when I started to code just for fun, on an old 100MHz 386, using QBasic. Before that I watched my friend hack away in BASIC on a C64.

I was in CS-specialized class in middle school, but that was kind of a joke.

I am still doing my BSc in CS at the university.
The first "dollar" (forint) I earned was back in 2011 when I worked as a non-registered PHP developer for a startup here in town then in Budapest during the summer.

After that, I got employed as a full-time Junior Software Engineer at an international company last August. So I've been here for a year, picking up a lot of experience and earning OK.
It is not exactly easy to manage university studies and full-time work, but I can manage.
Well, this is Haskell we're talking about. Between the name, type signature and the fact that most functions are pure (so, no side-effects to describe), it's often obvious what they do.
Exactly.

If there's one app where they shouldn't uselessly annoy users just to boost their statistics, it's in the app targeted at influencers.
It's weird to me how people will slate low quality code, but think it's okay (or inevitable) to let comments go out of date. If your comments aren't useful, delete them. If they are, keep them up to date. It's part of behaving responsibly towards the rest of your team just as much as writing readable code is.
Avoiding comments that do what your code should be doing is common practice, and I think that's what this style guide is recommending.

Comments are useful to describe __why__ you're doing something, often when you are not able to change the unexpected behaviour. Whenever I build an API library, my code is littered with comments like "Acme Corp API requires this happens before that" with a link to that bit of the API documentation.

Here's a C++ example about "documenting surpises" (taken from Steve McConnell's Code Complete:

for ( element = 0; element < elementCount; element++ ) {
// Use right shift to divide by two. Substituting the
// right-shift operation cuts the loop time by 75%.
elementList[ element ] = elementList[ element ] >> 1;
}

And a Java example:

/* The following code is necessary to work around an error in
WriteData() that appears only when the third parameter
equals 500. '500' has been replaced with a named constant
for clarity. */

if ( blockSize == WRITEDATA_BROKEN_SIZE ) {
blockSize = WRITEDATA_WORKAROUND_SIZE;
}
WriteData ( file, data, blockSize );

He also gives a whole list of situations in which comments are a bad idea, and it's similar to the OP.
But lost profits, which means Microsoft is most likely cannibalizing its traditional Office business with the 365 one, so the "growth" for 365 is pretty misleading, if it's just converting traditional Office customers to 365 ones.
Ahh good catch, thanks for the additional insight.
In the same way an unencrypted telephone call is also like a postcard (or posting a tape), but we still have laws protecting that information flow, like the client attorney privilege.

What we are seeing now is just a power grab from governments and organizations to have "novel" forms of communication classed as less protected so they can reap the benefits of being able to intercept it. This is exactly how a legally protected and democratic society breaks down.

There are only two ways to solve it. Either protect all forms of communication without discrimination, or use or invent technology to prevent it being possible in the first place (and not outlaw that technology). There are no other ways.
Show HN: Use #tags as a simple way of sharing calendar events
I didn't get that from the article. It felt like the author was emphasising experience, not superiority. We all went through these stages, the author acknowledges that.

The article doesn't say anything negative about novice programmers, just that these are the things we go through when we learn. I certainly went through the stages described, and I'm hitting the near-million-line projects now and wonder what happens next.
But the thing is, in C a geocoding function would probably receive two ints and return a string, while in Haskell you'd probably have a function of type "Location -> Address". The type system obviates much of the need for those comments.
And Canvas 2D.
Yeah, that might happen, in 20 years when the patents expire. Before that, this will be much higher cost than tube lasers which anyone can make and repair.
LinkedIn Does Another Deal, Buying Bizo
New Startup CTO Tutorials (work in progress)
It's doesn't recommend avoiding comments - it encourages to write understandable code and avoid meaningless comments. It is a basic rule of the clean code.
It would be a lot more intuitive. Even knowing exactly what was being described and how - It still is difficult for me to understand a graph in which Time is on the Y-axis. I considered for a few moment that I was actually being trolled with that graph.
IIS is 0.15% away from beating Apache as most popular web server
They say that you can take it anywhere. But is it legal to use anywhere? It's not using any worldwide ISM band, so I assume they're bit lost with this topic too. So you can take it anywhere, but you can't use it legally everywhere.
>Why not both. If your in tech and enjoy it you can do it.

Clearly, that is the goal.

If you are claiming that having a safety net to fall back on doesn't put you in a better position to chose work you enjoy (or rather, avoid work you find unpleasant) - I don't think you are being honest.
I disagree with that sentiment.

Using Python or Perl it is easy to go from a for loop to a map or list comprehension. For many less experienced programmers it will make it less readable and more difficult to comprehend. Using a more functional approach will usually lead to less side effects and silly bugs, so I prefer to code this way, and add a comment to explain what the line is doing if it is not obvious.
What have you built this in?

EDIT: Why was I downvoted?
Right now there is a bit of a slight impedance mismatch between attempted reusability and the commercial launch offering of the full expendable Falcon 9 capability. On the plus side the dual role nature of the Falcon 9 v1.1 means they can take advantage of expendable launches with sufficient margin to test the reusability features, on the minus side it means that when there isn't that margin they don't get free test flights.

However, once the F9 v1.1 has been thoroughly tested in the reusable configuration they will stop offering the expendable option. Every flight will have the first stage flyback for reuse, and only payloads which allow that flight profile will be flown, leaving more than enough fuel margin to allow return and some contingency.

Larger payloads will simply be flown on the Falcon Heavy, which will reuse the lower stage cores from day one. Even if that means no cross-feed and a massive hit to the payload capacity the Falcon Heavy should still be able to loft payloads larger than the Delta IV Heavy and with reusability it should be able to do so at less than the current cost of the F9.
Dupe, see:
https://news.ycombinator.com/item?id=8052233
I don't want to downplay your work (which can be very helpful, I can see graphs being implemented natively), but why not use EVAL [0] and lua scripts for this ? I instinctively think that performance would be similar but:

- it would be more easily maintainable and extendable (lua scripts vs redis fork)

- it would still be usable in any language (because all you need is EVAL the scripts)

[0] http://redis.io/commands/eval
Ask HN: Coding outdoors
Hi

Being outdoors in the sun makes you high. It gives you energy and vitamin D, relieves headaches and is just generally great (within limits, of course - no skin cancer, please). Most of us here use the computer to make a living and some of us work from home or have flexible work place and hours - could we be doing this outside and improve our health and productivity?

I'm not posting to argue whether it's actually better or not to code outdoors, I only want to ask: How can this be achieved technically?

Personally I only need to be able to ssh to my server and have at least 20 lines of vim to work with.

I saw this last year: http://www.raspberrypi.org/kindleberry-pi-the-second/

This set-up is very cool but kind of unwieldy and maybe unnecessarily complex?

How can this be done in an easier way?
The branding there is incredibly strong.

Some friends of mine in Vietnam run a shop, in Hoi An. They make a comfortable for local standards income, but after tax rates and costs they will have about $10k a year, not to be sniffed at, but still, not amazing income. A younger sister wanted an iPhone, it was a running joke that if she bought one, she would be sleeping out in the pig sty, the 'adults' (those over 20) consider such things excessive waste of money, but she being 17 decided to spend her 3 months wage on a second hand iPhone 4. This isn't un-common, her peer group all feel the need of it. She could have had something like a Nokia 620 which has all the apps she uses anyway, for a fraction of the price and it would have the benefit of new battery life performance.

Hell I've seen shoes with the Apple logo put on them[0] there is most definitely a lot of brand power and loyalty in Vietnam and China. If they can ensure that people end up with the 'correct' Apple and not a nock off, they could do quite well. The fact that kids know how to tell the real iPhone from the fact clones is enough, as they create peer pressure for the real thing.

So yes, I can see Apple benefiting from a bunch of people in the emerging markets feeling they've 'made it' when they can afford an iPad, they still are a long way of affording a car.

[0] http://imgur.com/GlwsA5d
If it was beneficial for a company's bottom line to abandon DRM they would do it, so why don't they?

Does DRM boost piracy, are there actual statistics for this, those links seem short on facts? World of Goo was heavily pirated.

One thing piracy has boosted is the explosion of the freemium model.
Promishare is motivational mobile app for positive goals and habits
15 Best Free Fonts for 2014
Xen has a balloon driver too. I think KVM does now as well.
Stamplay looks great.

A heads up: I'm using the Disconnect plugin in Chrome and your “Start now” buttons on the Stamplay homepage don't do anything when clicked. (I had to whitelist the site in Disconnect before they'd function, possibly because of the tracking you're using in the click event bound to that button?) Just thought I'd mention it as Disconnect is quite popular with your target market.
Saw him on stage about a year ago and he was the most lucid and sensible person there (of the 5 other captains). Avery Brooks certainly was not with it at all.
I think we should treat someone that's receiving death and rape threats on a daily basis differently than someone who does not. That we should treat someone that's more likely to be raped or killed differently than someone who is not that likely. And because the people receiving death and rape threats are also the people more likely getting raped and killed, that makes something considered as "taunting" much more real.

You are right, we should avoid treating women differently than men, that's something we're all able to agree on. That does not mean that men and women in our societies are treated the same as of now.

Women should not be considered as more vulnerable, yet that's how they are perceive, and that's also what they are being taught:

- don't fight, don't fight back

- always smile and be pretty

- don't get angry, that just shows you're hysterical/on your period/pregnant and hormone-crazy

- agree with the males, especially when they make sexist jokes, that makes you really cool

- don't be a feminist and try to improve your condition

We should not treat women differently than men, but letting society/communities/bullies target one group more than the other and then refusing to acknowledge it or to empathize with it, seems like a convenient way of not taking responsability, as a society/community, and not try to improve ourselves.
I didn't know that, so I dug around for the cause. From a recent NYP article:

Takei married his husband in 2008 and Shatner became enraged when
he claimed he wasn’t invited. He ranted against Takei in an
online interview. [...]

Shatner called Takei’s wedding a publicity stunt and hypothesized
that their feud stemmed from Takei’s unwillingness to playing
second fiddle to Shatner on “Star Trek.”

It seems to be mostly based on petty, even comical stuff like this. This may sound paradoxical, but as someone who always had a lot of respect for both of them, this is disappointing and a bit of a relief at the same time.
What I've settled with for now is to attach an instance of the Model/Collection as a prop on the React component and syncing it to Reacts' state.

I do this by attaching a callback on the sync, add, change, remove events and use the the toJSON() method to copy it to the React state like so:

this.setState({data: this.props.model.toJSON()});

When saving a form, I have a method which handles the form submission. It copies over the state to the model and then saves it using:

this.props.model.set(this.state.data);

this.props.model.save();

In additional to this, I've built a tiny dispatcher to instantitiate my models and collections only once. In this way all parts of the app will always work on the same data and by in sync.
Using science to determine if your elephant is obese
Good code should be self documenting.
The problem is that iPads keep on going, and going, and going. They're incredibly robust. They start with a long battery life leaving plenty of room for battery decay while still having useful run times. Current apps generally run fine on older devices. Even when they don't an old iPad can still perform many useful functions such as email, video playback, maps, reading ebooks or pdfs, web browsing and slightly older or casual games.

It's beginning to look like their average useful life is far longer than that of a Phone and also longer than a desktop or laptop. As a result the replacement rate may be fairly low. I'm in the market for another iPhone this year due to contract exipiry, but my household has reached iPad saturation. The kid's Minis are still going strong and we bought an Air last year after giving our '2' to a relative and it's still going strong too. It's hard to see when or why we'd need to get a new ipad as long as any of our current ones still work. That's probably another 3 years at least, possibly 5.
I was in a similar situation last year - but after visiting the apple store and trying the different variations I ended up going for the 15" pro, i7 quad-core, 16GB RAM, 512SSD and the retina display with 2880 x 1800 resolution.

It does cost more than the other 2 options but if you are a developer, it might be worth it.
The true killer feature of Sublime Text is the fact that it runs flawlessly on the 3 major platforms (Windows, OS X, Linux).

I know people will scream that Emacs (and vim) have windows ports, but they are utter crap compared to running them under a Unix. I can tell that from experience. Emacs on Windows is unbearably slow: it took 10 times as much to start as on the same host, same SSD, when it is run under a Linux VM! It also relies heavily on standard Unix tools (wget, grep, ...), whose ports for Windows are extremely outdated to the point that they are unusable (Emacs 24's find in file relies on features not provided by the standard non-CYGWIN grep). There only solution is to use CYGWIN, which is a mess: it's extremely slow, behaves weirdly (wrt path names, notably), and it doesn't play well if you already have a standard MSYSGit installation for your git needs. (I have tried using Emacs at least 4 times already, and I have never managed to stick to it, for these kind of reasons.)

I love ST. It boots fast, is gorgeous, modern (unlike Emacs, you can have your cursor outside the region you are viewing!), trivial to configure (with auto-reload of config files), has sane defaults and great support for most languages out of the box, it has a great community, and a nice language choice for moddability. It might have been born has an OS X éditeur du jour, but I'd say it's more of a blessing for Windows developers where good, modern editors are rare.
The button does not work with plain Adblock Plus too.
I've seen this many times:

...thus they (comments) tend to diverge from actual implementation.

It happens, you update/refactor code, and forget to update the comments. Thus the comments are outdated or worse not applicable anymore. Common mistake by less-detailed oriented developers. Begs the question, in this case is is better to have confusing/incorrect comments, or no comments at all?
I realize this, but the article doesn't provide any clear definition of what actually is a bad comment. It only gives trivial examples of bad comments such as "increment a by one".

Since I don't think anyone here would argue that "increment a by one" is a useful comment, the part about duplicate/obvious comments isn't adding much to the discussion about the usefulness of comments.

Nevertheless, it's true that comments cannot be checked by the compiler, and that's a more interesting point, I think.
I took this as a quick intro to snippets of Bootstrap features. Ex: Logins and stuff. It does say "pre" bootstrap so I'm sure that was the intended purpose for this.
>Why not both. If your in tech and enjoy it you can do it.

Let us go in to this further. Yes, most of the technical people I know have pretty good working conditions.

However. Most of the technical people I know work for companies that either make weapons or sell advertising.

The vast majority of the available high-paying technical jobs actively contribute to making the world a worse place.

Now, I am not claiming to have clean hands either; I'm not trying to shame anyone else. I'm just saying that most of us would feel better if, you know, we could move away from killing people and/or making them spend money on garbage they don't need, and on to creating something that actually improves humanity.

The thing is, having a positive impact is difficult on it's own. When you've got rent to pay, the easy job solving interesting problems that ultimately make banzi buddy slightly more effective starts looking pretty good.
Well i doubt nginx use is as low as they say. Never did trust netcraft stats
It's often a good idea to comment "why" the code exist, if it is non-obvious (e.g. it's obvious to sanitize input parameters). The comment must be short and possibly point to a ticket wrote somewhere else.

It may be a good idea to comment "what" the code does, if it isn't clear (the code itself is "how" it is done, but "what" does it do may be hard to read, e.g. sometimes you use a clever hack for performance reasons).

As always, handle with care :-)
YACS - yet another coin scam