skysight-inc/HackerNews huggingface dataset:
> When you're designing a function, you may be tempted to add a flag. Don't do this. Here, let me show you an example: Suppose you have a messaging system and you have a function that returns all the messages to an user, called getUserMessages. But there is a case where you need to return a summary of each message (say, the first paragraph) or the full message. So you add a flag/Boolean parameter called retrieveFullMessage. Again, don't do that.'Cause anyone reading your code will see getUserMessage(userId, true) and wonder what the heck that true means.

What about in languages with named parameters? I think keyword arguments solve this issue pretty well.
Leveling Up Your Terminal/Command Line Navigation
As addendum to my reply, here are the answer to JetBrains questionnaire about the C++ eco-system among their customers.

Check "Which of the following tools do you or your team use for guideline enforcement or other code quality/analysis?" results.

https://www.jetbrains.com/lp/devecosystem-2019/cpp/
"The majority of the head wounds were believed to have been caused by shell and grenade fragments."

So two possibilities might be that bullet wounds to the head would be more often fatal or that most deaths and wounds come from artillery and grenades.

I think that the later is the case and that a soldier's probability of survival is mostly a combination of skill in maintaining cover and luck.
I'm not an engineer, but my father was -- a mechanical engineer -- and back in the 80s if you put a spreadsheet in front of him he wouldn't know what to do with it. Maybe some basic home finance stuff. He took to BASIC, though, and that became his MATLAB. He used it to run calculations and physical simulations and plot charts, it was awesome. All with 1-2 years of mainly self-teaching. There do seem to be technical people (not necessarily in software) for whom code > spreadsheets, but finance people take to Excel like ducks to water.
This is more "resource" than "curriculum" but have you seen Glitch.com? It's a combination hosting service/dev environment/playground that has lots of example projects that can be forked and modified, many of which are things that they might find interesting (messing around with Spotify playlists, etc.).
The ambitious plan behind FB’s cryptocurrency, Libra
I've seen non-professional programmers write the most amazing
things in VBA.
Can someone use this if they espouse "white nationalist"-adjacent beliefs (such as building a border wall and deporting illegal immigrants)?
What does it mean if they can or cannot?
The Canadian experience is probably the short distance from the USA. Contractors in metric Australia use millimetres. If mm get a bit ridiculous then we use metres. The translation between the two is simple (1m = 1000mm). Context is usually enough to know which unit is being used.
I would direct them to a game style coding session as gaming can be a stepping stone for some.

For me gaming led to wanting to mod the games, which led me learning how mods were created and learning to 'break' the game.

I am not affiliated with them however I did stumble across a DApp programming 'game'

https://cryptozombies.io/

If they like the above at that point I would direct them to other programming languages.
A simple text search will find it every time. Since Go code should always be formatted, it's pretty trivial to search for `type HTTPServer` or `func NewServer(` ... even over fairly large codebases this will give few enough hits that you can just search everything most of the time.
> Then W3C and the USB-IF are also "oligarchies" and dystopian?

Hm, I don't know, is the USB-IF habitually shaping political discourse of billions of people by either outright censoring or "demonetizing" [0] content creators with slightly different views?

[0] Of which this shitcoin is the logical strategy to cut off alternative income sources
> Are knobs and plastic moldings that expensive though?

Yeah, the molding for any typical single component is tens of thousands of dollars per iteration. A car has a lot of those components, so the fewer the better.
I'm pretty sure any competent welder and machinist running a small business custom-fabricating high performance automotive parts (or a similar field, like oil pipelines) would take umbrage with your description of their profession as "corporate drones who aren't self-thinking".
You perhaps don't understand that the Articles and Memorandum of a Limited Company can define a very different model to what you are thinking. They are a trust, the Scott Trust.
Maybe you meant to say Earth is anti-human. Earth is incredibly life friendly. There's been five previous mass extinction events and each time life has rebounded amazingly.
Is there a sense in which Russ's claim that "data races are not security problems" is true? It seems to be assuming that data races are impossible to exploit by users (data input), only by programmers.
That is an interesting post and does discuss the issue of always-local-to-me calendaring and planning future dates when you don't know what the political regime will do with those times in the future. Those are fair points.

For recording all events (i.e. times you see in logs, 99.9999% of timestamps you will see), there should only be one timezone: UTC.
I share the same concerns. I also love the subject and will buy the book, but I've come to notice that a lot of what's written about mental models is shallow, generic and/or not really actionable.
Actually most of the energy comes from renewable sources, which would be wasted otherwise.

That argument is just silly. I don't think that miners give a flying fuck where the energy is coming from as long as it's cheap.
> You should test input(say simulate http post call) then check the thing is in the fake database or even better a call to retrieve the item.

Agree. The key to good tests seems to make them neither unit tests or e2e tests, but something in between. API tests if you have an API, or "medium sized module" tests in other systems.

Unit tests and e2e tests have value too, but they're a lot more work to maintain for less value IMO.
Exactly. What this does is create a wide open space for a "anti-establishment" crypto payments system. But one that people actually understand and trust. Fiat will likely be UOA for stage one of the transition to crypto. But as more people get educated we'll move to fully Open payments. Many will use Libra. But many will use other services. It's not binary. Multiple winners will emerge. Brand identity will be huge here. Think Patagonia v. Walmart v. Nike. How you pay for things will become part of how you present yourself to the world. It's about to get very interesting.
Desalination just makes global warming worse.
First one is Beaker Browser. I know this isn’t a popular technology - but that’s not important to a teenager. I have been teaching some teenagers how to build little JavaScript apps in Beaker (no npm or git yet) and it has completely caught on for most of them. These are kids familiar with Scratch but not text-based languages.

The nice thing about Beaker is:

* They can write dynamic apps without needing to write server code. (We are working on note-taking apps and home pages that save to the file system.)

* They can share their stuff and link to each other without needing to publish anywhere. This also makes it a kind of private network, so it feels like a safe place to make mistakes.

* Has a built-in text editor and file manager. Eventually they will learn more - but let’s start with just the HTML, CSS and JS - that’s already a lot to take on.

* Concept of versioning is built-in, so hopefully this will make it easier to teach source control.

Other good tools that I have enjoyed using to teach elementary-age kids: Twine is amazing. And Scratch (as well as Scratch Jr on touch devices) are good preparation.

To determine interest level, I like to have them watch over my shoulder while I build something small for five or ten minutes. (Don’t go too long.) I start by just showing how HTML tags work. This will excite many of them - they may even start to conjure up ideas right away - if it doesn’t excite them, then perhaps the interest isn’t there. (Or they might not understand something like HTML yet and need something simpler.)
If the name is mandatory, as it is in Smalltalk, then this basically solves the issue.

If the name is optional, as it usually is in eg. Python, then there is a temptation for the writer to omit it, which means the reader won't know what "True" or "False" stands for.

Are there languages besides Smalltalk and its descendants with mandatorily-named parameters?
> For a long time, I kept a simple programming rule: The language I'm playing at home should not be the same language I'm using at work. This allowed me to learn new things that later I applied in the work codebase.

Though I've found this helpful in expanding what I can do, or how well I can do it, what I find using a different language at home than at work does best is prevent burnout.

I can be reckless, and play with the language, because I don't have the tired patterns of my day trying to rigidly enforce best practices and cover all edge cases.

My mind can relax and do the wrong thing if I want, and I don't have the autoformatter or linter in mind. I don't have a dozen rules that will spit red errors if I step out of line.

Those things are all good for work. The application must be solid, and the user deserves stability.

But when I'm hacking together a game for myself that I never intend to release, I just want to experience the fun side of programming without the hard part.
> clearly this is no "hack" to win elections because it is not working as you state.

Like I just said, it's working extremely reliably. Look at California, the opposition is decimated there not by the merit of liberal parties work or argument but by the sheer number of immigrant votes. Granted there is a delay factor such that new immigrants can't vote but the mechanism of immigrants voting for liberal party is still at work.

This is just for state level, I predict something similar happening at Federal level elections in a 1-2 election cycle period. Trump election was an exception IMO.
One more point from my 20 years experience:

Keep your development environment deterministic and instantly rebuildable.

You should ideally be able to take your hard drive out, put in a new one, install a fresh OS, run 1 script, and be completely up and running in less than an hour.

As an added bonus, this means that you can replicate your development environment on any machine very quickly and easily, which makes losing your laptop during travel only an inconvenience rather than a travesty.

I've hacked together some scripts for that here [1], although I really should convert them to ansible or something.

[1] https://github.com/kstenerud/virtual-builders

https://github.com/kstenerud/ubuntu-dev-installer
So when you purchase Libra for cash it’s like buying an index, only with no interest whatsoever. So all the risk and no reward. It’s not for no reason that index funds pay dividends - to compensate for a very real risk of losses. Interesting to see if libra will be able to pull this trick and push risk on its users without compensation.
In half that time, basically everything I have ever built has ended up in a ditch. I suppose I have learned a lesson or two since I started, but any lesson fairly pales in comparison to that fact.
Great lessons! Although it didn't include one that I had to learn the hard way, multiple times:

Your throwaway prototype will be the codebase for the project.

In my career, I've seen multiple throwaway prototypes that were hacked together. None of them ended up in the waste bin.

"Just add X and Y and you're done". "But this is just a quick hack to show the interface, there is nothing behind it!" "Yes, and the interface is fine, so why start from scratch? Just add the rest".

Now I know: I never build throwaway prototypes ever again, it's always a base for the project to come.
So true. I think that finding a project involves listening to the child/young adult and listening is a bit of a skill!

I think trust is also important. So if you can do a collaborative project where you do your bits and they do their bits then it should all work out.

Then you need some imagination. To think of a project. It should satisfy a personal itch. Or a neighbour's problem.

A good breakdown of roles is for adult person to do some hardware, even if the computer interface is just a switch and a relay and then the computer bits can be done by the young person.

I would say that listening is important, particularly if you want the young person to be owning the project.
A lot of water is stored in glaciers and mountains when it is cold and released in the spring and summer. If that water is no longer stored in the mountains, rivers will start to dry up in the summer.
There are a few physical buttons for the few critical functions you might want to trigger in the boost/reentry phase. The rest is either 1 g or microgravity and a touchscreen should not be a problem.

BTW, not surre if they implemented it in the end, but they planned to handle screen blurring due to vibrations by shifting the screen content based on accelerometer data in real time. A rather clever idea IMHO. :)
Reminds me of one unusual application of tests - working with inadequate or overadequate documentation (filled with many lines but difficult to find what you need) they work well as "scratch pads" for details which are unclear like "Does it return null or throw an exception when you attempt to remove something not in the collection?"
Looks like all the climatologists in here downvoted you.
I mean, its Bitcoin, the worst from all the cryptos. In the meantime I am using Ethereum to get electricity to my home (via lition.io), use it to take a collaterized debt position (via MakerDAO) and spending crypto daily in seconds with the Coinbase debit card. Just days ago I paid for my NordVPN directly with Ether, the transaction cleared in under 30 seconds. Bitcoin was the experiment, Ethereum is the working, usable product (which will only get better in the future).
C# is a fine language and it has had traction off the Microsoft platform for a long time.

For instance, many games for the PS(3|4| Vita) are written with something called the PhyreEngine which is based on .NET and lets you make pro-quality games that are portable across those platforms, the PC, and some other platforms too.
Portable Simula Revisited
In general, I would agree. However, the longer that old technology is deployed, the more expensive support costs. Parts become obsolete, engineers retire or move on, IT has to maintain archaic devices, operating systems, and tools.
I noticed that. I only note that I posted it on HN first but that post got traction instead of mine. Oh well... :-)
Press F9 if you're on Firefox :)
Nope. You shouldn’t be doing your own timezone conversions. If you are storing a time into a database the database should be handling the conversion of your date to UTC. If you care about the original timezone store that elsewhere. Do not make one piece of data serve two different functions.
I had the same experience on Wikipedia over a decade ago. My change was correcting a spelling mistake. A legitimate one. Not a British/American English difference. It was reverted within a few minutes.

I never contributed again. I don't recall the response I got along with the revert, if any, but I felt like my help wasn't wanted.

However, when Wikipedia donation season rolls around I definitely feel my help is wanted.
I'm not saying renewables are bad, they're not

And they can be used for more sensible things than mining crypto.

But that's an argument, which never can be won in discussions with crypto enthusiasts.

An enthusiasm, which, to me, has almost cultish qualities.
Why is Toyota so far behind the other manufacturers, despite having a initial lead in hybrids? Were they just betting that EVs would flop? Even Honda, which is a hold-out, has the Clarity which is a nice car (we have a Clarity and Leaf).
I have never heard of "HNs anti-procrastinator" - can you point me somewhere?
Maybe unpopular opinion: UTC with offset is actually better, because it contains information that might be worthwhile.

If I live in 2019-06-19T00:00:00+0200 and save the current time as 2019-06-18T22:00:00Z and don't have any additional information, there could be suddenly dragons...
> Learn when you can't code anymore. Learn when you can't process things anymore. Don't push beyond that, it will just make things worse in the future.

I cannot agree more. (18 years developer here). On those days I just kept pushing, I mostly ended up correcting my poorly-created code the next day. When you know you're done, be done, or at least switch to the lowest mental energy task you can do. Sometimes staring into the screen is that lowest mental task.
From the white paper:

> "Libra’s mission is to enable a simple global currency and financial infrastructure that empowers billions of people."

They do this by issuing coins in exchange for fiat money, which is held by the reserve.

> "Interest on the reserve assets will be used to cover the costs of the system, ensure low transaction fees, pay dividends to investors who provided capital to jumpstart the ecosystem [...]. Users of Libra do not receive a return from the reserve."

Conceptually this is a bank, but with no interest returned to users, no financial oversight from governments, controlled by Silicon Valley's top companies.
You could also drink your coffee out of a cup that can be washed and reused. Avoiding waste production in the first place is always the best option.
I use Go to solve problems. I don't solve _all_ problems with Go.

It works well enough, and the people I work with can collaborate in it easily enough.

I think that sometimes the (younger?) HN/SV crowd forgets that there are a lot of coders out there doing good work that don't need The Penultimate Best Tool. We just need a tool that works.
> Using the word “electric” in the description of a vehicle that doesn’t have a plug is deceptive.

Not really, we've had diesel-electric railway locomotives for over a century and no-one confuses them with electric locos.
That's why you should dispose of them in a landfill and not the ocean. Problem solved.
GLR, GLL and Earley's parser (with the tree construction) are labeled "context-free general" parsing algorithms because they can handle _any_ context-free grammar while the other algorithms associated with sub-classes of CFGs, such as LR, LALR and LL do not implement all CFGs. In particular this comes in handy for languages which are unambiguous yet require a lot of lookahead or context to avoid parser action conflicts. The context-free general algorithms are popular among people who have to rapidly prototype languages or implement many different language processing tools without the opportunity to spend months on a parser. We pay in speed. GLR and GLL typically run nearly linearly on normal files, while Earley has a bad average case behavior which is often quadratic.

Another benefit of context-free general implementations is composability of grammars. Since CFGs are closed under composition you can implement modular grammar formalisms using a context-free general parser.

Another main drawback is that (un)ambiguity of context-free grammars is undecidable, and so prototypes generated using GLR, GLL and Earley may produce more than one tree, and in release mode you migh report an unexpected static error to your user in that case. We deal with this drawback using random testing/fuzzing and some static analysis.
This meme of not getting rescue dogs is so harmful and needs to stop. Good adoption agencies will foster the dogs for a while and let you know if the dog actually has behavioral issues. Plenty of them don't. I'm convinced my rescue's previous owner was a little old lady who died or something. He has no issues at all.

Every time I look at my amazing rescue dog (my first dog ever) and think about how he was almost put to death in a kill shelter it brings me to tears and I'm so happy that I have him.
Kubernetes makes heavy use of generated code, as workaround for lack of generics.

They even gave a FOSDEM talk about this, with a very interesting title.

https://fosdem.org/2019/schedule/event/kubernetesclusterfuck...
The Tyranny of Amazon Convenience
Saying "We might have bugs" isnt a good reason to reject a proposal.

Generally you store an offset/name of the zone, which then isnt losing the valuable information about the source zone - if you dont do this you are right, this will fall down almost immediately.
Graphene: Become rich investing in this revolutionary material
New York and a good chunk of the Northeast get a lot of produce from Canada year round. New York is also a major port city with fresh food coming in daily. I can't find any heirloom anything in my local market, not a big enough draw. The farmer's markets are great though fresh from field to table and usually great prices from great people. In the Bay area you actually have a really nice pipeline to farmers which probably explains the great produce. Portland seems like it might have a rain problem with would limit produce to tolerant it greenhouse crops, especially tomatoes which do poorly in tons of rain. Even lettuce needs to dry out lest it rot.
If your kids get into coding and if they're doing Javascript (which I think is a good place to start for lots of reasons, but python might be better) I can personally recommend Free Code Camp for learning basics and intermediate topics in javascript web development. The interface is thoroughly gamified and it's very effective for people who are, but ONLY after they're enthusiastically hacking away at web dev. They'll be much more successful at learning the basics once they realize that they want and need the basics.
I totally agree that it was good move from a user perspective. It's just a happy coincidence. Or perhaps they saw how many outfits (shady or otherwise) were affected by the ban and decided it represented a good market opportunity for them to step in and fill a gap?
I heard another reason why Fortnight became so big. I had discussions with young high school gamers and they say the single reason Fortnight became so big is that it's available on every platform. Even though one person has an XBox, another has a PS4, another has a Nintendo Switch, another just has a PC, and the casual players have Android or IOS, everyone can play with each other when they go home. Also, they play a lot of different games, but they play Fortnight everyday.
As Hans Rosling pointed out in Factfulness, the birth and literacy rates in Sweden in the 19th century were on par with the poorest of African countries today, resulting in fully 20% of the population becoming refugees in North America to escape famine. And today, 150 years later, it's... Sweden. The ideal of modern civilization. He said he was born in "Egypt", by which he meant the economy of Sweden in the late 1940s was similar to Egypt today.

With that in mind, is there any reason that the poor countries of Africa today can't be the Sweden of tomorrow? It's more irrational to say they'll stay poor and overpopulated than it is to say they'll become wealthy and modern with zero population growth.
> Anybody knows anybody who really work(ed) on Move?

The authors are listed in the PDF
United States Spend Ten Times More on Fossil Fuel Subsidies Than Education
This was my first thought, too, when I saw the article.

But our thoughts about the effects of tidal lock on the emergence of life is little more than philosophy, having only one datapoint to extrapolate from, at that one not being tidal locked.
I've written 100k+ loc in go and i've had to use interface{} once. I would like a coalesce operator though.