skysight-inc/HackerNews huggingface dataset:
Oh sweet summer child. This list reflects but one possible course of programmer evolution. Some languages--and I'm thinking particularly of scala--encourage one-liners. Comments are rarely extra weight if there's anything worth explaining; access modifiers are not of the essence here. Collection types are no replacement for OO patterns that have a reason to exist in the first place. There's a good argument to be made that early exits, other than perhaps constraint checking, make control flow harder to reason about.
> The one rule was "write like a chameleon, and make your code look like the code it is in."

I bounce between many code bases in multiple languages, and this has always been my rule. I first figure out why/how are things done, and then do them the same way within reason. If the existing code has something done in a way that is no longer valid/correct, then we have discussion about changing all of the code.
Crash test dummies are at least a standard.

Maybe people were misconstruing "horrible science" as something other than low quality science? HN while being a seething pit of criticality, it has a low tolerance of anything that questions science or the march of technology.
I think it's only clear and concise looking because of the achilles heel of this entire thread: terse examples. As soon as you need to do more than a single line of work, the else'd version becomes far more readable (due to superior indentation and clearer guarantees of what happens when).

If it's a single line of return in both branches, then a ternary expression is usually going to be ideal instead.
I've been slowly trying to get back into hobby/side development after not being a professional developer for 11 years. Even when I was a full-time developer, I was never really in a "junior" role or dropped into an existing, quality codebase, so much of what I was doing was from scratch. Although my coding did improve as our team grew and it forced me to be more disciplined, I never learned a lot of little hints like this that make your code much clearer.

In getting back into it, I've relied a lot of Laracast's tutorials in both learning Laravel, along with how much PHP has evolved in the past 11 years, but also some of his code quality videos, which included one on this very topic! After seeing that, I immediately started refactoring some recent code I had written with the goal of flattening it to as few indents as possible by eliminating else's and elseif's. Sure enough, I was much happier with the refactored code than I was with the original, even if the output of the code was the same.
Indeed, have updated - the all and decorate sections got jumbled up in an edit earlier.
Show HN: Yubikey-Ca, a PKCS#11 and Git-Based SSL and SSH CA
obviously enabling javascript contributes to global warming because of increase resource usage, not that I mind.
I don't know that it's that simple. Facebook survives because of network effects. Which means it is vulnerable to mass exodus, sort of like a run on the bank. So maybe no one single scandal will bring it down, but a slow, steady trickle of controversy will chip away at the user base until it hits a critical point and spirals to nothing. The continuous publication of evidence about its negative mental health effects, the scandals about political manipulation, and the terrible privacy practices seem to be driving away many of the trend setters, which means the apathetic masses will eventually follow.
New design produces true lithium-air battery
No, the text is awesome. I read it over the weekend.

As an amateur mathematician, don't worry about attempts to apply mathematics to the real world; mathematics is the pattern which emerges from the real world's incidental complexity, and we have always been applying maths to real-world concepts.

Category theory actually provides ways to go from abstract domains to concrete domains. Read the text; it might loosen your view a bit.
Kim dotcom would have to have dignity first in order to lose it
Show HN: Scheduling low priority network tasks in JavaScript
XSStrike v2.0 – An Advanced XSS Detection and Exploitation Suit
Same as we now use TL;DR

Exit or get out quick... make it readable... then the meat is left for those that want it below...
Very interested. Looking forward to following this!
Agreed, when I was first exposed to Guard clauses, (albeit in Elixir), I was amazed at how intuitive it felt to use them.

https://hexdocs.pm/elixir/master/guards.html
> Same way braces go on the end of the method/class name to reduce LOC.

Screw that. I've been writing code for 15 years, and Allman style braces make it so much easier to mentally parse code into blocks that they're worth every single LOC. I can't speak for anyone else but I'm not working on an 80x24 terminal anymore.
10k players discovered coding in our game, now we are releasing a game with them
I always found this type of "general purpose" coding rules rather useless and often counter-productive because some coders (especially beginners) will often cargo-cult and apply them without rhyme or reason. I've known coders who had the opposite rule: never have more than one return per function, use if/elses for the control flow (TFA mentions that). I don't know where this rule came from and neither did they, it's just how they were taught I suppose. Replacing that with yet an other "rule of thumb" is a bad idea IMO.

Writing clean and maintainable code is as art and requires balancing many variables. Sometimes an early return is warranted, sometimes an if/else might make more sense. If you're writing C code and you need to release some resource before returning (mutex, file handle etc...) then an early return might be error-prone and an "else" or "goto" might result in cleaner and more readable code. I use gotos a lot in error handling in C, I think it's a superior pattern to the one proposed by TFA if you have a lot of cleanup to do. In C++ and other object-oriented languages it's less of an issue thanks to RAII and/or GC.

Beyond that if/else might be more readable if both clauses are on the same "level" semantically. For instance if you write:

if (some_cond) {
do_a();
return;
}

do_b();

It looks like `do_a` and `do_b` are not on the same "level", semantically speaking. If instead they're two variations of the same concept then an else might make more sense.
Six months ago, we published our first game which was a coding discovery game. As a 2D Sandbox Platformer, you can create your own levels and make them unique by coding (because we think it's important). For that, we even created a Scratch-like visual programming language in Unity (feel free to take a look Crazy Dreamz: MagiCats Edition if you are curious).

We have been amazed to see that players were really enjoying this coding interface. And they made more than 20 000 levels thanks to that feature. The awesome thing is to see how some of them are crazy.

So how could we go further?

We wanted our game to be kind of owned by its community. And that's what we did. One of the team member came with the idea of a Best Of, a game gathering the best levels. And the best way to make it fair was to say that this creators get 50% of the game revenues.

So yeah! Player discovered coding and they made a game out of it. This game is live on Steam since last Thursday and they will get money out of it. For those who want to support or are just curious, the game is called Crazy Dreamz: Best Of.

Would love to hear your thoughts about that!
It works pretty well for movement, selection, etc. Anything that uses longer key chords is out—vscode is limited to two keystrokes afaict. It's really frustrating trying to replicate a highly customized spacemacs or vim setup.
People's last names often give away their caste, sometimes where they come from. I have seen people being treated poorly because of the way they dressed - that is the rich/poor divide. Also, a lot of Indians, even in cities, do still dress according to their religion or caste.
> Same way comments are extra weight that should only be in public or algorithm/need to know areas.

Unless you are writing completely brilliant code your future self will hate you if you skimp on comments. Also self-documenting code is great, but intentions are not always clear to another person trying to figure out your code.
The ACA is bad for people that even do care and even initially supported the ACA, like myself. It has plenty of good parts, but I have to be honest, my choices of insurance options went to almost nothing, and the prices skyrocketed. Part of this may have to do with certain parties in Congress purposely underfunding the ACA to make it fail, so I don't know how much blame goes to the ACA and how much goes to those trying to sabotage it.

However, the fact remains that my health insurance options have generally been worse and more expensive since ACA passed. This year, thankfully, I am on employer healthcare plan instead. Because in my area, with the ACA, there is one provider only, and none of the plans are good, and they're all more expensive than before, and at least 2x what I was paying pre-ACA and with MUCH MUCH higher deductables.
The one liner is the wrong conclusion.

Why?

1) When using a debugger, it takes more effort to place a breakpoint on the inner statement.

2) If you want to insert statements inside the if block you will be changing version control history for statements other than what you are modifying.

About 2, you may argue that this will be the case anyways because braces are not used... the solution to that is to always use braces.

Then there's another important aspect: handling error conditions is important part of your logic. Do not sweep them under the rug. Proper error handling is a big part of what makes applications robust, they need to be as readable as everything else.
One of the problems is when you want to use one of their products such as Google Maps, it of course asks to use your location. The application and program is almost necessary for navigation at this point, so you have to blindly accept their terms and conditions and you end up giving Google personal information such as your location and whereabouts. Same story when creating a YouTube account.
I always wanted to know how is the damage done determined ?

"U.S. authorities say Dotcom and three co-accused Megaupload executives cost film studios and record companies more than $500 million and generated more than $175 million by encouraging paying users to store and share copyrighted material."

Distributing copyrighted stuff is illegal, period. But the way those calculations are made worries me. Do they start from the presumption that if the movie wasn't uploaded on megaupload, some person would have bought tickets to that film ? Is that the underlying premise?

I mean as a consumer I could either buy the movie, or watch an illegal upload of it. Isn't that a false dichotomy?. I could just as well not watch it, if that illegal upload didn't exist, and as such I would not have costed the company one cent.
10 Super Creative Ways to Print Your Favourite Instagram Photos as Gift Items
What I'd like to advocate for is a middle ground: using queues at key points in the larger distributed system to reduce the scope of cascading failures and HTTP/P2P messaging elsewhere.

If a request comes in from an external system, and that request is queued, then the external system is already not directly impacted by downtime after the queue. Additional latency in processing after the queue is also hidden by the single queue. After a single queue makes the overall system async the goal should be to increase overall throughput and efficiency, and I don't believe only using queues accomplishes that.

I've seen this play out multiple times now, where the engineers decide they are "doing messaging", and use it for everything, even what could be simple request/response REST services. Tuning the overall system for performance becomes complicated, and the messaging brokers have to be scaled out to handle the multiplied load.

On a less serious note, the logistics game Factorio (https://www.factorio.com/) really drives this point home. In a distributed system/assembly line, really large buffers all over the place makes it harder to detect issues and tune throughput.
This is a pretty cool design if your requests to a given endpoint are supposed to all take about the same time. It's not easy to see how you'd adjust it for things with more variance; perhaps rather than using the fastest seen mtt, you could look at your p99 over the last N minutes, and see if it's been changing?
If the return value is important:

if (err) return void handleError(err)

And in non-promise-based async JS, the return value is almost always lost/useless anyway so `return x` has no effect, might as well repurpose `return` for short-circuiting.
It's the difference between having your own website and having a twitter page.

Medium already has a bunch of daily users and your future audience can discover you there. If you only have your own blog, how will people know you exist?
They're not in a usable state yet but will most likely be by the end of the month. They are being generated in one shot via Template Haskell, and will be located here: https://github.com/SimulaVR/godot-haskell

Drop by https://gitter.im/SimulaVR/Simula to discuss this at any point. There are some other Godot people involved in this project as well if you have any questions.
Totally disagree with you.... it's funny though that I read LOC as "level of complexity" not "lines of code". I've been writing code for 30 years and I think it's jarring when the braces are on the next line, so much easier for me to parse that when it's on the same line. But everyone is entitled to their own opinion.
A police raid is no laughing matter. People die all the time, so it's fortunate nobody got hurt.

Ordinarily for white collar crime, you'd expect a knock on the door and to be handed a summons, not full terrorism mode. You'd also expect your government to follow its due process, again not denying rights in full terrorism mode.

Oligarchy at work.
> encourage one-liners

Less merge friendly as well. Also you should only do one thing per line when it comes down to it to increase simplicity. I like compact code but not adding complexity for no reason so others on the team can be confused.

> Comments are rarely extra weight if there's anything worth explaining

Good cases are non obvious flows and especially algorithms/notes or any section that will be public or generate docs from it. But mostly comments are weight not because they aren't good, but because they aren't updated and become out of date weight.

> Collection types are no replacement for OO patterns that have a reason to exist in the first place.

They definitely have a place but prototyping even they are better. They are the base of json/xml data formats and most languages. Everything on top of that should have a reason for complexity including OO as long as it improves understanding and simplicity.

The "simple but not too simple" rule is what a programmer/engineer should live by.

> good argument to be made that early exits, other than perhaps constraint checking, make control flow harder to reason about

I'll fight to the death for better flow with early exits it is much easier flow with less indentation. There are times where you do need to go about it differently but most do not.
Where Fat Goes When You Lose Weight
As mentioned in that blog post

> You'll notice my address() trick to get the address of a function or variable that I used in my previous exploit. We're relying on package fmt and its %p format specifier which is implemented by using the unsafe package, so we don't need to use it ourselves.
They're completely made up. There is no practical way to measure the amount of revenue lost by copyright infringement, and big numbers sound good and drive fear and outrage.
The Confusion Matrix in statistical tests
Trump Expels 60 Russian Diplomats for U.K. Attack
This place is only as good as we all work to make it.

You started with a sarcastic comment that was irrelevant to the topic at hand, then complained abusively when just one person signalled their disapproval with a downvote, then when a helpful commenter politely explained why you were downvoted, your response was to abuse the entire community. In this instance at least, nobody's conduct has been close to being as destructive as your own.

Please, if we want this place to be better, the first step is to take responsibility for being good citizens ourselves.
Early returns only work well in untyped, statement oriented languages, like JavaScript.

I'd rather change the language.
>Maybe people were misconstruing "horrible science" as something other than low quality science?

It would only be "low quality" if it didn't fit their purpose. Which was some rough estimate, not to get the final word of whether humans survive an ejection.
Comments are not documentation.

Documentation explains HOW to use a thing. Good comments explain WHY a thing is strange. Bad comments explain WHAT a thing does and must be made redundant by extracting and naming the thing.
I was reading it the same as the previous guy...
I agree with both you and the OP. OO where necessary, lists and dicts where things are simple. You can always take a list of strings and turn it into a list of objects. But going the other way is harder because you have to refactor anything that depends on them.
I've found this is usually more the paper-thin justification /b/ users employ to avoid noticing that a culture based entirely around judging others for being too hysterical quickly drives them hysterical.
It can be federated (and was in the past) but Moxie has complained about federation holding development back.

https://en.wikipedia.org/wiki/Signal_(software)#Federation
For me, It all began with Atari (2008)
exactly what I felt, 'run less software' page seems is 'running a huge chunk of stuff' itself, how ironic, not to mention it's tediously lengthy, gosh.
Forgive me if this sounds dumb, but if the image just contains the firmware + kernel + a light layer for managing processes, do this mean it doesn't include stuff like SSHD?
Unsupervised learning could be really interesting for this. Let's have a chat about how we could work together. Would you mind dropping me an email either via the website or to julian{at}wishminer.com?
Your typical Democrat enthusiast considers the entire Republican platform “disininformation”.

And vice versa.

That’s truly the root of the problem here: none of the “fanatics” who control the various political organizations on left or the right actually want informed debate. They want to censor the other side entirely.
Oh but it is, independent of the language. Fewer LOC means more code on the screen, which means you can more easily grasp the functionality of some piece of code, which makes it easier to maintain.
That's not actually what this court case is about. This case was about the government refusing to give Kim Dotcom information they held about him.
Mathematics is not all about models, or real world applications. Pure mathematics is an end, in an of itself, for knowledge if not anything else.
Does my algorithm have a mental-health problem?
Eh, all things equal, the less the number of lines the more readable.
They have a better chance with their attention actually on the road?
Can anyone explain how they decide which requests to reject? The blog post just mentions that excess RPS gets rejected, but couldn't rejecting arbitrary requests cause other problems?
A police raid is no laughing matter. People die all the time, so it's fortunate nobody got hurt.

Not in New Zealand, they don't. Although Hollywood did put pressure on the NZ government to do a full tactical raid on this guys house.
Flat Earth Rocketeer Finally Blasts Himself to Sky at God Knows What Speed
> criticizing them for not providing terabytes of free transfers of terabytes of free data

My criticism is not towards them not providing free transfers of data. My criticism is that they say "these datasets are freely hosted and accessible" and public, while only being available while logged in to Google, which I don't think classifies as public.

I would not have any problem if it's just called "Google-hosted Datasets" or "Google-only Public Datasets", I just think the current naming is misleading.

Edit: compare this to the AWS Public Datasets which are actually available without a AWS account, just go to https://landsat-pds.s3.amazonaws.com/c1/L8/139/045/LC08_L1TP... for example, which is the Landsat Dataset
Only "brilliant" code ends up needing comments.

Plain code organized into understandable methods (usually no more than half a page of code), with good naming for variables & method names reduces the need for comments.

It's also easier to scan/read code if there's a minimum of comments in the way.
I still find this effort odd. You already have a well tested and widely used userland, even if it is written in a non memory safe language.

The easiest solution to me seems to be to grab the tools you need from the existing userland, instead of reimplementing them in Go. Currently you have reimplemented some of the userland, and packaged it up into a distro. So you have to maintain a stripped down distribution and the tools that you reimplemented. If you just took existing tools you would only have to do the latter. Am I missing something here?
“Hans, are we the baddies?” https://www.youtube.com/watch?v=hn1VxaMEjRU
I disagree with the parent. You've taken the time to organize and host these datasets. The least we can do is create an account to download them.
Apple Patent Points to Face ID Coming to Apple Watch Along with Band Sensors
I think the real transcendence is when you try out many different programming paradigms (all of which have loads of good reasons to use) and overtime find out the shortcomings of each. Then just pick the right tool for each use case.

The general information here I think is good and I roughly follow. I have also done almost the opposite and removed as much code outside of the hotpath as possible from the top of the function for performance reasons (guided on profiling). Also there can be times where you jump to a function to see what it does and can't actually see as all of the edge cases come first rather than the bread and butter.

Often you need to be careful when thinking a new paradigm is fixing a problem, like handling the err variable being passed in, and question why there is an err parameter at all. Where does it come from. What are you actually meant to do when it happens? Does every case always just log it, or throw it? Is the logic being performed at the right level? Etc. Sure the answer maybe yes everything is correct but there will be lots of times that the complexity just shouldn't be there.

Horses for courses.
Kube-ldap: LDAP Authentication for kubernetes
I would love Ruby-style guard clauses in JavaScript. Sometimes I wish I’d never written anything in Ruby just so I’d stop thinking about how great it would be if other languages shared some of its features.
kube-ldap is a Webhook Token Authentication plugin for kubernetes to use LDAP as authentication source.
It let's authenticated users generate tokens by http request and validates the token when requested by the kubernetes apiserver.
iTexico Establishes Implementation Partnership with AI Platform Jitterbit
...Dove ... issued a forceful warning to the platforms in February, saying they had become a "swamp" of fake news, racism, sexism and extremism.

We'll, they're contributing to this [1].

As much as they "hate" the platform, they still love the ad targeting it provides. They all do. Which is probably one of the only reasons these brands even bother.

They just can't help themselves when it comes to being able to push $X towards women only, in their 30's, who have small impressionable children at home, are affluent enough to buy expensive soap, etc, etc, etc.

[1] https://www.nytimes.com/2017/10/08/business/dove-ad-racist.h...