Ask HN: Why code "post-reviews" isn't a thing? - <AUTHOR> Regular code-reviews are supposed to catch errors, bad style, or bad architectural decisions early on in the process. For it to work, however, everyone should be super disciplined and spend a lot of brain-power reading through each diff. Usually, it's really hard to dig into someone's code until you're fully int the cotext (read: working on the same piece of code). On the other hand, I often find myself in the situation when I'm dealing with someone else's code and think, "Oh god, how could I even approve this PR?". The next thing I usually want to do is let the team, and specifically, the code author, know that this is how we should NOT DO things. The problem, however, is that the code-review window has closed and there's no other standard place (besides GitHub PRs) to comment on the code.<p>I'm wondering if commenting on the code AFTER it has been merged is standard practice on some project and if there are any good tools for that. <comment><USER2> Why can't you say "this is how we should not do things" during the code review window? You should have a policy in place that all comments need to be addressed before approval, and with your comment in there (e.g. "we should not hardcode api keys" or "pull default params from the config file, not ENV variables"), others should not approve. Your CI process should require approval before merging. Now if it makes it past review and approval and gets merged, you can create a "tech debt" issue to refactor. You should also have a meeting of the minds to put these standards in a style guide and make sure it is followed when reviewing PRs.

<comment><AUTHOR> Yeah, but the problems is that I (and I'm sure many other people) just can't pay enough attention to every detail DURING the code review. Yet after the review, when you start using the code, issues just reveal themselves without any extra effort. I'm just looking for ways to prevent them from reproducing I think.

</comment></comment><comment><USER3> Just file a new bugtracker ticket or whatever that says "Clean up foo.js, it does Bad Thing A and Bad Thing B"?

There are processes for sustaining code architecture reviews and paying back tech debt, but if you're in a team that's merging obviously terrible code you might not be large enough to want that kind of structure.

<comment><AUTHOR> I've probably over-exaggerated a bit how "terrible" our merged code is but anyway, my point is that at the "review" phase the code is still "imaginary". We think that it'll work, but it hasn't been integrated with anything yet, it hasn't been battle-tested or, often, even used. Obviously, we find a lot of issues after the merge and filing tickets allows us only "not to forget to fix them". I feel like there should be a standard practice aimed at preventing those issues from RE-occurring.

</comment></comment><comment><USER4> I have the same problem at my job and a very similar process (biggest difference is that we require unanimous consent before merges). My overall opinion towards code reviews is that they don't work, software should not be seen as a static entity that is released and completed (like a building), but as something that requires constant upkeep (like an garden). Since our process was established 20 years ago (while I was in elementary school) time has been cemented it by bureaucratic inertia. So my approach is not what you can do to your process, but what you can do as an individual within your existing process.

The idea behind my approach is to convince the person to do the right thing on their own. First step is to mentally prepare, as if you were an actor preparing for a roll as a villain. Your attitude should be "any code not written by me is garbage, and should be completely rewritten." This attitude (which you should not adopt in your general professional life) will help you get through this ordeal. Next step is to poke as many holes in the code under review as you can in the time you have. Don't stop on the diffs, do it for the whole code base. If the person touched the code they are responsible for the whole thing. Send as many issues as you can back, cc their management. This will make some people angry, but it will be temporary and most importantly buy you time.

Management will be aware that their are issues with the merge, but they don't have the time to review your comments and understand the issues, they have other problems. They don't want doubt in the work going out and will do anything to make themselves feel confident. They will put their trust in you and will not allow the merge until you say it's good. You are the gate keeper, you hold the key.

Now it's time for the real code review. The person having the review now depends on you. This is where you get as friendly as possible. Complement sandwich works here "I like your code, there's just a few things that need to be changed, this looks like it's going to be a slam dunk, we're almost there, good job so far buddy." The most important thing now is to identify specific issues that have bounded solutions (not wild goose chase ordeals). The more specific and more bounded, the requests are, the happier people will be and the faster people can move on.

The whole idea here is to develop an understanding with people. You're going to tell people what you expect, and make it as easy as you can to carry it out without significant impacts to their schedule. As soon as they deliver on your requests, you approve. You go to management and say the code looks a lot better and you approved the peer review. Everyone looks good, everyone is a winner here.

<comment><AUTHOR> Wow, thanks for the extended answer! I liked the part about "any code not written by me is a garbage", although I'm mostly trying to drop this attitude :D Jokes aside, I got your point, but it's still about catching errors upfront, during a more tedious code-review.</comment></comment>


A Bayesian Model to Calculate Whether My Wife Is Pregnant or Not - <AUTHOR> http://www.sumsar.net/blog/2015/11/a-bayesian-model-to-calculate-whether-my-wife-is-pregnant/ <comment><USER2> I had a feeling my wife was pregnant even when a doctor and test said no. 14 mo. later my beautiful 5 month old girl only goes to sleep sprawled on her daddy's chest :D</comment>


Ask HN: Any interest in a business plan, free of cost? - <AUTHOR>

I work for a small digital branding agency and I had the idea of running a promotion for a free business plan.<p>If the interest levels are high enough, I can get the ball rolling ASAP. <comment><USER2> Do you mean business plan, or marketing plan?

What is your agency, What is your experience?</comment>


The Introvert's Hate/Hate Relationship with Spontaneity - <AUTHOR> https://tinybuddha.com/blog/the-introverts-hatehate-relationship-with-spontaneity/ <comment><USER2> This doesn't strike me as introversion it seems more like an anxiety related situation.</comment>


People Now Need To Be Told Where Links Are - <AUTHOR> http://mikecanex.wordpress.com/2011/06/03/people-now-need-to-be-told-where-links-are/

<comment><USER2> Actually, if you peruse the authors other postings where he actually does include links, you will notice that his link styling is set such that if one does not have 20/10 vision & absolutely perfect color perception (and a color calibrated monitor), the links look so close to identical to the rest of the text that it is no wonder his readers do not notice the links.</comment>


How to develop your Lambda Functions like a rockstar – our firsthand experience - <AUTHOR> https://firstname.lastname@example.com/how-to-develop-your-lambda-functions-like-a-rockstar-7d9422259d57 <comment><AUTHOR> Let me know if you have any questions! Happy to help</comment>


Ask HN: Does Startupquote.com infringe copyright? - <AUTHOR>

By using people's quote and face on their site without permission, what if someone gets annoyed? <comment><USER2> On the quotes: If the quotes have not been published by those who spoke them (the author), then they are not copyrighted. In fact, Startupquotes.com could claim copyright ownership of the quotes (and the photos if they took them) as they are the originating author, even if they are quoting someone else. A book of quotes is copyrightable.

On the photos: Yes and no. Using a private person's face for commercial gain without their permission might be problematic. The "public figure" statement doesn't apply here, as that is only relevant in libel / slander cases. If you remember, Obama was able to take down an ad in Times Square that used his photo / image without his permission. And he's definitely a public figure.Of course, if you are using someone else's photo without permission, then you are violating the photographer's copyright on the photo.

Here's the rules on whether or not you need permission to use someone's photo (image):

        Photographing People in Public
        Q: Can I photograph people in public places without their permission?

        A: Absolutely. People get really muddled about this issue, but the reality is that you have a virtually unrestricted right to use a camera in public. One big caveat: It's common courtesy to get verbal permission. Nonetheless, people don't have the right to bar you from photographing them in public, where they would not ordinarily have an expectation of privacy.

        Q: Can I publish pictures of people I've photographed without permission?

        A: That depends upon the purpose of the picture. If it's artistic or editorial in nature, or can be characterized as to inform or educate, then you do not need your subject's explicit permission.

        If the picture or any associated text may be libelous, defamatory, or fall outside of what courts have described as "the normal sensibilities" of the target audience, then you may need permission from the subject for your own protection. You also need permission from the subject if the picture is used for commercial purposes, such as in an advertisement.

IANAL, but I sure can pretend pretty well.

</comment><comment><USER3> The quotes are really nothing to do with copyright.

Quotes are like reporting -- they (the people) can't copyright something just because they said it. I can quote what you say, you can quote me -- there's nothing there actionable. (People do sometimes trademark quotes, but those are for limited use scope -- must definite usage -- and again, trademark, not copyright, so can still quote them).

Was the quote from a magazine article? Well then yes, the magazine has the copyright to the ARTICLE, but a quote from it would (I think most lawyers feel) be perfectly fair use.,

In no way on that site do I see an actionable copyright claim on the people being quoted (standard I'm not a lawyer though clause here)

<comment><AUTHOR> What about quotes from a movie, like this one: <http://startupquote.com/post/4234103411>

<comment><USER3> The copyright issues are exactly the same -- nonexistent. This is really basic stuff.

Why all of the sudden do I feel that this whole thread is just an attempt to get notice/attention for these sites?

</comment></comment></comment><comment><USER4> The copyright of the photo belongs to the photographer — so that's the only real issue I can see (although there are plenty of creative commons photos out there). On the other hand if they attempted to sell t-shirts or posters there could be issues. (and I'll add to this that I'm not a lawyer)

<comment><AUTHOR> What if they can make money from ads on their site instead of selling t-shirts or posters?

</comment></comment><comment><USER5> Public figure exception.

<comment><USER2> Incorrect with regards to using their photo / image. Irrelevant with regards to quoting them. See above.

<comment><USER5> I'm pretty sure public-figure factors into paparrazi as well, not just libel/slander.</comment></comment></comment>


The most minimalistic CSS3 spinner you'll ever find (inspired by Kippt) - <AUTHOR> http://codepen.io/stephanos/pen/tfdlG

<comment><USER2> Cool - very nice - but just sits there in IE10</comment>


JavaScript = C + Lisp - <AUTHOR> http://www.cubiclemuses.com/cm/blog/archives/000307.html <comment><USER2> Aye, but minus the low level features of C and the high level features of Lisp. Like pointer and memory manipulation and macros.

Still, it can be a very nice language, I just wouldn't say it is "C + Lisp". Also I'm not sure what the article had to do with either Lisp or C, it seemed more like a discussion of haskell... Am I missing something?

Edit: I'm still confused. Anyone want to take a better shot at explaining what a monad is? Or, more precisely, what's so special about it that it deserves a special name?

<comment><USER3> A monad is a kind of control structure between functions. Kind of like if you could overload add extra hook functionality to the Unix shell pipe, besides just piping stuff along. For instance, seed it with a countdown, and every time stuff is piped to another process, see how much time has elapsed; if at any point it's been more than, say, 30 seconds, just stop the whole series and return an error. Or find a path through a maze by backtracking every time it hits a dead end, returning to the most recent unexplored path.

They're a necessary workaround to do some stuff in pure functional languages (which is why Haskell users make such a big deal out of them), but you can do some really cool tricks with them.

(NB: This is a really vague summary. I found this OCaml-based monad intro helpful, because it mostly avoids entangling the monad concepts with unrelated issues in Haskell. [http://enfranchisedmind.com/blog/2007/08/06/a-monad- tutorial...](http://enfranchisedmind.com/blog/2007/08/06/a-monad-tutorial-for- ocaml/) There's a good Monads-in-Scheme intro, too, I forget where.)

<comment><USER4> "They're a necessary workaround to do some stuff in pure functional languages"

This isn't actually true. You can still write imperative programs in a pure FP language. The most obvious way is to write your code in continuation passing style and pass the new state of the world to each continuation; taking the implicit state changes of an imperative language and making them explicit.

The real reason for using monads is that the scheme I just described is inhumanly complicated. Monads are a much more structured way of doing the same thing. Instead of writing these state passing CPS functions, you write functions that build them for you. A consequence of this is that monads perform much the same function as macros in Lisp; they are programs that build programs.

<comment><USER3> Agreed. I guess I should have added, "without making things unnecessarily complicated.".

I think that monads, too, are generally presented in a way that makes them more complicated than they really are. (Hence, I suppose, SPJ's comment about how they should have been called "warm fuzzy things".) Part of my trouble understanding them confronting the basics of Haskell at the same time, and I (along with much of what I read) focused on the IO monad. That's probably one of the most complicated ones. The ideas started to click when I switched to the Maybe monad -- not only is that one considerably more straightforward, but I (and probably many others) had already written essentially the same construct elsewhere, albeit without the formal notation.

</comment></comment></comment></comment><comment><USER5> Not really news, is it? Brendan Eich himself has said that he wanted to use Scheme as the embedded language in the browser, but the higher ups thought people would be frightened off by all the parentheses. So, he sneakily implemented Scheme with C-style syntax and nobody seemed to notice for a few years.

<comment><USER3> It seems like many of the strengths of Lisp/Scheme are an emergent property of the S-expression syntax, though. Expressions like ((if test func-one func-two) arg1 arg2 etc) are certainly more awkward with infix notation, for example. Using OO/polymorphism is one way around this, but that's a bit heavy-handed in situations where it's just a workaround for infix syntax. (Duplicated code with a switch or if block is even worse.) Also, macros / code generation are vastly easier with a consistently prefix notation.

Similarly, many of the advantages of stack-based languages like Forth and Factor emerge from postfix notation. Very interesting to compare the two.

It's really too bad that non-C-style syntax freaks people out so much, from a technical standpoint it's almost certainly the worst of the three. </fighting words>

<comment><USER6> _It seems like many of the strengths of Lisp/Scheme are an emergent property of the S-expression syntax, though._

I agree, and I think your use of the word "emergent" is exactly right: the properties in question were unanticipated, yet orderly and beautiful.

This point explains why abortive attempts to "fix" the s-expression syntax are about as old as the syntax itself.

</comment></comment></comment><comment><USER7> As my old boss used to say:

"JavaScript is my favorite language with curly braces" (we were lispers)

</comment><comment><USER8> JavaScript = subset(C) + subset(Lisp)

<comment><USER9> More like SyntaxOf(C) + subset(Lisp)

</comment></comment><comment><USER10> Just a side note:

 _acceptOnlyIf_ name doesn't tell what the function does. _acceptEach_ or _acceptAll_ could be a clearer alternatives (at least for a python programmer (there are _any()_ and _all()_ general functions in Python)).

</comment><comment><USER11> javascript is javascript, i don't see the need to say it's C with Lisp...</comment>


On Adobe, Flash CS5 and iPhone Applications - <AUTHOR> http://www.mikechambers.com/blog/2010/04/20/on-adobe-flash-cs5-and-iphone-applications/?r

<comment><USER2> _"I think that the closed system that Apple is trying to create is bad for the industry, developers, and ultimately consumers, and that is not something that I want to actively promote," Chambers said. "We are at the beginning of a significant change in the industry, and I believe that ultimately open platforms will win out over the type of closed, locked-down platform that Apple is trying to create."_

Apple's response:

 _"Someone has it backwards--it is HTML5, CSS, JavaScript, and H.264 (all supported by the iPhone and iPad) that are open and standard, while Adobe's Flash is closed and proprietary," said spokeswoman Trudy Miller in a statement._

(<http://news.cnet.com/8301-30685_3-20003006-264.html>)

To be fair, the Apple response doesn't address Chambers' appraisal of the App Store, but the fact is that iPhone still supports open development via the web.

<comment><USER3> Yeah, but comparatively, Apple is still less open. Android supports all those things, _and_ development with any toolchain you like. So long as it's a runnable APK, you can install it.

</comment></comment><comment><USER4> I don't see the developer lock-in on the iPhone being much different from designer/developer lockin with the entire CS suite.

This just sounds like a poor sport who wasn't invited to the same type of party they are already throwing.

<comment><USER5> How's that? I use Paint.NET when I'm on the road to edit .psd files and it works fine. Actionscript can be written in a text editor if you so desire. Dreamweaver's html and I couldn't even list how many third part pdf editors are out there. So how are designer/developers locked into the entire CS suite?

<comment><USER4> Many of the features in the .psd format are undocumented and proprietary, and some are not backwards compatible. Up until CS5, the .fla format was proprietary (it is now zipped XML, and I understand that there are undocumented features there too).

Ever try sharing an indesign file between different versions? You can't, even if they are one version off. Sure you can export XML, but again, it often doesn't retain the same layout.

Fireworks adds proprietary information to the PNG format, so you can't open those files in other editors without losing data.

</comment></comment></comment><comment><USER2> Key point:

 _We will still be shipping the ability to target the iPhone and iPad in Flash CS5. However, we are not currently planning any additional investments in that feature._

</comment><comment><USER6> For reference, Mike Chambers is the principal product manager for the Adobe Flash platform. You can read this as Adobe's officialish reaction on this whole debate.</comment>


Ask HN: Do you like to see "Back to top" buttons on websites? - <AUTHOR> I'm talking about the ones that are pinned to the bottom right and scroll along with you.
I use a low mouse sensitivity so they're useful for getting back to the top.
Do you find them annoying, useful, don't care? What about on mobile - I find that they just get in the way there. <comment><USER2> "Back to top" buttons are a system-in-system effect ([https://en.wikipedia.org/wiki/Inner- platform_effect](https://en.wikipedia.org/wiki/Inner-platform_effect)) and clearly an anti-pattern. Scrolling should be handled by the browser and if a user agent (for instance with a small screen) thinks it is neccessary to give help for scrolling, it should do so, customizable for the user. This is not the task of a website.

</comment><comment><USER3> Things like that should be browser features.

<comment><USER4> I use Vimium plugin to navigate web pages. gg brings to the top of the page whereas Ctrl + G brings me to the bottom.

<comment><USER5> C-g? Does that also work, or did you mix up G/S-g?

</comment></comment></comment><comment><USER6> I've always wondered about these. I don't care on desktop, because high velocity scrolling on a MacBook is easy. On mobile, the iOS pattern to tap the top of the screen is my go-to, I find these buttons to waste valuable screen real estate.

</comment><comment><USER7> No, don't like them (or anything fixed on screen like that), don't use them. (I use a desktop computer only) They're possibly worse (because not removable) than windows that pop up saying Subscribe? Cookies? etc which all always get a big NO from me.

<comment><USER8> Like you, I also hate it (which I mentioned already). However, often it can be removed by adding user CSS (if you use a browser or extension that supports that) (which I did not mention already).

</comment></comment><comment><USER9> I don't think I've ever used one because I usually have a home key. When I don't, I just swipe up.

</comment><comment><USER10> When I want to go up, I have already pressed the home key on the keyboard before I can think of looking for something to click.

</comment><comment><USER11> Depends on the page design and target user. For lengthy, multi-section pages, a "Back to Top" can be helpful, but it'd be better if there was a fixed Table of Contents with links to the sections of the page. Otherwise, I always have the Home/End buttons.

On mobile, page should be designed such that the button is easy to reach, visible and not blocked by or blocking the text. For a button placed on the bottom right of the page, the body content should be set up so there's a little extra padding on the right. This way, there's a clear visual separation between the text and the button.

</comment><comment><USER12> I just always use the "CMD-Up" shortcut on Mac so the "Back to top" buttons feel like visual clutter once you've learned the keyboard shortcut.

</comment><comment><USER13> Annoying, yes. If I'm on desktop and I want to get back to the top, I'll flick my scroll wheel or hit the Home button. On mobile I'll just flick the screen.

</comment><comment><USER14> I just don't care about them. They don't harm anything, I just never really need a link to go back to the top of the page, so I barely notice their existence.

</comment><comment><USER15> I use back to top heavily on 4chan for very long threads.

However, I would prefer the site just be minimally designed, so one fast flick of the screen returns to top.

</comment><comment><USER16> If you accidentally click on that button while you are amid reading or something....it can be a great frustration as it will land you to the top. So, sometimes I too find "back to top buttons" frustrating.

</comment><comment><USER17> What I do is just press the Home key. I have literally never used one of those back to top buttons.

</comment><comment><USER18> Love it!! When I don't see one, I actually get frustrated. Especially when it's a super long multi-section landing page.

</comment><comment><USER8> No, I don't like it. I push the "home" key to get back to the top.

</comment><comment><USER19> Occasionally useful on mobile for giant pages. Useless on devices with keyboards.

</comment><comment><USER20> I use them very often.

</comment><comment> t-3 On desktop - no, I use qutebrowser or firefox/vim vixen. On mobile: Yes. I have fat fingers and find gestures both difficult and unintuitive.

</comment><comment><USER21> I find them very important on phone, hate elsewhere.</comment>


An assisted suicide party - <AUTHOR> http://www.vox.com/2016/8/22/12552940/assisted-suicide-california <comment><USER2> This typically taboo topic has now come front and center. This forces us all to consider what would we do, and what we expect from others as well.

On the one hand, no one wants to publicly state that they believe death should be promoted. After all, where does that as a society leave us? What's next, suicide booths?

On the other, there are individual rights, dignity and choice. Much like in Old Yeller; we do know there are times when it is better to let go.

Even easier than in Old Yeller (for those of us who don't have to face this painful decision, at least not today) is the fact that these are certified sane adults making their own decision, as they are approved beforehand by the trusted of society (doctors).

Choice is a basic human right we all can agree we definitely want to provide. I am also reminded we all eventually die anyway and nothing we can do will stop that.

Our only 'choice' then, when it comes to death; is merely to improve its timing.

</comment><comment><USER3> Also: [http://www.voiceofsandiego.org/topics/commentary/what-i- lear...](http://www.voiceofsandiego.org/topics/commentary/what-i-learned- helping-my-sister-use-californias-new-law-to-end-her-life/)

</comment><comment><USER4> Should not have read this while at work. :/

</comment><comment><USER5> Beautiful and sad.

</comment><comment><USER6> Another reason I am against gun control. I can swiftly and painlessly end my life should the need arise.

<comment><USER7> Unless you use hefty shot/cal, shooting yourself in the head has no guarantees. Many people shift aim at the last second and blow portions of their heads off and still survive.

Also, think about the poor sod who has to clean up your body/find your exploded brains. OK, so you use a 22, so there's less mess, but again, you better hope it kills you all the way.

<comment><USER8> In my EMS experience, people rarely do what you described. I have yet to see one that wasn't successful.

<comment><USER7> I agree that using a firearm to commit suicide is still one of the most reliable methods, but it is not failsafe, and certainly not nice for the cleanup people, or discover(s) of the body... Like, It will stick with them for life.

"estimated the lethality of suicide by guns as only 91.6% effective, and Farberow and Shneidman (NL Farberow and ES Shneidman, The Cry for Help, 1961.) had it as low as 84.7%. The Hawaii Department of Health (1990) had it even lower at 73%. The same studies showed the effectiveness of hanging to vary between 77% and 88%."</comment></comment></comment></comment>


Nick Ciubotariu (Director Amazon Drive) - <AUTHOR> http://nickciubotariu.com/ <comment><USER2> HN is for stories that gratify intellectual curiosity—not this kind of curiosity. Please don't post like this here.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)</comment>


Ask HN: Did you wish there were cheaper hosted databases? - <AUTHOR> I am little torn between how expensive it is to get a hosted database.
You can often get free hosted MySQL databases when you buy web hosting service, and it even comes with web hosting offers that only cost $1. However, the performance is often bad and backup not existing.
If you then want to get a hosted database, where the main product are not web hosting, you can't find anywhere that only cost $1? or $2 dollars a month?
Compose.io is really awesome but they all start at $18 a month per gigabyte, which really adds up if it is only for side projects.
I could also just host it myself, but the real reason I want a hosted solution is that I don't want to think about backup. I could also just use all those free trials, but I want to pay!
I don't care about performance, I don't need failover, I just don't want to loose data!
I have asked it before, and the answers I got was I could use Google Cloud SQL and share it between projects, but sometimes I want to use multiple databases like graph and time series and I don't want to limit myself to only SQL.
The answer is, there is probably not a lot of money in it, but how does all those other really cheap webhosting companies go by? Could you automate yourself out of it? <comment><USER2> If you don't need the performance why not use amazon RDS micro instances? It's super cheap (even free for a year on the free tier)

<comment><AUTHOR> It costs $13 a month and is only SQL so really that super cheap I think and you can't get other database types like Redis, Neo4j, Mongodb etc.?</comment></comment>


Ask HN: How do you manage your Creativity? - <AUTHOR>

I used to work 40h/week and had plenty of time to do creative stuff.
Now I work 60h/week and even though I feel very productive and healthy, I've had give up the time I had for doing something creative.
How do you manage your creativity? Do you have a slot in your schedule for creativity? Are you spontaneous? Suggestions? Advice? <comment><USER2> Its really hard and i face that too. But it becomes easier when your idea/creativity gets so real to you then you will see yourself do crazy stuff to push the idea out. You will do things like working extra private hours and some reduce their work hours at their work place and others even quite the job because of the burning desire to satisfy the thirst for creativity

</comment><comment><USER3> work less? 60hs a week its too muc.

Creative work doesnt always has to be at work, you have guidelines, restrictions, etc to meet and usually you make something different when its free form creativity.

Hope it helps!

</comment><comment><USER4> Find employment that lets you be creative?

Good luck.</comment>


Game Developer Sentenced to Death in Iran Asks Obama for Intervention - <AUTHOR> http://kotaku.com/5883510/game-developer-sentenced-to-death-in-iran-asks-obama-for-intervention <comment><USER2> US ex-Marine working for US Department of Defence visiting an enemy country is arrested for spying, well, that was hard to predict.

<comment><USER3> It gets worse. He held dual US-Iranian citizenships, so what he did was the textbook definition of treason, regardless of how you feel about Iran. If anything, this proves he is too stupid to have been very effective in his job as propagandist. I feel sorry for the guy and hope that someone intervenes on his behalf, but he is clearly an utter imbecile.

<comment><USER4> What specifically are you considering treasonous?

<comment><USER3> Working for the military of an enemy state to undermine the government and instigate rebellion. I'm not making a value judgement. All I'm saying is that when you take everything into account, the legal charge isn't crazy. The punishment is a different matter; Iran's legal system is obviously barbaric.

<comment><USER5> Treason is punishable by death in the US too.

<comment><USER3> Yes, it is one of the only countries left in the Western world that still has capital punishment on the books. But death is not mandated as the minimum punishment: "Whoever, owing allegiance to the United States, levies war against them or adheres to their enemies, giving them aid and comfort within the United States or elsewhere, is guilty of treason and shall suffer death, or shall be imprisoned not less than five years and fined under this title but not less than $10,000; and shall be incapable of holding any office under the United States."

</comment></comment></comment></comment></comment></comment><comment><USER6> It's things like this that make me wonder why there are so many people that defend the government of Iran.

<comment><USER7> What exactly is a "thing like this"? Let's take a hypothetical example of countries A and B.

An ex-marine of country A is caught and sentenced as a spy in country B. Country A not only frequently makes open threats about invading country B, but has also invaded 2 more countries in the region in the last 10 years, one of those with a false pretext, and another to revenge the actions of a few men, not the actions of said country.

Country A, 60 years ago, had the democratic government of country B replaced with a dictator of their choosing.

Country A has imprisoned non-soldiers of other countries, taking them from their countries and keeping them in a remote prison in the tropics without even a trial. A lot of them where found totally unrelated to anything, i.e innocent, and released several years later without any compensation of course.

Soldiers of country A are known to torture, rape and beat prisoners from other countries, and even take pictures of said torture with their phones and laugh at it. Several widespread cases where made known.

Country A has weapons of mass destruction, and is the only country known to have used two of those in a war, killing hundreds of thousands of civilians, just as the war was ending and the enemy was surrendering.

Country A has made medical experiments on people without their knowledge. In one case, they publicly said they are "sorry", 40 years after the fact.

Country A is known to have very good relations with dictators and despotic governments in many countries where it serves it's interests.

Everywhere country A invaded in the last 10 years, they brought mass instability, civil tension or war and chaos, in the name of "bringing democracy". Coincidentally it's mostly in strategic places with lots of natural resources.

As late as 40 years ago, country A still practiced segregation in many of its cities. They have also assassinated their two most prominent anti-segregation activists. Even today, despite having made progress on the matter, a hugely disproportionate percentage of the black population of country A is in prison.

Finally, country A practices the death penalty as much as country B, and has a lot of religious fanatics among its population, too, and certain places even prefer non-scientific evolution theories instead of the de-facto scientific theory on the matter for their schools. It's a known fact that an openly atheist would never, as it is, get elected to the top office in country A.

Can you guess country A and country B? Would you get mad at country B?

<comment><USER8> You start out with a fair critique of the US, but the later stretched points undermine your argument:

> Country A has weapons of mass destruction, and is the only country known to > have used two of those in a war, killing hundreds of thousands of civilians, > just as the war was ending and the enemy was surrendering.

I was not aware that the mainstream view was that Japan was surrendering before the atomic bombings.

> Everywhere country A invaded in the last 10 years, they brought mass > instability, civil tension or war and chaos, in the name of "bringing > democracy". Coincidentally it's mostly in strategic places with lots of > natural resources.

Easier said for Iraq than Afghanistan. It already had chaos, civil war, etc. at the onset of the invasion. Expected returns from mineral wealth hardly justify the cost.

> They have also assassinated their two most prominent anti-segregation > activists

I'm guessing you mean King for one. Not sure who'd other would be? (Malcom X? He advocated racial seperation). Either way, it's a tall argument that the country (government?) assassinated them.

> Finally, country A practices the death penalty as much as country B,

Iran executes people at not only a far higher rate but even in absolute numbers. It also applies death penalty to a far wider range of crimes.

> and has a lot of religious fanatics among its population, too

Sure, but they aren't running the government

> It's a known fact that an openly atheist would never, as it is, get elected > to the top office in country A.

As opposed to being charged with blasphemy in country B.

<comment><USER7> _the later stretched points undermine your argument_

A little maybe. But also consider that I wanted to show how people from other countries think of the situation too. I mean, people tend to think of country B in country's A terms and framing of the discussion, so I tried to do something like the opposite.

 _I was not aware that the mainstream view was that Japan was surrendering before the atomic bombings._

That view is widely held all around the world. Try to find some Europeans thinking the bombs were "needed". There is also evidence that us leaders knew about it, it was just a showcase, mainly to scare off USSR. Besides, it's of little consequence if Japan was surrendering or not: the war was going on with conventional weapons even in more dire times, including the Normandy invasion, so nothing called at that time to drop atomic bombs on civilians (if anything ever does). Especially considering that Japan was at the time under attack by conventional bombs, tons of them, that had burned most of its cities and killed hundreds of thousands.

 _Easier said for Iraq than Afghanistan. It already had chaos, civil war, etc. at the onset of the invasion. Expected returns from mineral wealth hardly justify the cost._

It had the Taliban rule, but not much civil war anymore. And certainly no mass chaos and deaths, like it does post invasion. And it's not just "mineral wealth", it's also setting foot in a strategic area.

 _I'm guessing you mean King for one. Not sure who'd other would be? (Malcom X? He advocated racial seperation)._

Was thinking of X, yeah. Well, even if he advocated racial separation, just means he was killed just as a pro-black activist, instead of a anti- segregation activist. Both reasons seem bad to me.

 _Either way, it's a tall argument that the country (government?) assassinated them._

Who said the government? I said "the country". To show it in the same vain as people that blame other countries for things done not only by the government but also by local religious nuts, teams etc.

 _Iran executes people at not only a far higher rate but even in absolute numbers. It also applies death penalty to a far wider range of crimes._

Not much consolation. One's too many for my tastes. YMMV.

 _Sure, but they aren't running the government_

No, they only run the previous government. And no one can talk openly against them, or they will lose office pronto.

 _As opposed to being charged with blasphemy in country B._

You mean like in the Salem trials? What, that was long ago?

Then tell me, why Country A, that stopped practicing slavery later than other countries, introduced women's voting later than other countries, stopped racial segregation later than other countries, has not yet stopped practicing the death penalty unlike other countries, etc etc, thinks other countries should all be on the same timeline as it does, as to what laws they have?

<comment><USER9> _As opposed to being charged with blasphemy in country B. You mean like in the Salem trials? What, that was long ago?_

Europe was still trying people for heresy in the 17th century around the time of the witch trials. The inquisition was still very much alive throughout Europe (and enforcing the death penalty if needed). Galileo came very close to being a heretic.

<http://en.wikipedia.org/wiki/Galileo_affair>

 _Then tell me, why Country A...introduced women's voting later than other countries..._

The US: 1920 --Women can vote (with many states doing so before then)

[http://en.wikipedia.org/wiki/Womens_suffrage_in_the_United_S...](http://en.wikipedia.org/wiki/Womens_suffrage_in_the_United_States)

The UK: 1928 – Women received the vote on equal terms as men (over the age of 21) as a result of the Representation of the People Act 1928.

[http://en.wikipedia.org/wiki/Womens_suffrage_in_the_United_K...](http://en.wikipedia.org/wiki/Womens_suffrage_in_the_United_Kingdom)

Germany:

In Germany, women's suffrage was granted in the new constitution of the Weimar republic in 1919.

<http://en.wikipedia.org/wiki/Womens_suffrage#Germany>

France:

Suffrage was extended to women in France by the 21 April 1944 ordinance of the French provisional government.

<http://en.wikipedia.org/wiki/Womens_suffrage#France>

<comment><USER7> 30-33 countries had the women's vote before the US, from 1 year before to several decades.

Not to mention how many countries had abolished slavery before the Civil War time.

</comment></comment></comment></comment></comment></comment><comment><USER7> Title a little misleading...

</comment><comment><USER10> You know ... I gotta say ... Hikers coming into Iran the back way???

Ex-Military type who looks like a spy, sounds like a spy, and behaves like a spy, but somehow ... isn't a spy???

Look, Americans are probably well advised not to visit Iran right now. With the obvious exception of American black guys who play basketball REALLY well, you probably won't receive that great a welcome at present. You need to realize that if anything untoward were to happen to you there is little that we can do on your behalf.

I do think that the US Government should use its influence to protect its citizens but ... MAN... come on people ... please exercise a MODICUM of good judgement. Help them...Help you. That's not too much to ask.

<comment><USER11> Risking an entire team of special operatives, or spending a few hundred million in "bail", or going to war with Iran isn't much to ask?

I mean, I'm not saying necessarily leave the guy to rot, but we paid something like a million dollars a head for the _hikers_ \- and they weren't even employed by the DoD!

<comment><USER10> Just wanted to ask...are you saying we should do something for him...or that we should not?

Because I stand by my post, risking ANY of those things is, to my mind, too much to ask of the Government. Especially when individual Americans KNOW the risks of going to Iran.

<comment><USER11> I don't know all the options at our disposal. Maybe prisoner trades? I don't know. I agree the things I listed are too much, which was my point.</comment></comment></comment></comment>


Adventures in WhatsApp DB – extracting messages from backups, with code examples - <AUTHOR> https://medium.com/@1522933668924/extracting-whatsapp-messages-from-backups-with-code-examples-49186de94ab4 <comment><USER2> Oh, I wish this had been written a few months ago, when I had an old phone and a new phone each with messages the other didn't have.

I eventually managed to pull the sqlite databases while each was unlocked, merge them, and then put it back and convince WA to read it rather than overwrite from the network.

Several hours of my time, and almost certainly not worth it. Reminded me how bad and annoying platform lock-in is though.

<comment><USER3> I wish it had been written a couple years ago, when I lost all the messages I had in my Windows Phone. The official Whatsapp guide[1] reads to this day "at this time it is not possible to transfer your chat history to an Android or iPhone", which I can't interpret as a good faith error no matter how hard I try.

[1] [https://faq.whatsapp.com/en/wp/28060005](https://faq.whatsapp.com/en/wp/28060005)

<comment><USER4> WhatsApp still cannot transfer message backups between Android phones and iPhones. I switch between both with new devices every 1 or 2 years and it always a pain losing the messages.

<comment><USER5> Why do you need to save messages 1 to 2 years old?

<comment><USER2> Why should I not have them in the event that I want them?

Do you delete all your emails and wipe your contacts when you replace a device too?

<comment><USER5> 1) Your contacts are saved elsewhere.

2) Yes, I delete emails I don't need anymore. Almost all WhatsApp content is not important.

3) I upload pictures/videos to my Nextcloud NAS after which I delete them. Goes automatically.

<comment><USER2> But 1 and 2 are 'yes, I do want to keep things'. All I'm saying is WhatsApp (and similar) make that a pain, deliberately to try to lock you in, and it's annoying.

<comment><USER5> With regards to 1) they are simply saved elsewhere, in your Contacts. You can import/export _that_.

It is a sacrifice of user-unfriendly security. They could've easily made a backup function which does not (solely) involve Google Drive. They opted not to.

However there's an upside to this as well: if you delete that key, you're done for. If your discussion partner(s) do the same, the data between you and your discussion partners is also done for.

I agree with you, but I don't find it difficult to work around it, and the previous solutions (plaintext, unencrypted logs) were terrible.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> This is written by someone who doesn't know what Core Data is, or how it persists its objects. It's funny to see how they try to guess what various columns are and how data is formatted. They could have just imported the database file into Core Data and extract the model from there, load the entities, run sophisticated queries in an acceptable syntax, etc.

<comment><USER7> Or maybe this was written by someone who was more interested in showing how to use sqlite and pandas directly to do this?

On the other hand I find it interesting that Apple decided it was important to create some shim on top of sqlite with their own conventions, but said shim is not so convoluted it can't be reverse-engineered. Can't really decide if it's good or bad.

<comment><USER6> Core Data is an object-graph persistence framework, not a database. As said in the other comment, Core Data is an implementation detail, and there are other backends to choose from.

Apple adds additional metadata on top of the entities themselves in order to provide smart versioning and migration utilities. The entire object model is persisted inside the database, so that lightweight and heavyweight migration patterns can be deduced the next time the database is read. This metadata can also assist with opening WhatsApp's database and parsing it using Core Data.

</comment></comment></comment><comment><USER8> > [...] discover that WhatsApp doesn't work on it due to a weird message > > "Your phone date is inaccurate! Adjust your clock and try again." > I have > no idea what do date issues have to do with not starting WhatsApp but fixing > the date and time didn't help [...]

Some network protocols use timestamps for security. For example, OAuth 1.0 HMAC used timestamps as part of its mechanism for preventing replay attacks.

I have no particular insight into what WhatsApp is doing, though.

<comment><USER9> As you say that should be the reason, but it seems that in most cases documented online fixing the date and time doesn't actually fix the error message, nor updating WhatsApp to latest version...

<comment><USER9> and one more thing - this type of error shouldn't prevent WhatsApp from starting in any good programming practice; just from communicating with the network...

</comment></comment></comment><comment><USER10> As someone who keeps on switching from iOS to Android phones as my primary and daily driver i am still waiting for a way to effectively sync my Whatsapp messages over when i pick up a phone that doesn't run the same OS my previous phone was on.

<comment><USER11> Does iOS WhatsApp not support backing up to Google Drive like the Android version does?

<comment><USER10> iOS app backs up to iCloud and Android version of the app to Google Drive and they are locked down with no other choice.

</comment></comment></comment><comment><USER12> Quote:

"Reading around it seems that Apple, in their infinite unique wisdom have decided to use dates starting from 1.1.2001 on iPhone so let's see what happens if we add an offset ...."

This did put a smile on my face. The author forgets/doesn't know WhatsApp is Facebook's app, has nothing to do with Apple and the fact that he used this from an iPhone is irrelevant. On Android local /data/data WhatsApp's database is the same.

<comment><USER12> 2nd smile, upon re-reading. Quote:

"Let's see what we've got. The below is my analysis based on the data I've found in the tables in my own DB and my inferences about it: 1\. Z_PK — seems like a serial number..."

Yup, it is a serial number. One those who dream SQL, like me, for past 20+ years, will also call it Primary Key. This article is getting better with every re-read :)

</comment></comment><comment><USER13> On a wider scale, this is a step in the right direction for getting away from the lock-in of these kinds of platforms. Offering E2E but still in proprietary formats.

</comment><comment><USER14> WhatsApp Viewer: [https://andreas-mausch.de/whatsapp-viewer/](https://andreas- mausch.de/whatsapp-viewer/)

</comment><comment><USER15> would this work for android?

<comment><USER16> At least in the past, the android whatsapp database was encrypted, and you needed either a rooted phone or some shenanigans requesting the key from the whatsapp service.

(the Google Drive backup of it is not encrypted, but ... it's also not accessible to you! Facebook and Google are dealing your data behind your back, but don't believe you have any rights to access this data except through the tiny whatsapp app window)

<comment><USER17> The local database inside /data/data/ is not encrypted. However, backups (both local backups and Drive backups) are encrypted with a key generated on WhatsApp's servers when you log in.

You can access the Google Drive backup with this third-party tool, which admittedly is less than ideal: [https://github.com/YuriCosta/WhatsApp-GD- Extractor-Multithre...](https://github.com/YuriCosta/WhatsApp-GD-Extractor- Multithread)

<comment><USER9> I'll add this link on GitHub - thanks!

re: original question: AFAIK since Android 8 there is encryption of everything exported.

</comment></comment></comment></comment><comment><USER18> Nice work but its appalling that this had to be done to simply export some messages. Doesn't the GDPR require this for whatsapp already?

<comment><USER19> When I last looked into it they had an export feature in the app that basically compiled a bunch of text/HTML files on the device containing conversations and (optionally downscaled) image media. The export from the device itself was done through a mail client of your choosing.

<comment><USER20> There's no easy way to automate/schedule this, and you have to do it one conversation at a time. Long-running multiyear conversations produce unwieldy multi-MB files. They're not even doing the bare minimum to make data portable, as I see it.

I try to hold on to all digital communications with people I know (as opposed to service providers/professional interactions/strangers on the internet), and preserve it on my own hardware in portable formats. The idea is to have the digital equivelant of the box in the attic full of letters. Maybe that record will be interesting to me in a few decades, or to my descendants - or maybe not, which is fine too. But either way it would be a damn shame if we all collectively lost the "boxes of letters in the attic" to digitization, and these proprietary platforms aren't helping.</comment></comment></comment>


Apple's Censors Tech Mag Showing the Amazing Bending Phone - <AUTHOR> https://www.techdirt.com/articles/20141002/06053728698/apples-responds-to-tech-mag-showing-amazing-bending-phone-freezing-them-out-bendy-apple-products.shtml

<comment><USER2> I'm the opposite of an Apple Fanboi, but I doubt that this happened at all, or as the magazine is reporting. I would suspect Apple marketing maintains a blacklist of reporters and publications they don't invite to events, and I'm sure they just add people to that list, likely without notifying them they've been added. What would Apple have to gain by telling a publication they've been blacklisted.

<comment><AUTHOR> Suppose the iPhone 6 Plus really has a major design flaw. What can Apple do about it? Retire the phone? What would it cost to them? Impossible. They just have to stop the rumor, pretend it's not true, keep it quiet. So pretend it's not frequent, that only 9 phones were reported malfunctioning. They're the one who have the stats of reclamations: 9 or 900, no one can provide a number with better credibility. And stop the media from talking about it. Apple make the magazines fear to be excluded, just like what happened with Gizmodo. On the contrary, do the magazine really have something to gain by pretending they've been blacklisted, if it's not true?

<comment><USER2> I completely agree with you that Apple is likely lying about numbers or trying to make this a non-issue. What does the magazine have to gain? They made you look.</comment></comment></comment>


Farmageddon - <AUTHOR> http://www.theage.com.au/news/in-depth/farmageddon/2007/08/18/1186857827581.html

<comment><USER2> Interesting article but a quick look at wikipedia shows a lack of consensus among historians and archeologists as to whether water levels in the Black Sea radically affected ancient civilizations.

<http://en.wikipedia.org/wiki/Black_Sea_deluge_theory></comment>


Ask HN: Advice for 14-year-old who wants to learn to code? - <AUTHOR>

My younger brother who is a high school freshman wants to get started learning how to code.
He has no experience with writing code and little general computer knowledge about stuff like OS's file systems, etc. Basically he would be starting from scratch.
What would be a good place for him to get started?  I'd like to give him some resources so he can learn at his own pace, but I also don't want him to get overwhelmed and decide coding is too hard.
Thanks <comment><USER4> My son, who is a little younger than your brother, wanted to learn to code and I tried a number of things but they didn't really stick. He kept "wanting to" but never really learned past regurgitating the tutorial. Finally, he picked up my TI NSpire CX CAS and started playing with it. For us really old guys it's like the next, next, next gem TI 82 graphing calculator.

The TI has always included a programming language and interpreter in their calculators. It used to be "TI Basic" but now it is full Lua. They have hundreds of example programs to look and and learn from and tutorials galore.

The thing that finally made it click for him was, he could take this little handheld machine anywhere and whenever a programming thought struck him he could try it. Soon he was building reusable functions and libraries of reusable functions and everything clicked.

Now he's transferring a lot of that knowledge to other languages, most recently Python, without any trouble at all. I would recommend it to anyone with a kid who is interested in learning.

<comment><USER5> That sounds pretty cool.

I found C for Dummies at my uncle's house and got lucky. I loved it.

I've always wondered what alternatives there are. Most of the college textbooks I had were too dense to get into, but I think I remember the Deitel and Deitel ones were descriptive enough, but kind of dry.

Maybe I'll keep this TI NSpire CX CAS in mind next time the question comes up.

About 1.5 years ago someone posted this discussion of a related article on HN: [https://news.ycombinator.com/item?id=6303654](https://news.ycombinator.com/item?id=6303654)

</comment></comment><comment><USER6> I'm sure there will be a ton of good advice here, but one thing that I've always found helps a lot, regardless of what other resources or approaches you are using is to come up with a project that you want to complete and then use that to focus the rest of your learnings. It helps guide the learning and exploration.

It's probably better to pick something smaller and more achievable at first so you can make some early progress and experience some successes but picking a huge goal is fine too, you just have to break that huge goal down into smaller and smaller ones until you have a reasonably sized sub-goal to break off and work on.

</comment><comment><USER7> I like Codecademy[1]. They have courses in a few different languages ranging from HTML to Python. I went through the PHP course once to pass time and to evaluate their product as I had friends ask me a similar question. (I am very comfortable with PHP, which is why I choose that course.)

[1][http://www.codecademy.com/learn](http://www.codecademy.com/learn).

</comment><comment><USER8> If he's interested in games, buy him a book about game programming in a language that you know and would recommend for beginners. I got started programming because I wanted to build games and made the mistake of starting with web development.

Chances are that moment he makes a shape move on his computer, he'll be hooked. At least that's what happened to me.

If there's a CodeDay ([https://codeday.org/](https://codeday.org/)) near you, bring him to it. It's a nonprofit 24 hour hackathon for high schoolers. He'll meet a bunch of other people his age who are also into programming and will build and present a project by the end of the weekend. In the past we've had participants build everything from a breakout clone to a bootable OS in pure x86 assembly, so there'll be a wide range of skill levels and he'll see his peers building incredible things. Disclaimer: I'm one of the organizers of CodeDay LA.

There's also a Facebook group filled with other high schoolers who are into programming ([https://www.facebook.com/groups/PennAppsHS/](https://www.facebook.com/groups/PennAppsHS/)). If he has a Facebook, send me a link to his profile to my email (in my profile), and I'll add him to the group.

I'm also high school-aged and, if appropriate, would be more than happy to talk with him. Feel free to reach out to me through my email (again, in my profile).

Also see [http://www.paulgraham.com/pfaq.html](http://www.paulgraham.com/pfaq.html).

</comment><comment><USER9> I would say something like Swift, which would empower him to make apps that could make money too.

[http://www.learnswift.tips/](http://www.learnswift.tips/)

Also a Virtual Machine, such as VirtualBox would help him learn how other operating systems work without breaking his own computer.

<comment><USER10> I do kinda like swift. Also, Kotlin was a revelation - particularly since the tools are so damn good.

</comment></comment><comment><USER11> When I was 17 at my junior/senior high school, I taught about 20 entering 7th grade class programming and it worked out very well.

Downey's Think Python might be a good place to start (free download, but I'd recommend getting the hard copy) [http://www.greenteapress.com/thinkpython/](http://www.greenteapress.com/thinkpython/)

For reviews: [http://www.amazon.com/Think-Python-Allen-B- Downey/dp/1449330...](http://www.amazon.com/Think-Python-Allen-B- Downey/dp/144933072X/)

You might consider this book or related ones listed on Amazon: [http://www.amazon.com/Python-Kids-Playful-Introduction- Progr...](http://www.amazon.com/Python-Kids-Playful-Introduction- Programming/dp/1593274076)

There is this Intro iOS/Swift programming book that claims to teach non- programmers..... [http://www.amazon.com/Introducing-iOS-8-Steve- Derico/dp/1491...](http://www.amazon.com/Introducing-iOS-8-Steve- Derico/dp/1491908610/)

This book also seems very interesting and doesn't seem to require much/any programming experience:

Analyzing Baseball Data with R [http://www.amazon.com/Analyzing-Baseball-Data- Chapman-Hall/d...](http://www.amazon.com/Analyzing-Baseball-Data-Chapman- Hall/dp/1466570229/)

I _do_ think it is very important that somebody be readily available to teach/help with some of the concepts....

</comment><comment><USER12> Coding is not an end in itself. Your brother will need a reason to code, a problem to solve. That should come first and should be quite a small problem. Then choose the easiest tool with which to solve it. Operating systems, file systems, etc. are pretty much irrelevant.

You can do a lot with ancient tools like QBasic, simple graphics and so on. For more sophisticated things Python is a good tool because it has a simple syntax that is very readable and uncluttered.

Once he has made a few simple things like that run then if he has an Android device it might be worth installing Android Studio and trying to build some simple apps. There are plenty of tutorials with complete source code that can be examined.

And finally make sure that he understands that he can ask for help. The Net is full of information and people who can and are willing to help. I forget who said it: "There is no such thing as a stupid question, only stupid answers" so impress on him that when he gets genuinely stuck that he only has to ask on something like StackOverflow or many other forums.

</comment><comment><USER13> Tell him to join a local open source community and learn to work in group projects and to code in a team close to other people (Like the GDG, for example. It's free and in my town every week or two they organize meetings, hackatons, workshops and many interesting talks which they post on youtube in case you cannot attend that day). He can be useful even if he knows nothing, by being assigned the most trivial tasks or watch and help. Tell him to find a mentor and to get used to version control, code reviews, test writing, quality assessment, applying design patterns. Those are every bit as important as just learning how to code algorithms. I believe coding by yourself tends to make you a "bad" coder, in the sense that unless you are amazingly self disciplined you can take on a lot of bad habits that are very difficult to get rid off later on.

</comment><comment><USER14> A lot of college introductory classes use python as a learning language, and I think that's a good thing.

I would suggest heading to the library (whether public or high school's) and taking out a book on Python. There are a lot of online books, but I find that having a physical book you're learning from is a worthwhile experience. There's less distraction, and watching that bookmark move from the beginning to the end of the book is very satisfying. Also, I thnk it's extremely important that you be there to guide him, and foster inquisitiveness, as that's a very key property of some of the greatest computer scientists and hackers.

I will echo Igas's suggestion also -- it would be great if he had something he wanted to build to channel this urge into. Even dinky little programs like text-based calculators feel impressive when you're starting out, and get you a feel for programming quickly.

When he wants to cut his teeth on stuff that is "real world useful" you can show him a framework like Flask (which is wonderfully minimal), and have him make a web server on localhost. That would be a perfect segue into web tech (HTML/JS/CSS). That might also be a good time to introduce a second language, like Ruby (which is similar enough to python) to show how similar languages can be to each other. I would say this sets you up to introduce the most important parts of CS: the data structure & algorithmic underpinnings. This is the stuff that sticks with you for a very long time and is always useful, no matter the language.

This might be wishful/meaningless thinking, but you could also introduce him to SICP classes by abelson and sussman. I say this for a few reasons:

1\. Lisp is simple, yet powerful (they show this)

2\. The realization that very little about computer science is actually "new" thought

3\. Introduction to the plethora of college-level courses available for free, and getting used to being in charge of your own education (but using a more traditional medium)

</comment><comment><USER15> Blimey, what a complex set of things to learn nowadays - writing apps and javascript !

When I was a lad I started with the most powerful computer I could afford - <USER2> pencil and paper.

Show him this

[https://www.cs.drexel.edu/~bls96/museum/cardiac.html](https://www.cs.drexel.edu/~bls96/museum/cardiac.html)

See if it interesting.

Then I moved on to the next most powerful computer I could afford - a ZX81 with 1k of RAM connected to a television set!

I would type programs in from books and magazines and see if I could get them to work - so I learned to fix programs before I learned to write them.

So I still advocate this route. Not writing apps for iPhones or trying to write Xbox games and build websites.

Buy the simplest thing I can find - something like an Arduino that does things on a small scale. Learn how computers work, not how to program them.

</comment><comment><USER16> I did [http://tryruby.org/](http://tryruby.org/) with a friend. She understands better now what I do and what I mean by 'variables' but never touched code again.

</comment><comment><USER17> I would introduce him to coding by starting with the basics of HTML and progress through the following:

(install MAMP or WAMP for him to get him started, then get him a domain name and hosting for his own simple website)

HTML CSS javascript jQuery PHP MySQL

I recommend Head First HTML and CSS to get started. The other books in the series are good as well all the way up to Head First PHP and MySQL.

TeamTreehouse.com is a good place to start as well or pick up with once you make it through a few of these books.

Once he gets through those I would point him to learning Rails and/or Laravel frameworks creating a few web applications.

Apps are fun too if he has an iPad and/or iPhone go through the iOS App tutorials on TeamTreehouse.

Good luck in 2015.

</comment><comment><USER18> IMHO the most important thing is to keep his interest continuously for several years. I would suggest these steps: 1: Finding what is interesting for him - games, web, automation, hardware, etc. Open source project or good step-by- step tutorial is good starting point. 2: Preparing a build environment 3: Building and running 4: Doing small change in the sources - <USER3> something, etc. 5: Building and running again ... N: messing deeper with the source, changing complex things N+1: Building and running

In that way he will learn the fundamental process of building something in small steps and endless iterations, messing with other peoples code and navigating easy in it - that one is important too.

</comment><comment><USER19> I just taught my sister to code. Started out by talking to her about different kinds of projects/things that can be accomplished using programming. Once she had a grasp of what all can be done, she told me about what she wanted to do. She wanted to build a website to track food. Sent her to [https://dash.generalassemb.ly/](https://dash.generalassemb.ly/) to get started. After finishing that, she has now started googling specific tutorials and building the site on her own.

</comment><comment><USER20> I'd send him to [http://codecombat.com](http://codecombat.com) . It's not real productive coding, but it's a decent enough entry point for someone who may not have found their passion yet.

For me, coding is a passion. A labor of love. I haven't worked a day since starting. As an iOS developer, I'd say learn Swift. Apple pushed the great reset button and we're all starting from the same place.

</comment><comment><USER21> Have you tried Codecombat.com? I think this is a great way to get started, have fun and at the same time learn the basic concepts of computer programming.

Once he understands this, you should encourage to hack into Minecraft hacks.

Later you can ask him about start their own projects and help him when he got stuck.

Programming should be fun and using a language only a tool for their mind, so help him become passionate about build things for himself.

</comment><comment><USER22> I taught myself to code at a similar age (around 13, am 17 now) so this is based off personal experience.

Python's recommended a lot but personally I'd avoid it, it's a nice language but there isn't much to use it for without starting using frameworks.

What I'd recommend is starting with web development (that's where I begun). HTML can be taught easily and provides quick gratification, you can easily teach enough to produce results in a few hours, alongside HTML I'd teach the basics of CSS. I can personally recommend W3Schools[1] (though I believe codeacademy[2] is good as well), this can easily be personalised to make it appeal to your brother.

When he's got a decent grasp on this, Javascript or PHP links in perfectly (it could even be an extension of the HTML lesson - a larger project) so would work well to move onwards.

Another thing that I wish I'd have known about when I was learning is the amount of support available. I've since been involved in a local CoderDojo[3], if there's one where you are, I'd highly recommend going along to one with him! Even without any coding experience, I'd recommend it.

If you have any questions, feel free to ask :)

[1][http://w3schools.com](http://w3schools.com)

[2][http://codecademy.com](http://codecademy.com)

[3][http://coderdojo.com](http://coderdojo.com)

</comment><comment><USER23> I am a highschool freshmen. I would say to learn HTML and CSS from W3 schools. Then learn Python from [http://www.learnpython.org/](http://www.learnpython.org/), until he can use dictionaries. Then move to javascript and web development from MDN. Use node.js for server side so you only need to learn one language and can make a working app faster. Unless he wants to make games, then just learn Processing, then maybe C. Or brag to colleges, then just learn Python.

Python makes the transition from HTML to Turing Complete languages much easier since you don't need to worry about syntax. I am speaking from experience, I couldn't learn JavaScript until I learned the basics of Python.

Also, a large project is important. Working on my large TSA project has taught me a lot more than I would have learned by fiddling with smaller things.

Avoid web app tutorials that make you pass a test before continuing. Code Academy, Khan Academy, and similar things are nearly always horrible for actually learning. For example, Code Academy starts its CSS turorial with a CSS3 animation, and has 5 screens for a Python tip calculator, with cryptic instructions that make coding seem a lot harder than it actually is.

<comment><USER24> I couldn't agree less.

W3 schools is considered harmful by many and has at least in the past taught incorrect interpretations of standards. Please do not suggest them as a resource for new learners. It's better than it used to be, but is still unaffiliated with the W3C. MDN is a better resource.

For games, C# or Javascript are far better choices than Processing[0]. And C++ is a better choice than C, regardless of personal preference toward one or the other. Almost every game is written in C++, and libraries are designed accordingly.

Also, I would not recommend learning both server-side Python and Node. Node is not objectively better so there is no real reason to switch over just because it's "hot." Python has much more mature libraries and modules.

Large projects are not good for beginners, they cause sunk cost fallacy and probably repel a lot of people from new disciplines. Better to adopt a series of smaller, exploratory projects rather than reaching towards a momentous goal from the start. Beginners will only find themselves refactoring the same code over and over and over as they learn how to be idiomatic and efficient.

I _would_ second the no CodeAcademy-style tutorials advice, and recommend picking up a good book in whatever language you wish to learn. Not a "For Dummies" style book, but one that is respected in the language community. O'Rielly books are often good, but usually a community will have one or more "bibles" that are the best track to follow. _why's poignant guide is a standout example.

Finally, I would urge any beginner to look beyond web development. It isn't really a good way to learn programming: 90% HTML/CSS work that doesn't involve control flow and 10% string munging. Games are better, but application development is best, and is likely to involve learning skills that will actually continue to be relevant and interesting in 5 years.

Source: I'm an autodidactic programmer who worked professionally as a software engineer while still in high school. I help teach a high school CS class.

[0] I love Processing but web and XNA framework games are way better for new learners especially.

</comment></comment><comment><USER25> Why is he interested in programming? It must seem cool to him for some reason. I'd try to tap into that in order to find a direction to go in. And for a 14 year old, it would be helpful to find some heroes. Without the cool and the heroes, it may be hard to devote the time for it to be impactful.

</comment><comment><USER26> One great framework is [http://pygame.org](http://pygame.org) which is a flexible game and graphics Python module. It's great for learning Python and it's very easy to use (while still giving you a lot of control).

</comment><comment><USER27> In the UK, school goers do a 2 week work placement. Don't do what I did and let them choose for you, suggest an online company and push to shadow a PM, dev...it will at least be interesting and you might just learn a thing or two.

</comment><comment><USER28> What does it mean that he wants to code? Are you a programmer and he looks up to you, and wants to be able to accomplish as much as you? Or does he want to be able to produce some particular type of end product like games?

</comment><comment><USER29> I started in OSes and filesystems, but I recommend hitting Cmd+Alt+i on this page and typing:

        var comments = document.querySelectorAll('.comment');

        [].forEach.call(comments, function(comment){comment.style.backgroundColor = "#ffaa44"})

Instead.

<comment><USER30> Array.prototype.forEach.call(..) is more efficient because it doesn't create a new array.

<comment><USER29> Fixing NodeList.prototype.forEach() is best because it doesn't read awfully but this is someone learning to program, not to fix the DOM API.

</comment></comment></comment><comment><USER31> Great way to introduce programming logic at an early age (or all ages) ... [http://scratch.mit.edu/](http://scratch.mit.edu/)

</comment><comment><USER32> What is his favorite video game? Chances are there will be opportunities to mod the game / gameserver, which will really get his motivation up.

</comment><comment><USER30> Give him a browser, and teach him to manipulate the DOM using JavaScript. It is very rewarding when just starting.</comment>