Ask HN: How did you learn functional programming? - <AUTHOR> Functional programming is making its way into mainstream programming. Most of us know some basics and use them day to day but most don't have a deep understanding of functional programming. For those of you that do how did you get there? <comment><USER2> IMO there are two different types or schools of functional programming.

There is the Lisp/dynamic typing (Scheme, Clojure, Erlang, Elixir, Julia...) style:

Avoiding state from a correctness perspective is a basis but not necessarily the end-goal here.

The primary goals are to decrease complexity and coupling and increasing malleability, composability and empowering through interactive development (REPL).

And the statically typed (Haskell, OCaml, Scala, F#...) one:

Here there is a much stronger focus on internal consistency of programs, which enables stronger mathematical soundness and reasoning.

Note that this distinction is only in part equal to the general dynamic vs static one. Typing discipline is not completely orthogonal to the paradigm (for example imperative vs functional).

I personally am very much in the camp of the former and only have superficial understanding of the latter.

I always recommend SICP because it was the book that helped me 'get it'. But there might be more modern alternatives.

A question you can ask yourself: How do you approach programming?

\- Your program design is usually very high level. A graph of ideas. Then you want to interactively and iteratively discover requirements and check assumptions. You strive for simplicity and want to gradually achieve robustness, only where needed.

\- You think in terms of laying out rules and form. You want to infer the connections and implementations given those rules. You gain satisfaction from solving puzzles upfront to enable strong run-time guarantees and sound abstractions.

If you lean stronger towards one of these thinking models then you might consider diving deeper into its respective typing discipline.

</comment><comment><USER3> I learned functional programming many years ago, by reading the book COMMON LISP: A Gentle Introduction to Symbolic Computation by David S. Touretzky [1]. Incredible book, super beginner friendly; the chapter on Recursion in particular is one of my favourites. :)

[1] [https://www.cs.cmu.edu/~dst/LispBook/book.pdf](https://www.cs.cmu.edu/~dst/LispBook/book.pdf)

<comment><USER4> +10 for the chapter on recursion. It is not only a must read but probably the only thing one needs to read to understand Recursion.

I suspect Christopher Nolan read the chapter on recursion before writing Inception :-)

</comment></comment><comment><USER5> [https://cs.uwaterloo.ca/~plragde/flaneries/](https://cs.uwaterloo.ca/~plragde/flaneries/) the 'teach yourself racket' small book covers Hof, Lambdas, pattern matching, then you can take his other short course on Agda to learn dependent types.

Or try ocaml [https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/](https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/)

</comment><comment><USER6> Self taught more than a decade ago. JavaScript is my first programming language. In the language you can expressively use and pass around functions anywhere no differently than primitives.

Nesting functions provided a necessary structure that both includes containment and reference. At the time JavaScript did not have block scope, modules, or native classes. Also taking advantage of lexical scope in favor of prototypes/inheritance resulted in slightly faster execution. Really, for me, it was more about taking full advantage of lexical scope more than concern for what the function returned as a value.

I would see other people attempt to fake classes in the language and it was atrocious. First of all the code was ugly, but worse is that there absolutely no benefit to this. Clearly these other developers were just just trying to mimic some conventions they use in other languages without learning how to organize their code. That is the opposite of elegant and I didn't want anything to do with it.

</comment><comment><USER7> I actually learned functional programming first. The first language I spent any considerable amount of time with was Scheme, working through college textbooks and then later taking college courses.

</comment><comment><USER8> Study lambda calculus first.

An Introduction to Functional Programming Through Lambda Calculus

Book by Greg Michaelson

It's amazing it was published 31 years ago (1989) which shows that it's a timeless book to read.

This has been referenced from discussions a couple of times:

[https://news.ycombinator.com/item?id=6093386](https://news.ycombinator.com/item?id=6093386)

[https://news.ycombinator.com/item?id=3851352](https://news.ycombinator.com/item?id=3851352)

[https://news.ycombinator.com/item?id=11578961](https://news.ycombinator.com/item?id=11578961)

[https://news.ycombinator.com/item?id=10714770](https://news.ycombinator.com/item?id=10714770)

[https://news.ycombinator.com/item?id=773369](https://news.ycombinator.com/item?id=773369)

[https://news.ycombinator.com/item?id=16973546](https://news.ycombinator.com/item?id=16973546)

[https://news.ycombinator.com/item?id=14395620](https://news.ycombinator.com/item?id=14395620)

[https://news.ycombinator.com/item?id=13211603](https://news.ycombinator.com/item?id=13211603)

To quote a SO answer on why learn lambda calculus[0]:

If you want to program in any functional programming language, it's essential. I mean, how useful is it to know about Turing machines? Well, if you write C, the language paradigm is quite close to Turing machines -- you have an instruction pointer and a current instruction, and the machine takes some action in the current state, and then ambles along to the next instruction.

In a functional language, you simply can't think like that -- that's not the language paradigm. You have to think back to lambda calculus, and how terms are evaluated there. It will be much harder for you to be effective in a functional language if you don't know lambda calculus.

[0] - [https://stackoverflow.com/questions/114581/how-helpful-is- kn...](https://stackoverflow.com/questions/114581/how-helpful-is-knowing- lambda-calculus/114701)

<comment> non-entity Do you have to be strong in other forms of calculus prior to learned lambda calculus?

<comment><USER9> Calculus (from math) is not related to lambda calculus, they can be learned independently of each other.

</comment></comment></comment><comment><USER10> There's a 1.25 hour class on Pluralsight that covers it: [https://app.pluralsight.com/library/courses/functional- progr...](https://app.pluralsight.com/library/courses/functional-programming- big-picture/)

It's easy enough to pick up in an evening and explains it very well. It's behind a paywall but there's a free trial.

</comment><comment><USER11> I tried learning FP with Clojure, but could not get my head around all the parenthesis. Somehow came across Elm, it's documentation is very beginner friendly (and so is the language itself). If you want to learn typed FP, Elm is the way to go. But typed FP is little difficult to pick up.

These days I would recommend Elixir, if you want to a hang of untyped FP.

</comment><comment><USER12> If FP is going to survive within mainstream programming then it's the "very basics" of it that will carry it forward. It's the difficulty of understanding and application OOP that is leading to OOP's demise. Unfortunately, and incorrectly, the need for a "deep understanding" of either paradigm is not a factor that will lead to mass adoption.

<comment><AUTHOR> I agree but think I'd benefit from a deep understanding of the tools I use inorder to correctly reason about the solutions I apply those tools too.

I think mass adoption appears to be happening. I don't know why it is merely an observation.

</comment></comment><comment><USER13> Start with Clojure then move to f# then Haskell.</comment>


Nearly half of young millennials get thousands in support from parents - <AUTHOR> https://www.cnbc.com/2017/02/10/young-millennials-get-thousands-in-secret-support-from-their-parents.html <comment><USER2> This is exactly what one would expect to happen as the wealth gap between young (disproportionately affected by stagnant wages and student-loan debt) and old (disproportionately benefiting from low taxes on property/investments) continues to grow. Some parents pass the proceeds onward, but only to their own children. Some parents can't or won't pass anything on to anyone. The end state is a rigid class system in which most people's wealth is determined by their parentage instead of their own efforts or accomplishments. The solution is to levy less tax on the young and poor, more on the old and rich.

BTW, I'm on neither side of this. I'm too young to be funding my daughter's college or early adulthood, but _far_ too old to be on the other end of any such transfer. If anything, I'd be negatively affected by the suggestion above.

</comment><comment><USER3> The graph commits a couple of errors, one of which is a cardinal sin: [https://image.cnbcfm.com/api/v1/image/104274858-ParentalFina...](https://image.cnbcfm.com/api/v1/image/104274858-ParentalFinancialSupport_Increased.jpg?v=1529474173).

One is the glaring typo--1985 instead of 1965. Two is starting the scale at 30%. That makes the 35-50% jump look far bigger than it is.

The other two problems are cutting off in 2010 (basically during the aftermath of the 2008 recession), and starting in 1965. It looks like support decreased a lot from 1965 to the trough in 1980, then started trending back up. So what you might really be seeing is the consequences of the 1960-2000 period of unprecedented growth, with parental support returning to historical levels.

As an Asian person, I find it odd that people at CNBC would find this odd. Parents supporting young people starting out is an extremely old practice. These days it's paying for student loans, but back in the day it would mean giving household goods, land for farming, etc.

<comment><USER4> I don't know where you got 1965: clearly they just labeled 1990 as 1980. And truncated scales, clearly marked, are not a cardinal sin. They can be used to mislead but I see nothing wrong with the way they were used here. Cutting it off in 2010 is the bigger issue, I think.

<comment><USER3> "truncated scales, clearly marked, are not a cardinal sin"

^^^ I know some people are trying to make that happen, but no, it's egregious misconduct and there is no excuse for it.

</comment></comment></comment><comment><USER5> Can confirm. Massive help getting through school. Huge "loans" starting my own business. A life lived without financial fear because, even when not being actively aided, knowing that rich folk "got my back" is priceless.

Honestly acknowledging this has made me much more humble in my success and much more liberal in my politics than I would be otherwise.

<comment><USER6> I graduate high school in '03, turned 18 a month later followed by boot camp two months later. After boot camp, it was 1.5 years of air traffic control training. This involved 8 - 10 days 5 - 6 days a week in the military, knowing if I failed I would be washed out of the career-field, potentially kicked out of the military with no benefits. On a positive note, I wasn't in a combat role so that did alleviate some stress.

After I completed training and was comfortable as a controller I started using my benefits to complete school; went through two master's degrees using my benefits. Separated from the military while living in southern Turkey, accepting a role in a small town in Idaho as a data scientist. Wife and I landed in the states and a month later we drove our two children to a town we've never even visited to start a job I've never done. Five years later, I work from home as a data scientist.

Acknowledging the hard work and risks it took without a fall-back has made me much more conservative in my politics than I would be otherwise.

<comment><USER7> That was not an easy journey. The resilience to see it all through is certainly admirable.

I can't see why that made you more conservative though.

Is it a sense of wanting to keep every ounce of legitimately hard earned wealth, that would be used to make life easier for others in the work force, when you never got any support ?

Or do you mean it in a sense, where you work your way through the system, feel that the system isn't that bad and that others can similarly work their way through it without needing any extra support ?

I hope it does not come off as confrontational. I am genuinely curious.

<comment><USER6> I was raised and lived in fairly conservative areas - Alaska, Louisiana, North Carolina. Though as everyone does, I explored many areas of politics, attempting to formulate my own belief system; it is continuous work in progress never settling.

However, having lived and traveled throughout the world, from the US, Iceland, Ukraine, Turkey, Cyprus, Nepal and more I've learned that your own culture and people help you the most. The US is too big to systematically solve any problems at the federal level. Issues are best solved locally, at the community level.

I don't keep every ounce of wealth, we donate to our local church which gives to the homeless in our area. My wife gives her time to the church, helping families that are currently homeless. She aids in the school, volunteering in the classroom, functions, ensuring the children are receiving the attention they deserve. Local issues are what we are trying to progress. Areas we can see an impact - where our money, time, and effort are being used properly.

I do believe the system is set-up for people to succeed, but it isn't easy. Work, sacrifice, owning up to your mistakes and learning from them are what matters. I've never seen one person regardless of race, sex, or age be denied an opportunity they truly put 100% effort into. Does plan A always work? No, sometimes you have to accept plan C and make the best of it.

Hopefully, that provided a little insight. It is late here.

</comment></comment></comment></comment><comment><USER8> I wish the reality of our economy was talked about more. Without benefiting from the wealth of our parents, we'd be very poor indeed.

Most people I know are being supported in some way by their parents.

Maybe the United States should have a discussion about why most of us our getting poorer. If the American dream is to live better than your parents, then that dream is dead.

<comment><USER9> The current situation can be partly blamed on the quantitative easing undertaken by the Fed post 2008 housing crisis. By printing trillions of dollars out of thin air and using them to bail out AIG and other rich businesses the dollar in our pockets lost a portion of its value. The wiki section on QE talks about this effect in more detail: [https://en.wikipedia.org/wiki/Quantitative_easing#Increased_...](https://en.wikipedia.org/wiki/Quantitative_easing#Increased_income_and_wealth_inequality)

<comment><USER10> It also went directly into corporate balance sheets instead of to the average person. People that own tons of stock won BIG. People that own small-medium amounts of stock (think retirement accounts) did okay.

People who didn't own stock got nothing.

<comment><USER11> >> People who didn't own stock got nothing.

So they lost, since the total amount of money in the economy increased.

</comment></comment></comment></comment><comment><USER12> Why is this an issue? I'm in the GenX generation, and I know a lot of people that got help from their parents with college, cars, and even first homes.

<comment><USER13> Only in that those who aren't getting support are left behind, and feel like failures because they're not able to match the success of their peers, not knowing that they're working with significantly less resources. Also could lead to a lack of sympathy on the part of those who are getting extra help, thinking that those who can't keep up with them are either lazy or less capable, when in fact they are starting from a place of privilege.

Causes resentment and division, basically.

<comment><USER14> Is it possible to resolve this? Parents are going to want to help their children over others; people without that help will feel resentful. Seems like a consequence of human nature, and changing the tax incentives won't ameliorate what is essentially an emotional problem. (The issue isn't parents helping their kids, the issue is the reaction to it)

<comment><USER15> I think there are a lot of policy changes that could make massive strides towards resolving this. A significantly higher marginal tax rate and a wealth tax would reduce the amount of wealth available to gift. Lowering the amount of money that can be gifted legally would reduce the amount of support that could be offered. Free education and healthcare (and potentially a UBI), forgiving student loans, and some combination of rent control and improved zoning laws (and possibly vacancy taxes) would ameliorate most of the problem areas that people get help with and that cause this resentment.

I disagree that this is essentially an emotional problem. This is essentially an inequality problem; the inequality (unsurprisingly) breeds resentment, and trying to fix the resentment without fixing the inequality is just slapping a bandage over a sucking chest wound.

<comment><USER16> Would you say that a person would be more motivated or less motivated to learn new things every day and work insanely hard if they receive UBI, get income redistributed to them from richer neighbors, receive free goods and services, and also know that most of their wealth, if they earn it, would be taxed away?

<comment><USER15> Well, first, I reject the idea that the only potential motivation for learning new things, building interesting things, and working hard is personal greed, especially given that virtually the entire tech industry is built on the hard work of open source contributors, who built and continue to build incredible things without any expectation of financial recompense.

But more importantly, I don't really care if a few people are slightly less motivated if it means that we can unlock the massive amount of latent human potential currently wasted in poverty, hunger, and desperation. The number of people like that would be massively outweighed by the people who aren't scrabbling just to survive, and whose intelligence and work ethic could instead be turned to learning and building the future.

</comment></comment></comment></comment></comment></comment><comment><USER17> I lived at home while I was attending university. I didn't directly receive monetary support from my parents but not paying rent / not paying for food works out to a lot. I'm sure a large number of young people have always received some kind of support from their parents.

</comment><comment><USER18> Let's put to one side for a moment the legitimate problem of the millenial generation's money problem... the central thesis here is that generations should be financially atomized and autonomous. No I don't come from generational wealth but I've always viewed "my" money as the money of my parents and my children should they need it. There is an implicit social construction here of an autonomous nuclear family cut off from an extended family which I find curious and far from universal.

</comment><comment><USER19> Every time I see mention of this, I am reminded of the short story about the struggling butterfly:

[http://instructor.mstc.edu/instructor/swallerm/Struggle%20-%...](http://instructor.mstc.edu/instructor/swallerm/Struggle%20-%20Butterfly.htm)

Are parents doing a long term disservice to their children by doing this? I don't know. What I do know is that after highschool, a self-sustained budget became a real thing, real fast. I reckoned that a lot of my friends and peers received this so called drip feed of e-transfers from their parents. My parents were middle-class; not poor by any means, but they believed in "tough love" and strengthening through struggle. It was indeed a rougher ride, but I'm thankful for the outcome. Perhaps there is something intrinsic about paying your own way. But I believe I might be starting to see the subtle differences emerge from the two groups now that I'm in my early thirties among my circle of friends

</comment><comment><USER20> The idea that this is 'secret' is patently absurd. You would have to basically not interact with the world to think that.

Parents _not_ helping children out is an anomaly. It's definitionally bad parenting; it doesn't change because the subject may be physical goods or money rather than e.g. 20 years of food and water, or childhood education, or just making sure they don't walk out into the road, etc.

So too is the idea that people should be ashamed of it. Literally every non- damaged parent out there gives their children money or housing or something similar; the degree may differ (a poor parent may have to stop at 16 or 18), but the fundamental idea is the same.

I don't have wealthy parents. I've done fine. Would I have done better if, all else being equal, they had a few million? Perhaps.

To me this all seems like sour grapes. Be happy with where you are in life. There's always more.

</comment><comment><USER21> > about 40 percent of 22-, 23- and 24-year-olds get significant assistance > from their parents, much of which goes towards housing and _start-up > capital_

Must be some good parents?

<comment><USER22> In the context of this article "start-up capital" could also be defined as "all of the costs associated with moving out on one's own: furniture, dishware, utensils, etc." and would include a cash reserve for unexpected needs. This is beyond the monthly cost of rent covered by the term "housing."

</comment></comment><comment><USER23> My mom always told me about how she had to pay her own way as a young adult, due to her father financially disowning her for taking a scholarship to college (he didn't believe women should attend). That definitely colored my expectations towards asking for support, so I opted to work 20 hours a week or more during my college years to support myself. Even so, I did receive $500 assistance my freshman year towards buying furniture, as well as a used car for 4k (though I sold it after college for 80% of purchase price and gave proceeds back to my mom). I consider myself more independent than my peers because I never requested or took an allowance or payments after freshman year (and my tuition was paid via grants and student loans), but I still know that even my option to work part-time to pay for rent and food was dependent on having that car available, so I still recognize I wasn't as independent as I'd like to believe.

I do think most college-age or immediate post-college millenials could be more financially independent if they felt the need for it. I was definitely in the minority of students at my college who worked significant hours while also maintaining a full workload. So many people bought into the idea that school should be a full-time thing, or that their parents wanted to support them so they didn't have to experience crappy jobs - and they really didn't think financial independence was a valuable pursuit on it's own.

That attitude persisted after college for some of them. I have a friend living in a very expensive city, who got a masters in a STEM field, but won't apply for jobs that actually are attainable b/c this person believes they deserve better than a mediocre job living in a un-cool city in the midwest, and their parents don't mind footing the rent bill until that dream job pops up somewhere cooler. I was taught that sometimes you just need to take the crappy job as a step towards getting a good one (and it worked out for me), but the people who never had financial pressure to do that don't really see it the same way.

<comment><USER24> The funny thing is nowadays if you want your kid to come out of school with less debt disowning them is probably a pretty solid strategy. Either way the kid's gonna have debt but if the school/government thinks you're supporting the kid they'll take your money first whereas if they think the kid's on their own they'll give them financial aid first which preserves your ability to write a check 4yr later and wipe out a lot of that debt. Kicking your kid out of the house at 18 well enough to satisfy financial aid requirements is a hard thing to do though.

</comment></comment><comment><USER25> The most important factor to succeed in the US (and indeed, many other places); rich parents.

Sure, it's always been the case, but the trend is heading in the wrong direction ("wrong", that is, if you don't like rich parents being the key to success).

</comment><comment><USER26> > Why do parents continue helping children into their early twenties or > beyond? It seems to be, largely, because they can.

The evidence offered for this is simply that better off parents are more likely to do so now, but to answer why the changes occur you actually have to track what has changed in who has given over time (and also track against potential external factors, like broader economic conditions.)

Obviously, those who give are a subset of those who can, but that doesn't mean that that is what is driving the increase.

</comment><comment><USER27> I just want people to be less 'secretive' about receiving parental support; in my peer group it seems almost shameful to have help, yet I can guarantee all of us have received some sort of financial help from family. It seems disingenuous to not acknowledge this fact especially when talking about government financial assistance.

<comment><USER28> Just like incest and bankruptcy, dynastic wealth transfer is shameful when we plebes do it, yet it's perfectly acceptable for American presidential candidates and the royal families of Europe.

<comment><USER29> Wait, incest is perfectly acceptable for American presidential candidates? Since when? I thought it was only fine for members of Congress.

</comment></comment></comment><comment><USER30> How much of that "secret support" is keeping kids on your health insurance until they turn 26?

In our case, why not?

Most insurance plans have three tiers:

You

You+1

You+n

It doesn't cost us anymore to keep our grown son on our insurance since we also have a younger school age child than it would cost if he wasn't on our plan.

If he had to get his own insurance, it would be an extra $4000 a year probably with a plan that wasn't as good.

Yes he works and doesn't live with us.

</comment><comment><USER31> The fact is that the government taxes estates and not gifts. It's better to give money to your adult children, even if they don't need it, to avoid probate and estate taxes. This is just the basic mentality of "I don't want someone else to take my money."

<comment><USER32> That's just untrue.

You can give 15k per person per year (may have gone up in the past year) without reporting it. Anything more than that you have to report it, and it counts against the untaxed portion of your estate. Aside from that 15k per person per year value, there's no tax difference between giving it away now, or willing it away when you die.

Estate and gift tax are intertwined. There's even a page on the IRS web called "Filing Estate and Gift Tax Returns".

[https://www.irs.gov/businesses/small-businesses-self- employe...](https://www.irs.gov/businesses/small-businesses-self- employed/filing-estate-and-gift-tax-returns)

It might be easier to work things out while you're alive to make the gifts, but it doesn't get you out of the taxes.

<comment><USER31> Yeah, so the thing is that you give the money away while you're alive. You can give 15k per year per spouse. So a married couple with two married children can give away 30k to each child _and_ 30k to each son/daughter-in-law. That reduces the total estate that is taxed by 60k each year. If you have 20 years left of life, that's 1.2 million dollars given tax free. Way better than a probate.

You're correct that if they gave all 1.2 million in one year, it's subject to tax, but no one does that.

<comment><USER32> The threshold for estate tax is over $20m right now for that same married couple. Your example takes 20 years of foresight and only gets you an extra 5% before hitting estate tax.

<comment><USER31> 20 years of foresight is not much if you start at 55. 5 percent is still free money. I'm not sure what the argument here is. The rich are more organized than you give credit for

<comment><USER32> My point is that your initial comment stated this was a good strategy to avoid probate and estate taxes. I agree it's a good strategy to avoid probate, but I disagree that it's a very useful strategy to avoid estate taxes. You also incorrectly (or at least greatly oversimplified) said gifts weren't taxed.

</comment></comment></comment></comment></comment></comment><comment><USER33> Sounds like a Headline from the Zerohedge Website

</comment><comment><USER34> TL;DR quote from the article:

> Why do parents continue helping children into their early twenties or > beyond? It seems to be, largely, because they can.

Who said trickle-down economics doesn't work? :trollface:

<comment><USER35> Anecdotally, my millennial peers receive financial help from their parents because they'd otherwise not be able to save anything up due to crippling school loans and low-paying entry-level jobs.

I, personally, had to live with my parents for the first few years out of college. They were too poor to help out financially. To offset that, I don't take vacations, don't have a car, and generally just don't go out into town.

<comment><USER30> Whose fault is that? Why pay exorbitant tuition just to get a job that pays low wages? Which low paying job cares about which school you intended?

I went to an unknown state school,stayed at home and within three years I was making as much as people who paid more per year than I paid an entire four years.

<comment><USER35> That's a narrative that one was unlikely to hear about a decade ago in highschool. My parents & teachers essentially preached that you went to college to succeed in life. You _could_ not go, but you wouldn't have nearly as many opportunities to succeed.

That said, if I went back in time, I'd still attend the same school. It was a (expensive) life-changing experience.

(moral of the story: predicting the future is really, really difficult)

<comment><USER30> The moral of my story is don't go to an _expensive_ college.

<comment><USER35> Again, predicting the future is difficult. The fear with going to a no-name college was that you're throwing money down the drain to have the same opportunities as those who don't attend college at all.

<comment><USER30> Okay. I'm not being completely honest - I'm leaving out some details that changed the equation for me.

I did graduate from a no name school with a horrible CS program in the mid 90s and it didn't affect my career.

That could have been a horrible mistake. Especially seeing that I was accepted to Georgia Tech (still a state school) but I went to my school for free and they gave me room and board even though I stayed at home.

However, the few others that graduated with me from the CS department weren't so lucky. I had the advantage of having a computer growing up and a lot of them didn't have one growing up or in college. By the time I got to college, I had already been programming in assembly for 6 years on an Apple //e and in college I had an (expensive) Mac running Soft PC (x86 emulator). I also released a shareware program in college that caught the attention of another college to give me my first freelance contract.

That led to me being able to impress another company in Atlanta they offered me an internship with free lodging. Which led to my first job and the rest is history.

There was no GitHub back then or an easy way for most people to publish software. I happened to know how to hack around a dialup gopher server (showing my age) to get to Nyx ([http://nyx.net/](http://nyx.net/)) that offered a Unix shell to publish to the ftp Info Mac archives.

Today, I have a relative who was thinking about getting a CS degree from the same college I went to. I discouraged him and his mom from him going there. He actually needed the exposure, the education increased opportunities for internships, etc.

I still said that he should do his first two years st home and then transfer to a college in Atlanta.

But, if he was going to enter a low paying, non competitive field like teaching, social work, etc. I would have suggested he stay in the no name state school.

<comment><USER35> That's an awesome turn of events! I think there's a good lesson in there, that I wish my peers learned early on; higher education is nice to force you to figure things out, and improve your work ethic.

But what you do in your own time, at least in the Computer Science field, is likely what gets you a job you'll enjoy. If you aren't fooling around with servers and such, it's also a good indicator that this might not be the career you'd actually like to pursue.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER36> The FAFSA already takes such money into account when calculating aid. 'Secret support' makes this sound like it's a conspiracy on the level of the USC scandal.

<comment><USER2> They account for it even if it doesn't exist. I got screwed on financial aid (before the FAF and the other one were merged into FAFSA - it was a long time ago), because the amount was predicated on a much higher parental contribution than actually materialized (due to health costs). Not only that, but a far higher percentage of that total was work-study instead of grants.

I mention that not to gripe but to warn people, and to highlight the fact that differences in parental support really matter. I already see several people trying to minimize this by saying it's not new, they got plenty of support Back In The Day and so did their friends. Well, good for you. Not everybody did. It was a symptom of inequity then, and it's a symptom of inequity now. Enjoy your privilege, and hope that your children appreciate theirs.

<comment><USER28> If you can make do without health insurance from or tax breaks for your parents, the solution to this is to not apply for financial aid as a dependent. They will always consider your parents' ability to contribute, even if they hate the idea of higher education and refuse to spend a dime on it.

The amount of student aid I became eligible for once I applied as independent was insane.

<comment><USER37> You can't apply as independent until you reach a certain age, 23 I think, or a court has declared you independent or whatever. That excludes most students, who are trying to get a four year degree after high school.</comment></comment></comment></comment>


Is There an Instantaneous StackOverflow? - <AUTHOR> Is there a place you can ask technical questions and get answers within minutes of asking? <comment><USER2> Sure is. It's more than 30 years old. It's called IRC.

<comment><USER3> Exactly! I spent half of my youth in an HTML-related channel. I asked these people so much and learnt so much.

Of course in a chat room, you don't have so much structure as on StackOverflow.</comment></comment>


Florida Cop Sued Despite Baking 'Sorry I Tased You' Cake for Woman He Tased - <AUTHOR> http://nymag.com/daily/intelligencer/2016/09/florida-cop-sued-despite-sorry-i-tased-you-cake.html <comment><USER2> This title is just epic</comment>


Black Box, Red Disk: How Top Secret NSA and Army Data Leaked Online - <AUTHOR> https://www.upguard.com/breaches/cloud-leak-inscom <comment><USER2> press coverage: [http://www.zdnet.com/article/nsa-leak-inscom-exposes-red- dis...](http://www.zdnet.com/article/nsa-leak-inscom-exposes-red-disk- intelligence-system/)</comment>


Woloks - <AUTHOR>

Woloks is a messenger that is helping Ugandans send free sms messages. Its an app that has proven to be very effective where whatsapp cant help. Forexample, If you want to send a message to afriend but they are offline, woloks always comes in. What i wanted to know is do people on this site join discussions about startups in Africa? <comment><AUTHOR> Great</comment>


Stop commenting your code just to say you did - <AUTHOR> http://bradt.ca/blog/useless-code-comments/ <comment><USER2> God forbid someone gets their thoughts together with comments outlining what a function is going to do and then fills in the code...

Or, while deep in thought, someone taps out a bit of redundant commentary on a line or two of their code...

Or someone needs a bit of natural language to provide an anchor in their code.

The important thing here, I think we can all agree, is that we are smarter than that person.

<comment><USER3>
        // don't use hardware acceleration
        canvas.enableHardwareAcceleration(true);

Which is true? The comment is lie. Is this a bug? Was this changed for some reason? Should I remove the comment? Should I toggle the boolean? Why weren't we supposed to use HW acceleration? Why are we using it now? What changed? What value did the comment have in the first place?

<comment><USER4> >What value did the comment have in the first place?

That comment is the only indicator that something may be wrong. Your next steps are the same as with any suspected bug, find out what the code is doing (seems obvious here) and then find out if that's what it should be doing.

That comment, however, is a good example of a bad comment. In this particular scenario, it's very obvious what the code is doing, so the comment should describe why the code is doing what it's doing. Much like should do:

        //set volume to 5
        x = 5;

Rather than:

        //set x to 5
        x = 5;

<comment><USER5> > That comment, however, is a good example of a bad comment.

Yes, assuming there's not some contextual reason why hardware acceleration is obviously inappropriate. But even then, it would be much better to err on the side of "assume the next person to read it hasn't had their coffee yet."

Even something like "don't use hardware acceleration because compatibility issues" would be a better comment. You don't need an essay. But it should be both concise AND descriptive of the issue, not just normative or prescriptive.

</comment></comment></comment></comment><comment><USER6> Don't listen to this guy. Copious comments are great.

1\. They act as a easier-to-skim narrative of the code. You can often get an outline of a well-commented component by reading the comments alone, rather than by picking apart a language designed for machine consumption. Syntax highlighting makes this especially easy.

2\. They're helpful for other programmers who may not be as comfortable in the language as you are. For example, my PHP is about ten years old; I had no idea that `__construct` is the constructor, and not just another function. But thanks to the "useless" comment, I do know that.

3\. They're helpful for programmers who aren't as comfortable in the problem domain. A line in a FFT implementation may be "obvious" to those skilled in harmonic analysis, but not the poor client programmer who is trying to figure out why the function is returning garbage output.

4\. They can be useful as a thing to search for when you need to navigate around.

 _When deciding if I should write a comment or not, I ask myself a simple question: if I come back to this bit of code, will it be obvious why it's been written this particular way? If my future self will be very thankful for an explanation, then it's a no brainer, I write the comment._

Note the assumption that the code will only be consumed by "my future self".

Ever maintained someone else's under-commented or no-commented code? I'm sure the original programmer did not have any trouble with it, and will never know what he inflicted on his successors. Spend some time working in a comment desert, and you'll never complain about the rain.

<comment><USER3> Don't code for machine consumption, code for programmer consumption. Code is read 5x more than written, etc. Use function/method/class names that are readable like an outline.

Code comments are a poor teaching tool. Use a coding style guide/standard, pair programming, training, or a book to teach basic language idioms.

I don't buy the "searching argument". Ctrl+F for "account" will match a method named "lookupAccount" just as well as a comment that says "//lookup account". If you use a somewhat consistent naming scheme, it will probably be easier to search for something - try finding more than 2-3 words in a row in prose.

Putting so much perceived value and trust into code comments is like trusting "Architecture Design.docx" instead of looking at the actual running code.

</comment></comment><comment><USER7> I suspect part of this is enforced by TA markers in university.

When marking a TA isn't trying to understand the code, they just do not have time for that. So when evaluating the documentation or comments portion of the mark they just scroll through and see how much gray is on their screen. No marks are ever deducted for bad comments.

The situation can get so silly I've had TAs complement my code and the design then deduct full documentation marks.

This has led some people I know to go over their code before submission and add worthless comments. To them "documentation" is a separate step which occurs after you've written and tested everything. The whole situation is a shame.

<comment><USER8> It's not just markers at university, I've had managers who would do the same thing.

<comment><USER9> Working as a contractor, there are often deals that mandate "100% of functions documented" or other silly stuff (I would never strike such a deal, but have inherited projects with this). Since the client actually never checks the code (only metrics) and will never pay what it would cost to create amazing documentation (which only makes sense for public APIs) we just end up with tools that automatically adds comments to functions, which means the codebase ends up with useless javadoc-like clutter.

It's the same with "100% test coverage", which is similarly abused, programmer's are a lazy bunch, and smarter than any tool that measures the quality of what they do. So forcing them doesn't work out great.

<comment><USER10> _Working as a contractor, there are often deals that mandate "100% of functions documented" or other silly stuff_

I'm not so sure that's silly. It's absolutely overkill, but in a contractor/client relationship it makes sense that the client will want to make sure they have all the coverage they can get. And as a contractor you can bill for it.

</comment></comment></comment></comment><comment><USER11> This is one of the reasons that programmers who haven't read much of other people's code are a liability. They're as lost as novelists who don't read books.

The difference comes down to empathy: if you can get inside the head of your future readers, you'll know when to comment, and what to name that function, and how long the functions should be, etc...

<comment><USER12> So can we say the same about people who try to lobby everyone not to use any comments just in case they might be wrong? Because a helpful comment can be a very helpful thing to a reader of code

</comment></comment><comment><USER13> The example that he gives that I take issue with is the "Constructor" one in a JavaDoc comment.

When using documentation tools, every undocumented function spews a warning. And that _is as it should be._ But some simple constructors don't have any functionality worth documenting.

I code as if all warnings should be addressed, and that's true of my documentation generation. If a public function has no documentation, that should be considered an error that needs fixing. If the documentation is obvious, then _so be it._

That is the price you pay for reliably good documentation; without enabling those warnings you don't know when you've missed documenting an important function. And even sometimes the "obvious" is useful; I don't know how many ambiguous Boolean parameters I've seen where it wasn't clear what value "true" represented.

<comment><USER14> If you're only documenting after the fact, your function isn't worth documenting: it means you conceptually understood it well enough that you didn't have to think much about it's inputs or outputs. If you did have to think through it, or your code reviewer doesn't understand it, add a comment explaining it. In any other case, commenting on it is probably useless and adding to clutter. Javadocs are painful to read, not because it's a bad idea, but because so often it's things like "toString(): returns a string that is the string of this object". Sorry, I only need to know that function exists and it's return. I want to be able to scan through and see only those functions that are conceptually strange or unique, not the boilerplate that every class has to have, and is identical. If there's a comment on the toString() function, it had better be documenting something interesting, or else it's more useless than nothing.

<comment><USER13> >If you're only documenting after the fact, your function isn't worth documenting

I can't disagree more. You can completely understand _what you intend_ as you're writing a function, and then later, as you look back with a fresh perspective, realize in what way(s) the function could be misunderstood.

>Javadocs are painful to read, not because it's a bad idea, but because so often it's things like "toString(): returns a string that is the string of this object".

Straw man. "Bad docs are painful to read." Sure they are. If you have good documentation practices, you'll explain in toString() HOW the object is represented. "Return A string that indicates the (derived) object type, its x,y coordinates, and its current state, along with any additional state specific to the derived object type. You should not rely on its precise format, as it may change in the future."

The _real_ problem is that _most documentation sucks._ But the only way that developers will ever get better at documentation is to _practice._

I also am confused as to why "scanning" JavaDocs would ever need to be a thing; you do end up with your JavaDocs as a web page or help file, right?

If I'm confused about a function, I want to be able to click on it and see docs; if there are no docs on half the functions, that's a failure of the imagination of the API author(s). If they can't see how someone _might_ be confused, and yet I'm confused, then they blew it.

</comment></comment></comment><comment><USER15> I think the occasional "header" comment is useful, even in cases where the code is obvious, i.e.

       // do blah blah
       obvious_thing;
       obvious_thing;
       obvious_thing;
       obvious_thing;

       // do something else
       obvious_thing;
       obvious_thing;
       obvious_thing;
       obvious_thing;

Even though none of the lines really need documentation, having the comment ensures that you can quickly jump in when you come back later.

This is really useful in something like drawing code.

<comment><USER16> Here's a better solution:

      function main()
        do_blah_blah();
        do_something_else();
      end

      function do_blah_blah()
        obvious_thing;
        obvious_thing;
        obvious_thing;
        obvious_thing;
      end

etc..

<comment><USER17> It should be pointed out that with inlining, both versions are exactly the same at runtime.

Descriptive function names never lie, comments often do.

<comment><USER18> > Descriptive function names never lie

Beg pardon[0]?

        function _utf8Encode(&$arr){
          for($i=0;$i<(count($arr['parameters']));$i++){
            $arr['parameters'][$i]= $arr['parameters'][$i];
          }
        }
        function _utf8Decode(&$arr){
          for($i=0;$i<count($arr['parameters']);$i++){
            $arr['parameters'][$i]= $arr['parameters'][$i];
          }
        }

Or[1]

        public static string ReturnEmptyStringIfNullElseValue(string value) {
            if (value == null) {
                return "";
            } else {
                return value.ToString().Trim();
            }
        }

[0] [http://thedailywtf.com/Comments/There-and-Back- Again.aspx](http://thedailywtf.com/Comments/There-and-Back-Again.aspx)

[1] [http://thedailywtf.com/Articles/Common-Functions,-not- Common...](http://thedailywtf.com/Articles/Common-Functions,-not-Common- Sense.aspx)

<comment><USER17> I stand corrected. Thank god I never have to deal with such code!

</comment></comment></comment></comment></comment><comment><USER19> I cannot recall a time in my career as a programmer where the inclusion of a comment has caused me serious problems.

However, I can recall many, many times where I've read code that does something odd, and wished that there was some documentation explaining it.

I've met many programmers who rarely comment and make points similar to those made in this article. It's an easy argument: code should be self-documenting. But I've seen too many programmers jump from "code should be self-documenting" to "I shall never use comments/docstrings."

I feel like the problems outlined in the article are overstated. It really isn't a big deal when you read a comment that doesn't make sense, or is empty of content. It's a much bigger deal when you read strange code which really deserves documentation but there is no documentation.

</comment><comment><USER20> Thing is, just like with code, you write good comments by throwing away bad ones. The writing of the bad ones is not optional.

</comment><comment><USER21> Yes

If you write this: x = 1; // sets x to 1 I HATE YOU

Explain the WHY not the WHAT

It's the same crap with the Hungarian notation, where half MS didn't get how to do it properly. It's not the computing type, it's _what the variable represents_. Thank you, I know this is an int, the compiler knows it's an int. What I need to know is what this is counting/representing/etc

</comment><comment><USER22> I'm beginning to believe that if code is simply a machine-interpretable codification of human expertise, then we should be able to express precisely what the code should be doing using written language as well.

I've been turning this over in my head to figure out how it should look in practice, but I'm wholeheartedly believing the following statement is true:

"All code should be composed in two languages: first in whatever programming language the task requires, and second in whatever language the programmer speaks natively."

<comment><USER22> I guess an extension of what I mean is maybe we should write our comments in a way that a human could read a program like a set of how-to instructions, complete the same operations, and arrive at the same result interpreting your work in written language as the computer would arrive at running the code. In my way of thinking about things, code wouldn't be complete until it could be interpreted by man and machine equally.

This allows for the preservation of our human expertise by guaranteeing that any program can be translated in the future by another human reading the same written language into any other programming language (even if they can't understand your code). This could be important especially for some of the more exotic languages with sparse documentation today, imagine what it will be like trying to decipher these things in 200 years!

</comment></comment><comment><USER23> Comment first: project the document instead of documenting the project. In other words, write the comments first, then write the code, then review and tidy up both the code and comments.

By writing the text first, you clarify the _why_ before you write the how. You also capture the high-level view before you get down to the gnarly details, after which the high-level view can become a vague ghost of a memory.

Once that high-level view is left behind, many people become so immersed in the coding details that "introductory" material written after coding often begins with the esoteric details of the implementation of the central algorithm, and fails to mention what the tool/packages/code/app is _for_ in the first place.

To put it another way, documenting is to code as foreplay is to sex. Both code and sex can be effective without comments or foreplay, for some values of effective, but they are more likely to be more pleasant and repeatable over time if people put in a little time and effort before rushing ahead to what they see as the most interesting parts.

</comment><comment><USER24> I'll suggest there's a missing ingredient here...I found I was able to eliminate many of my comments by asking myself if that someone whom might read my code would be better served with a unit test instead. I also found, however, that this needs to lead to an understanding that unit test are in fact a form of documentation and should be treated as such.

<comment><USER6> It's a great point that, if there's some behavior worth capturing in a comment, you may also want to capture it in a unit test.

But why should you strive for the "ability to eliminate" comments? What is the advantage of having fewer comments?

<comment><USER24> I subscribe to the minimalism approach. i.e. I do my best to improve the signal to noise ratio (which is inline with the authors goal).

Also, in many cases, having a both the unit test and the comment is a redundancy.

</comment></comment></comment><comment><USER25> I've learned coding in Forth, so my code is often creating a domain specific language to solve a class of problems, and Forth shadow pages caused the documentation to be roughly same size as the code itself. But I normally comment in manual style. So the comments in my code do not tell how it works internally, but how to use it, and they are extracted from the code to create a standard Unix roff manual page. I think the Perl community did a good job in constraining a documentation style that is useful for those who want to use a module.

There are seldom exceptions, where I actually comment the code itself. Those are clear warnings that this code is not trivial to understand for average programmers. E.g. my w3dig search engine implements a recursive descendent parser for the site description language, that is not always executed linear, but sometimes pushes a parser class instance together with a closure to a queue, for parallel execution of the spider.

</comment><comment><USER26> Not that I don't agree, sometimes unnecessary comments kind of make it a bit complicated to understand what's going on. BUT, an important point to mention is that coders write code in different styles and manners, there is no right and wrong when it comes to comments. Sometimes just seeing that comments exist (even if some lines are pointing the obvious) makes a difference to the inexperienced or to the new-comers. Not to mention that "obvious" here depends heavily on the experience of the developer with language, framework, or whatever they're using. I guess the person writing the code should at least get to write comments the way the like. You're a programmer, reading a couple of extra comments won't ruin your day, just skip it if it's obvious.

</comment><comment><USER27> Comments in production code have always been a pet peeve of mine. I understand the OP's frustration on useless comments where the function clearly states enough in it's naming convention.

I brought this up to one of my instructors before and he said that comment overhead is negligeble on bandwidth (I was referring to css and js commenting at the time), but I don't think that's true when you factor in mobile networks and when some teams comment every freaking line when naming convention and common sense should suffice.

<comment><USER28> I would hope that you would be using minify in some way, which lets you still have your comments and just drop them for production.

</comment></comment><comment><USER29> One of my guiding principles for code comments has always been "say why not what". If I can't figure out that what on my own then something is probably very wrong with the code. What I want to know is _why_ you used a for() instead of a while() to iterate over an array or things like that. Comments that explain what you're doing I find to be cruft. I don't necessarily hate on them but I do find them unnecessary and unhelpful.

</comment><comment><USER30> My current employer makes the useless code comments mandatory. They do not need to make sense or be useful; the requirement is that they exist. Fortunately, they pay me enough that I am not looking for other jobs over it.

No, I'm looking elsewhere due to the many other aggravations that are not worth the salary.

Not only are businesses training younger developers to do this, but they are training older developers to expect it. Of course it is going to bleed over into the real world.

<comment><USER12> If they were paying you in part to make adequate documentation (which might well include good code comments) I wouldn't see any problem

<comment><USER30> It is a Cargo Cult Code Convention.

Good code has documentation, therefore our bad code will become good by adding documentation. Truthful comments, such as the following, would likely get the writer fired and not improve the code one little bit.

/* This code block is a crufty, kludgy crock of dung. I have argued several times that it represents a morass of technical debt, security holes, and degraded performance, but I have so far been explicitly denied permission to fix anything in it. In addition, it is so tightly coupled to equally bad code that it is impossible to test easily. But now the good news. If you can stand to look at it, this code will pay your mortgage, and the mortgages of 20 other people, because your bosses have more money than brains. _/

Instead of writing that, you get this.

/_ Magic. Edit this code at your own peril. */

</comment></comment></comment><comment><USER31> I can agree with the seeming intention of the OP, but the analogy of adding labels to wires in an electrical box is problematic. How does having blank labels on wires equate to poor commenting?

Good or bad, a comment says something about the code it's commenting (even if the code is self explanatory). A blank label says nothing about the wire.

The better analogy might be having labels on wires that state the color of the wires -- red, blue, green, etc.

</comment><comment><USER32> To author, the constructor is not a function it's a method.

I agree with useless comments but don't agree with blank 'constructor' method doc blocks that just say constructor as a filler.

Since most of the methods will have params/returns and better description than a simple constructor, leaving constructor without any doc-block is kind of counter productive and silly.

</comment><comment><USER33> Leaving comments in real life: [http://blog.jgc.org/2011/11/leaving-comments- in-real-life.ht...](http://blog.jgc.org/2011/11/leaving-comments-in-real- life.html)

<comment><USER34> From the article: "One day, I suppose, it'll be possible to use an app-for- that, to leave virtual notes."

WHYYYYY? Physical notes are much better! They'll be there forever, while the app would be a temporary fad.

</comment></comment><comment><USER35> Equally frustrating are revision comments (usually for a big end-of-day commit) that go: "Committed changes".</comment>


Why I Am a Sociomediapath (2015) - <AUTHOR> https://www.nealstephenson.com/social-media.html <comment><USER2> My favorite Stephenson book (thus far, I haven't read all of them yet) Anathem (2008) seems to directly capture this assumptions about the power of isolation on mental ability. Anathem describes a society of monks (the avout) that are isolated from the outside world, and also other monks. Their isolation basically allows them to cultivate mental superpowers in math, science, and philosophy, relative to people media-addled people on the outside.

When I was reading it, I had this romantic notion that the avout are kind of like our scholars in universities, isolated to pursue some narrow specialization without attention from the outside world. But, it's kind of depressing to realize how much even academics are pressured to play the social media game. There was even that paper (posted here on HN) that showed that researchers that tweeted more got more citations on their paper.

<comment><USER3> I used to think hiring people to manage social media was kind of silly unless you were some big brandname or marketing heavy organization, but it seems like a decent way to get most of the visibility benefits while avoiding the distraction related downsides, and a good opportunity to employ people. Depending how much you need to post to say relevant, I can't imagine most modestly successful small scale businesses/authors/academics etc would find it that expensive.

I cut out social media a while ago and have never hired anybody for it, so I might be a bit out of touch/underestimating what people expect your personal involvement or frequency of posting to be like, but it seems like something a fair number of people could afford to offload.

</comment></comment><comment><USER4> If curious see also

a thread from 2016: [https://news.ycombinator.com/item?id=10850084](https://news.ycombinator.com/item?id=10850084)

</comment><comment><USER5> I wonder when this was published.

Maybe it's the device I'm on, or maybe I missed it, but I can't seem to find a date anywhere.

<comment><USER6> Based on nothing more than my memory, I believe it was in 2015, around the time _Seveneves_ was published.

<comment><USER7> January 7, 2015 is the first snapshot in the wayback machine: [https://web.archive.org/web/20150107180518/https://www.neals...](https://web.archive.org/web/20150107180518/https://www.nealstephenson.com/social- media.html)</comment></comment></comment>


Ask HN: Advice on licensing software code to a company - <AUTHOR>

We (my partner and I) were recently approached by a company that would like to license the code for the raw features of an app we built. They want to build an app that has the same functionality for a market that we are not interested in venturing in. Any HNers have any advice on common pitfalls or situations to be aware of when going into a software license agreement? Thanks! <comment><USER2> This is a total minefield without an IP lawyer on hand to guide you, things that could bite you: relicensing (without your consent), sale of the source code, change of control, contamination, liability, competing with your own code a couple of years down the line (you may not be interested in their market, but they or their future owners might be interested in yours) and a hundred other 'little' detail. Little until they bite you.

Another thing to really worry about is to make sure that you actually have the rights to _all_ of your code and that someone didn't include code that isn't yours in your distributed sources.

You should definitely at a minimum take an MD5 of the code that you make available to them so that you can later prove that file 'gpldcode.c' wasn't a part of what you sent.

A listing of exactly what it is that you license should be part of the deal, filenames, linecounts and descriptions, there should be a 'non compete' clause, you should think long and hard about the conditions under which you want the license to be invalidated (those may cause the deal to not go through).

Licensing source code is a lot harder than licensing a binary.

[http://www.google.com/search?q=licensing+source+code+agreeme...](http://www.google.com/search?q=licensing+source+code+agreement)

Will give you a whole pile of reading material, I'd _still_ advise you to retain a lawyer that specializes in IP matters for your jurisdiction. Lawyers are expensive, domain experts more so, if the amount is small then the risks may not outweigh the upsides, if the amount is large enough it makes good sense to do the deal and retain a lawyer.

Is there any chance at all to modify the code to their specifications and license it as a library module that they will link to?

That might save you a large amount of headache.</comment>


Evidence for a Distant Giant Planet in the Solar System (Astronomical Journal) - <AUTHOR> http://iopscience.iop.org/article/10.3847/0004-6256/151/2/22 <comment><AUTHOR> Full paper:

[http://authors.library.caltech.edu/63794/1/document.pdf](http://authors.library.caltech.edu/63794/1/document.pdf)</comment>


Are We Becoming Slaves to Happiness? - <AUTHOR> http://www.abc.net.au/news/2017-02-16/slaves-to-happiness-the-case-for-negativity-in-the-workplace/8268458 <comment><USER2> I was under the impression that this was a particularly American problem. Nordic countries (at least Iceland, where I was) seemed to have no expectation for workers to be overly cheerful. Japanese customer facing workers are super (robotically) polite and employ fake personas, but they aren't exuding a happy exterior.

I guess I could see Australia as a place where they might have this issue though.</comment>


Ask HN: How do you customize TextMate? - <AUTHOR>

I recently got a macbook pro, and got TextMate. Will be doing some RoR development, and am a little disappointed by the stock display styles that come built-in with TextMate.
I noticed that the theme I always see in code snippets all over the web, typically dark/black background with pastel color fonts (e.g. the one on http://www.macruby.org/  right now) are not installed by default.
The Sunburst theme is the closest I have seen, but it doesn't quite hit home.
Firstly, does anyone know where I can get that TextMate theme that is so popular ?
Secondly, what other suggestions do you guys have for good themes that are easy on the eyes?
P.S. I know I can customize it manually, but that's a pain to do.
Please help. <comment><USER2> I think the TextMate theme that's popular in webcasts is Vibrant Ink: [http://alternateidea.com/blog/articles/2006/01/03/textmate-v...](http://alternateidea.com/blog/articles/2006/01/03/textmate- vibrant-ink-theme-and-prototype-bundle)

I use a clone of it for vim called Vivid Chalk: <http://www.vim.org/scripts/script.php?script_id=1891>

</comment><comment><USER3> There are a bunch of free TextMate themes here <http://wiki.macromates.com/Themes/UserSubmittedThemes>

assuming the theme that yan linked isn't the one you are looking for.

</comment><comment><USER4> You can get the one Ryan Bates uses in his railscasts here <http://github.com/ryanb/textmate-themes>

</comment><comment><AUTHOR> Thanks Yan & Mgrouchy.

The one that Yan posted was exactly what I was looking for, but I will definitely continue looking through those UserSubmittedThemse that you posted mgrouchy.</comment>


Has the Mystery of Skyjacker D.B. Cooper Finally Been Solved? TV Newsmans Quest - <AUTHOR> https://www.hollywoodreporter.com/features/has-mystery-skyjacker-db-cooper-finally-been-solved-1236196 <comment><USER2> I read this and all I could think was how terrifying it would be to have someone like Tom Colbert take an interest in your life. What a horrible person.</comment>


How to get through a crisis: narrow your focus - <AUTHOR> https://www.facebook.com/577449288/posts/10158189948939289/ <comment><USER2> (I haven't clicked or read the article as it's Facebook and I usually don't open FB links out of principle.)

My granny, born circa 1920, deceased in 1995, grew up uneducated in a peasant third world country. My dad was educated and was somewhat socially upwardly mobile as he managed to emancipate himself and the family from abject poverty. My gran knew nothing about the modern world and its bewildering complexities. But I still remember her giving my dad advice: "Son, whenever you're stuck with a problem, stop adding, always remove first."</comment>


Show HN: A compiler for a small language into x86-64 assembly - <AUTHOR> https://github.com/MauriceGit/compiler <comment><AUTHOR> This is my first compiler, so I expect there to be several things I can improve :)

I tried to follow the Assembly calling conventions the best I could.

I am looking forward to any feedback!

<comment><USER2> Sorry I won't be able to give you a lot of feedback.

As a matter or preference I really like colons and semi-colons.

That said your work is amazing. This is a true example of simplicity. I don't think most of people would get how difficult it is to _keep it simple_.

Everything is clear I can read the source code without asking myself "what is that", everything makes sense.

Thanks for presenting your work.

Do you have any constraints, like "no meta programming", "generated library should be as much as possible compatible with C", "it should have one pass optimization" or even "the compiler must be embeddable in most place as possible" ?

<comment><AUTHOR> Nothing wrong with semi-colons. Everyone has a different preference anyway.

Thanks for saying all that. It was a huge amount of work and getting appreciation makes it all worth it!

No hard constraints as of now. But I don't think I want to include meta programming or a pre-processor (don't really like it to be honest). I do want to keep it compatible with C internally, on Assembly level. One thought is, to create a file with function headers/definitions that are then dynamically linked and can just be used.

I used some C std library functions that way for debugging (printf, ...). And as I follow the standard calling conventions, the compiler should automatically generate compatible code.

With this, it would also be possible, to write OpenGL code. That would be really awesome :)

As of usage of my language - Not sure yet. Up until now, the road was more of the goal then the finished language.

</comment></comment></comment><comment><USER3> You can try FASM ([http://flatassembler.net](http://flatassembler.net)) besides YASM and ld.

<comment><USER4> Well this is funny. Originally (a number of years ago) I looked at using MASM, then I was informed to switch to MASM.

Then (last year or something) I find out YASM is actually intended to be an improvement to NASM, which I've used for about 6 years. And now I find out FASM is an improvement on YASM? How deep does this go??

To clarify: I had heard of all of these different assemblers and at some point looked at their websites but it was a very, very long time ago :)

</comment></comment><comment><USER5> Curios if you looked into ANTLR? That's what was used most recently as part of my compiler's course at Georgia Tech.

<comment><AUTHOR> Yes, I did (at least a bit). That and I read, that Go has a build-in yacc as well.

But decided, that for the first compiler, I want to actually do all steps manually myself for best possible comprehension of the general topic.

</comment></comment><comment><USER6> What would be your advice to someone who's about to write a compiler? I'm planning to start by reading the Dragon book.

<comment><USER7> I never got on with the Dragon Book despite several attempts.

<comment><USER8> You both should try "Compiler Construction: Principles and Practice" [0]. Theory is interleaved with substantial examples and exercises. You create an entire compiler for a tiny language called TINY (hah.) You write it in C and generate code for a portable virtual machine -- the book also goes into detail on the VM, with source code.

Lastly, the book's appendix has guidance for writing a compiler for a subset of the C language.

[0] [https://www.cs.sjsu.edu/~louden/cmptext/](https://www.cs.sjsu.edu/~louden/cmptext/)</comment></comment></comment>