397 comments

  • kaffekaka 4 hours ago

    Not a trick of the programming trade, but: life will not be clean, smooth and according to plan. Learn how to deal with things getting messy and derailed, and to accept that you "lost your streak" or whatever. Tomorrow is a new day, it is always ok to start over.

    Do optimize for the long term, but also realize you could be dead by next morning.

    • bionsystem 2 hours ago

      One life trick I learned way too late is that you're allowed to have fun, on your trade or on the side. One should enjoy a few light-hearted or relaxed moments every week. For some reason I was convinced that one should seek productivity at every moment, which is the fastest way to burn out.

      • kaffekaka 2 hours ago

        I completely agree.

        Enjoying life here and now is such an important aspect. For me, bouldering is such an activity. It demands maximum focus on tiny details in order to climb a piece of rock, which is completely pointless to do. Pure fun.

    • frontfor 2 hours ago

      Some might object to this analogy, but I view life like investing in an index fund. It’s a diversified bet across many aspects of life and many projects (akin to how an index fund is a diversified bet across companies, sectors, geographies). Many of the bets will fail (much like many companies in the market will crash or delist), but some will deliver so much return they carry the rest, but you don’t know which ones and when ahead of time. It will be volatile, but if you persist and survive in the long run the expected outcome tends upwards.

      • zigman1 an hour ago

        Not trying to be rude towards you, but I am always a bit shocked and a bit sad hearing people take their life as an investment strategy. I understand your point of view, but life also needs to be lived, not experienced as a constant chart moving up and right. My brother was/is like that, who is calculating profits and opportunities when hanging out with his friends, and will stay friend with someone as long as he will get something out of that himself. I find it a bit weird.

        However, I understand if you are coming from a poor background, most of your life resolves around how to improve it, so me not knowing anything about you, I am not judging you for this, just find it different.

        • OJFord an hour ago

          That seems like a very different take on life than GP describes, that just happens to use the same analogy on the surface.

    • apples_oranges 2 hours ago

      Whenever I start thinking along these lines I end up imagining how damn difficult life must be for many others on planet Earth, and how easy we've got it.

      • kaffekaka an hour ago

        Yes indeed. I am truly grateful having been born in a peaceful, rich country. No bombs dropping, no famine, no crazy dictator.

    • martini333 an hour ago

      > Tomorrow is a new day

      Today is a new day.

    • noreplydev 2 hours ago

      damn

  • augment_me 3 hours ago

    Temporary solutions will become permanent solutions unless you explicitly hold yourself to fixing it within a certain time window because it becomes harder the longer time has passed.

    This ranges from TODO's in codebases, to unpacked moving boxes, to replacing that sofa you got from your friend, to leaving a toxic relationship.

    After a while you acclimatize to the situation and no longer see the issue, and unless something is really broken, it grows harder to motivate yourself to change.

    • TobTobXX 22 minutes ago

      This is maybe just me, but I need to remind myself of the opposite: All solutions are temporary and imperfect. So just do something, I can always go back and correct it.

      For me this means that I'm allowed to store away 3 things from the moving box, even though I don't know where to put the rest yet. To invite others even though I don't know what to cook yet or to write a bad implementation quickly, instead of spending hours figuring out the best one.

      I think a balance of perfectionism and can-do is important. But as people are predisposed differently, either advice might make sense in different circumstances.

    • lazyasciiart 3 hours ago

      Also, even after you learn this, other people will refuse to believe it, and will boldly agree to commit to months of work that is utterly pointless and even a net negative contribution to the world, because they will never do the other few months of work that was needed. And then when you say “no, we shouldn’t do this” to the 45th project plan, they get offended and swear on their own heart that they will force the second part to happen or, or, or nothing. And 6-12 months later they’ll do it again! Like fucking goldfish!

    • bdcravens an hour ago

      16 years ago when I was starting at my current employer as a contractor, they gave me some test data. I put it in a table called {domain}Temp. That table still exists, and about half of our production data flows through it. And yes, we've been talking about changing it for 15 years. (oof)

    • mettamage an hour ago

      Oh damn.

      I guess I've learned something.

      Thanks :)

    • arkensaw an hour ago

      this is great advice!

    • noreplydev 2 hours ago

      old codebases are always, plenty of these

      • fmbb 6 minutes ago

        All successful code bases have this ”problem”.

        You become successful by making priorities. All parts of your product do not need to be perfect.

  • pif an hour ago

    Concerning professional software development:

    Customers buy solutions. They don't buy specifications documents, they don't buy elegant code, they don't buy automatic test coverage. All of these are useful only as long as they help you deliver solutions to customers faster. Any effort more is better spent on actually building solutions for customers. Maintainability is nearly top priority; real top priority is to have something to maintain in the first place.

    Corollary: quick-and-dirty exist for a reason. It's easy to say that quick-and-dirty is just dirty, and it's true: in the long run, quick-and-dirty takes longer than the-right-thing. But, there is a but: time doesn't always have the same value! Time just before a deadline is much more precious than the time after the deadline, when you can relax a bit and fix things before the next stress wave. Have it working and ship it now; we'll get it in better shape next week, while the customer will be happy playing with their new toy.

    • theshrike79 40 minutes ago

      And telling a customer that what they want a) won't work and b) is not cost-efficient to build can also be a good idea.

      You might "lose" a customer, but word will travel that you won't build crap that wastes clients money. Which in turn might bring in more business later on.

      Also when building a quick-and-dirty solution, make it LOOK dirty.

      A fancy UI with a janky back-end will look like polished software to the customer, keep the user experience in sync with the code progress.

      If your backend is WIP, the UI should be only unstyled plain HTML components when demoing it to the customer. If there is no UI, the backend should print all kinds of janky-lookig debug messages that make it clear it's not ready for production.

  • sgt101 6 minutes ago

    Find out exactly what needs to be done.

    So often the assumed goals of for an activity are malformed or the result of misunderstandings. Spending time pinning down what has to be done, why, and what the value of it is enables many other questions to be asked such as "wouldn't it be better to do X instead." The answer to that can often be a simple "no, because Y" but sometimes knowing Y is extremely helpful, and sometimes the answer is "yes, you are right" which is much better.

  • m463 5 hours ago

    good code may not look like you expect

    - duplicate code isn't always bad

    Sometimes* the same code copy/pasted or repeated is much easier to understand than pulling it all into a subroutine. It seems logical when writing code, but kills understanding when reading code. Predictable is better than compact a lot of times.

    - code should fail early

    Sometimes* "being robust", correcting errors or continuing after an error is the wrong thing to do. When something unexpected happens, failing, and failing quickly might be important.

    - explicit is better than implicit

    Sometimes* it is much better hardcode a list of things instead of constructing the list from whatever is there.

    concrete example would be a makefile that compiles .c vs a makefile that compiles one.c two.c three.c. Hardcode the list. Make it hard fail if something is missing or something is added. Yeah, it is more work, but the madness it prevents is worthwhile.

    there are probably thousands of these things. All are opinion, like camelcase sucks and indent should be 4, but not with tab characters.

    * not always

    • rhizome31 4 hours ago

      Strongly agree with your second point, too many times I had to figure out issues caused by code trying to handle errors but actually hiding them and making it so much harder to debug. The typical antipattern: catching SomeErrorType just to log "error of that type occurred", thus hiding the associated error message and the stacktrace. Even worse: trying to catch every error types.

      Don't catch errors unless doing something actually useful with them. Even then, it's often a good idea to re-raise.

      • resonious an hour ago

        I think it's impossible to come up with a good rule of thumb for error handling. Sometimes catch-and-log is what you want. Sometimes catch-and-reraise is what you want. Sometimes let-it-fail is what you want. I really cannot come up with a good argument that one of these is the better default. Languages should force us to consider which failure mode we want for every function that can possibly result in error.

        The most egregious thing to me is the fact that most languages let any function throw any error it wants without requiring that be documented or part of the type system or anything.

      • ehnto 3 hours ago

        I also believe people throw way too many exceptions. You should be able to be explicit about the outcome of an error case, and not just throw exceptions in a panic.

        So alongside swallowed exceptions is throwing exceptions in scenarios that were entirely recoverable, and I think in both scenarios devs just don't understand their program enough and are choosing to panic, or ignore the problem.

        I think people often throw exceptions rather than write the code that handles the situation more gracefully. If you knew it could happen, then is it really an exceptional circumstance?

    • theshrike79 an hour ago

      The Rule of Three: “When you’ve written the same code for the third time, that’s when you should stop and refactor it into an abstraction.”

      I think it's from Martin Fowler's book Refactoring. (It's been a while).

      The gist of it is that with one or two cases you might create the wrong abstraction. When you have three, you can abstract away the right bits without creating a monstrosity of optional parameters and booleans.

      • diggan 30 minutes ago

        > The Rule of Three: “When you’ve written the same code for the third time, that’s when you should stop and refactor it into an abstraction.”

        Small but very important change: "[...] that's when you should stop and consider refactor it into an abstraction". Sometimes it's needed, sometimes it's not, dogmatic following of that rule lacks the required nuance for real-life programming.

    • motorest 5 hours ago

      > Sometimes* the same code copy/pasted or repeated is much easier to understand than pulling it all into a subroutine.

      The Write Everything Twice principle is a much needed sanity check for absurd DRY practices. There are too many naive people arguing with a straight face that writing a base class and two specialization classes saves you the work of writing two classes.

      • noufalibrahim 4 hours ago

        That's one situation where it makes sense.

        I had another recently where I need to implement an integration for a specific protocol. It's got a standard but most providers are not completely compliant and it's not mature enough to be exact. An expert consultant asked us to implement a pristine version and then subclass, add rules to change fields, behaviour etc. etc.

        I suggested that it would make more sense to just copy/paste the implementation and make tweaks with comments that would accommodate the other providers. Worked like a charm and `diff`ing the files more or less gave us what's different. Got us from 0 to 60% without any problems.

    • sharkbird2 4 hours ago

      I like to think of it as that; you should have principles, such as trying to write DRY code, but any principle taken too far will end up being a bad thing. Don't be an extremist. Practice a sensible balance in everything you do.

      This goes beyond programming as well, I think it goes for most things in life.

    • Havoc 3 hours ago

      Also sometimes copy paste is faster than trying to abstract a code block into something generalised

    • __loam 3 hours ago

      Regarding your first point, I feel it's important to understand Liskov's substitution principle, which is basically, the code might look the same now, but it could diverge in the future if the contextual semantics around that code are different. Effectively that heuristic has made me a little more hesitant to do a bunch of consolidation that could end up increasing complexity by a lot if you need a bunch of special cases.

    • SV_BubbleTime 4 hours ago

      I think I had discussed every one of these items with my junior developer this week alone. Are you spying on me? Are we the same person?

  • shafyy 2 hours ago

    There's a Germany saying "Auch nur mit Wasser kochen". Loosely translated, it means "they are also only cooking with water". What it means is that nobody knows shit and nobody is special.

    • kaffekaka an hour ago

      That's a good saying.

      I once heard: adults are children with older bodies. People seem/try to be rational but we are all so influenced or downright controlled by emotions. The desire to be perceived as rational is one such driving force. Many things we do since "this is the right thing to do" are in fact done to reduce (or control) our anxiety. In this sense we are still children.

    • apples_oranges 2 hours ago

      In programming however, the skill and foundational understanding varies greatly, and while everyone is cooking with water, there are big differences how you cook. :P

    • 0x737368 2 hours ago

      Very relevant to most advice one finds on HN

    • jenscow an hour ago

      Everyone's shit smells the same

  • treetalker 14 hours ago

    The big one, for keeping my focus on the power of repeated, consistent action, and prioritizing my "future selves":

    What is likely to happen if I do (or don't do) this thing one thousand days (or times) in a row?

    Examples:

    - exercising 2h per day and eating right --> I'm going to look and feel great and my health will be far better than that of my peers

    - Should I buy these cookies along with the rest of my groceries? If I do that 1,000 grocery trips in a row …

    - spending 30+ minutes per day reading the highest quality material I can find; taking notes; and figuring out ways to implement the knowledge and ideas I gain --> …

    • theshrike79 42 minutes ago

      I have a similar thing but for putting purchases in context.

      If I buy a good quality pair of jeans and I wear them 200 days every year for multiple years, its cost per wear is negligible even if I pay 100-200€ for them.

      On the other hand a pair of fancy suit pants I wear for that one wedding and maybe Grandma's birthday is going to have a massive cost per wear -> no need to get the top shelf stuff, maybe just rent? Grandma is fine with business casual so I can go in with a jeans and blazer =)

      The same works with subscriptions. Youtube Family isn't cheap - but we watch so much Youtube content that just the ability to skip all ads on every platform without addons or special clients is easily worth the time saved.

      (It's also interesting that kids under 13 can't be enrolled to a Family on Youtube and thus are inundated with unskippable ads...)

    • alper 2 hours ago

      It takes altogether too long for many people to find out that they have a body.

    • itsmevictor 12 hours ago

      I like your approach to relating your daily choices to your broader life goals.

      I think you'd like Atomic Habits [1] if you haven't read it already.

      [1] https://www.amazon.com/Atomic-Habits-Proven-Build-Break/dp/0...

    • johnfn 8 hours ago

      This is a good one. What's gonna happen if I respond to comments on HN for 1000 days in a row? Uh oh.

      • etothepii an hour ago

        You will have high reputation and be able to change the background colour, down vote comments etc.

    • becominghim 2 hours ago

      i like this, might be good for you to checkout https://trypodly.com/ if you're an avid podcast listener

    • socalgal2 4 hours ago

      how do you arrive at 2hrs a day? AFAICT 1hr a day gives you 90-95% benefit of 2hrs.

      To put it another way, comparing to 2hrs

          15mins = 50% benefit
          30mins = 75% benefit
          60mins = 90-95% benefit
          120mins = 100%
      
      Everyone has their own thresholds but paying double for 5-10% more doesn't seem worth it to me personally.
      • treetalker 3 hours ago

        Real-life experience (over several decades). For me, one hour of even intense exercise is good but not enough to get me to, and keep me at, a point near my personal peak athletic performance. YMMV.

        • _kb 37 minutes ago

          The secret is to have a very low peak. More of an athletic knoll really.

    • jesterson 6 hours ago

      > I'm going to look and feel great and my health will be far better than that of my peers

      Comparing your health (or anything to that matter) to your peers is a great way to boost and maintain insecurities. There is always gonna be a healthier, sexier, younger and so on. Good luck chasing that.

      At risk of sounding very banal, comparing yourself to your version from yesterday is the best approach.

      • treetalker 4 hours ago

        This is a fair point and I generally agree with you. That said, in this example I'm really using "peers" as a stand-in for where I or someone else in a similar situation will be with little or no regular exercise. (I'm a lawyer in Florida.)

  • yummypaint 15 hours ago

    Most problems (including analytically intractible ones) can be modeled with a relatively simple monte-carlo simulation. Most simple monte-carlo simulations can be fully implemented in a spreadsheet.

    Using timing coincidences in particle physics experiments is incredibly powerful. If multiple products from the same reaction can be measured at once, it's usually worth looking into.

    Circular saws using wood cutting blades with carbide teeth can cut aluminum plates.

    You can handle and attach atomically thin metal foils to things by floating them on water.

    Use library search tools and academic databases. They are entirely superior to web search and AI.

    • abetusk 14 hours ago

      I feel like the Monte-Carlo simulation modeling trick is one I picked up intuitively but only recently heard formalized. Do you (or anyone else) have a list of example problems that are solved in this way? Like a compendium of case studies on how to apply this trick to real world problems?

      • bobbiechen 13 hours ago

        _How to Measure Anything_ by Douglas Hubbard includes a chapter on Monte Carlo simulations and comes with downloadable Excel examples: https://www.howtomeasureanything.com/3rd-edition/ (scroll down to Ch. 6)

        The main example is, you're considering leasing new equipment that might save you money. What's the risk that it will actually cost more, considering various ranges of potential numbers (and distributions)?

        I think it's harder to apply to software since there are more unknowns (or the unknowns are fatter-tailed) but I still liked the book just for the philosophical framing at the beginning: you want to the measure things because they help you make decisions; you don't need perfect measurements since reducing the range of uncertainty is often enough to make the decision.

        • MrGilbert 2 hours ago

          > I think it's harder to apply to software since there are more unknowns (or the unknowns are fatter-tailed)

          Talking purely in agile software development, there is an idea of "Flow Metrics" [1] to use for estimation, basically boiling it down to "How many stories can we finish in the next timeframe (Sprint or whatever), and what is the uncertainty associated with this number?" I really like the idea, but haven't been able yet to test it.

          [1]: https://www.prokanban.org/scrum-flow-metrics

      • RossBencina 2 hours ago

        Not a list, but a street fighting tactic is to apply this to finding counterexamples. Don't know whether a thing is true or false? Generate a bunch of random examples and check whether they all agree. Do this before you commit any energy to theoretical analysis. Obviously not a proof, but possibly gives a counterexample faster than you can think of one.

        On the other hand, if you find yourself running 1hour+ numpy simulations for days on end you might want to consider an analytical approach.

      • yummypaint 13 hours ago

        A simple example that highlights the strength of this method: a 137Cs point source is at the origin. A detector consisting of a right cylinder at arbitrary distance and orientation is nearby. What is the solid angle?

        There may exist an analytical solution for this, but I wouldn't trust myself to derive it correctly. It would certainly be a huge mess.

        If we add that the source is also a right cylinder instead of point source, and we want to add first order attenuation of emitted gammas by the source itself, the spreadsheet becomes only a bit more complex, but there will not be a pen and paper equation solution.

        In this example every row of the spreadsheet would represent a hypothetical ray. One could randomly choose a location in the source, a random trajectory, and check if the photon intersects the detector. An alternative approach would be randomly choosing points in both target and detector, then doing additional math.

        The results are recovered by making histograms and computing stats on the outputs of all the rows. You probably need a few thousand for most things at least. Remember roughly speaking 10k hits gets you ~1% statistics.

        • LegionMammal978 8 hours ago

          What annoys me with Monte Carlo methods is trying to get self-consistent statistics at multiple parameter values. E.g., in your example, what is the derivative of the solid angle as the detector is moved? Or more generally, if we have some 'net goodness' measure for a system depending on parameters, how can we efficiently maximize it, when simulations are noisy and basins are shallow?

          My understanding is that these sorts of questions come up in ML, and there are ways of dealing with it, but they can't converge nearly as fast as simple iterations like Newton's method. Even if I have to take a series approximation instead of a simple formula, I'll be able to use autodiff (or at worst, symbolic differentiation) to get quick and precise answers to these questions.

      • sceadu 14 hours ago

        not sure if it counts as a list of case studies, but a relevant and recent video nonetheless https://www.youtube.com/watch?v=KZeIEiBrT_w

        also in general bayesian statistics

        random medium article: https://medium.com/pythoneers/monte-carlo-simulation-ideas-a...

      • thrawa8387336 9 hours ago

        Think of hard problems where sampling of outcomes could give you a better understanding

    • aghilmort 10 hours ago

      what do you consider top tier library search tools and academic databases these days?

      • btrettel 9 hours ago

        I've used various commercial databases over the years. Some popular commercial databases relevant to HN readers include Web of Science, Scopus, and Engineering Village. When I worked at the USPTO, I used the less popular database Dialog, which I preferred. To my knowledge, none of these are available direct to consumers. I've only been able to get access from places with subscriptions. Some university libraries allow visitors where you can use these databases for free on-site.

        I would call these databases complementary, not "entirely superior". There are two main advantages. One is that these databases will contain many things that you can't find on Google. The second advantage of these databases is that they are designed for advanced searchers and have more powerful query languages. Google on the other hand is dumbed down and will try to guess what you want, often doing a poor job. You can get very specific on these databases in ways that you can't with Google.

        Related: I'm somewhat fascinated by more specialized bibliographic databases because they often contain things that can't be found on Google or the major commercial databases I listed above. I started keeping a list of them. https://github.com/btrettel/specialized-bibs

        • w4der 6 hours ago

          On a related note, if you studied and got a degree at a university, check if they have an alumni program. I pay a small yearly fee that lets me access the university's academic databases and their VPN, so I get some other perks as it looks like I'm connected through eduroam.

        • esperent 4 hours ago

          > none of these are available direct to consumers

          This is the big problem with this "trick of the trade". It's not a trick, it's gatekeeping that excludes anyone without a university affiliation.

    • 1oooqooq 8 hours ago

      even wood tipped circular saw can cut Al plate...

      and academic/library search is indeed so underrated!

  • suchoudh 2 hours ago

    I took too much time to

    1. Empathise about effect of menstrual cycle in women.Its so well hidden from boys (at least Indian). They wonder why girls behave erratically ( sex education needed much earlier at least in India as more kids are exposed to adult content)

    2. be very careful when using rm command (use alias rm='rm -i' )

    3. Have backup of backup of backup.

    4. keep checking if backups restore correctly. (can have a very rude awakening if it does not work someday )

    5. People who report to you are different on different days . Dont judge them on few events. (20+ chances at least be given before giving them negative feedback privately )

    6. Friends are more useful than family. ( because you have similar priorities in life) They are a lifesaver after 50 so be in touch with school buddies and college buddies esp as its so much easier now. ( Lost few classmates in Covid who had less family support)

    7. Learn to cook all your favorite recipes ( of your mom/wife/grandmother). You will never be sad. Make them at least for two people, share it.( right size the utensils you use regularly. not too small not too big)

    8. Meet Reality as it is by using Vipassana. It is a super power to counter the unethical AI use. (just finished 10 day course in Bhopal, India New courses are across world ) * They are not paying me anything for this.

      I genuinely believe #Vipassana works. BTW Yuval Noah Harare (Wrote Sapiens and Nexus) has endorsed it as well.
    https://www.youtube.com/watch?v=i1_YhlXiuxE

    You can find course near you in this link. https://www.dhamma.org/en-US/courses/search?current_state=Ne... (Its free and runs on donations)

    9. Keep a water bottle and flat tiffin (empty is also ok but can keep biscuits/leftover for later in day)

    10. Remember to have fun. (we often forget) (kk.org has advice on how2)

  • chthonicdaemon 8 hours ago

    Most people really cannot tell you what they want in any reasonable way. So expecting good specs for software without a very laborious interview and review process is pure wishful thinking. People "know what they like when they see it", so spend time rapid prototyping.

    Smaller and more recent: iTerm has deep tmux support. Just do `tmux -CC` to start your session or `tmux -CC a` to attach to it and you don't have to memorise all the tmux commands.

  • rickcarlino 13 hours ago

    Git bisect. For certain classes of software regressions, it makes life easier. Many people (me) don’t know this feature exists and end up reinventing the wheel on their own. https://git-scm.com/docs/git-bisect

    • koolba 9 hours ago

      Whenever people try to argue that small and meaningful commits do not matter, I introduce them to git bisect. I’ve yet to meet someone familiar with it that does not agree.

      • sethammons 4 minutes ago

        I have used git bisect twice in 15 years and seen it used maybe three other times.

        I have burned hours upon hours on rebase conflicts over the years.

        I have settled on squash merging feature branches into main and no force pushes on anything shared, ever.

    • sureglymop 9 hours ago

      Similar feelings about git worktree. Being able to check out multiple branches at once without having to deal with stash is a game changer.

    • alper 2 hours ago

      The amount of times I've used `git bisect` productively can be counted on one hand.

    • apples_oranges 2 hours ago

      It's a useful tool, but sort of a tool of last resort.

    • benreesman 10 hours ago

      And interactive rebase. Master interactive rebase and reflog until you can do it blindfolded.

      • pseudo_meta 7 hours ago

        I've only used reflog really to look up a hash and reset back to it. Is there anything else about it one should learn?

      • lanfeust6 9 hours ago

        Agreed with interactive rebase, but what of reflog? I've checked that for commit hashes when things have gone very wrong but I don't know many commands.

        • benreesman 8 hours ago

          It allows you to observe and interact with the history of refs like HEAD, so superficially destructive operations like amending a commit can be recovered, reverted, etc. It's kind of like meta-git, allowing version control operations on the version control system. It's a lifesaver when you botch a merge or something and allows you to do "destructive" operations fearlessly (up to a point, you can munge a git repo pretty bad if you try hard enough).

    • lanfeust6 9 hours ago

      Very useful. What we always say after the fact is "we need more tests".

  • zwnow an hour ago

    That people in the industry barely code, its just stitching together 3rd party dependencies.

  • hintklb 8 hours ago

    Understanding the concept of Opportunity Cost and how it applies to everything in life.

    - Buying a house: Is this the best return I can get on a downpayment. (Spoiler: It is not).

    - Accepting a specific job offer: Is this the best way to spend 8 hours a day?

    - Not making a successful trade, is as much as a loss than losing money explicitely on a trade.

    - If you own something, you should consider what could you do with it's cash value if you sold it instead.

    - If you have a paid off home, could you sell it and get a better ROI with the cash equivalent and rent instead? (The answer is yes and you should do it).

    • lmm 6 hours ago

      I'd say you may be missing the concept of Risk-Adjusted Return, which changes a lot of those calculations.

      • hintklb 6 hours ago

        And I would agree. There are a ton of second order effect and more complex concepts that I have learned about over the years. Opportunity cost is still the key one I go back to so often.

    • mizzao 6 hours ago

      Home ownership is a huge economic subsidy for the upper-middle class in the US: mortgage interest deduction, cheap leveraged borrowing, real-estate investment, up to $500k of free capital gains, and an inflation hedge. It's pretty hard to beat compared to alternative investments.

      • hintklb 6 hours ago

        That was the case initially.

        Now the prices have skyrocketed due to offer and demand, and frankly because of the narrative that "Buying is always good", which ironically makes it a subpar investment.

        Real estate is now a subpar investment. Especially today, and even with those advantages. It is also not diversified at all, absolutely not liquid and does not return even close to the SP500 (Even if you take the leverage into account, and leverages go both ways by the way...).

        • jamil7 2 hours ago

          I've looked at this a bunch of times, from a pure return perspective, yeah equities usually win. But there's enough benefits to homeownership outside of that lens that I think either side can make a pretty compelling argument (I say this as someone who rents). It also highly depends on which market we're talking about.

    • ponector 3 hours ago

      >> Buying a house: Is this the best return I can get on a downpayment. (Spoiler: It is not).

      It may be the best return. You never know the future, what direction asset prices are going.

      • bluecalm an hour ago

        Yeah but it goes for housing as well. The property owners have been winning politically for a very long time now. It doesn't mean they will keep winning in the next decade.

        My view is that it's very hard to envision a world where stocks crash and real estate doesn't but it's very easy to image real estate getting cheaper while stocks do just fine.

        The latter scenario may happen with just a few policy changes or even without them if demography gets bad enough.

    • klntsky 4 hours ago

      A house is something that fulfills your direct needs, unlike S&P500. You 'miss the opportunity' in exhcange for feeling safe about your future, which leads to more rational choices long term.

      • bluecalm 43 minutes ago

        Or less rational like tying yourself to a place, missing opportunities in professional and personal life or opportunities to experience a different life.

        Buying early in life is in my view almost always wrong.

    • mvdtnz 7 hours ago

      It's really sad when you hear about people living this way. Life isn't about profit maximisation.

      • Dilettante_ 6 hours ago

        Maybe that's not something that's terribly fulfilling to you, but if one takes joy in the process itself then the act of saving a dollar on icecream can bring both more hedonic and eudaimonic pleasure than having the icecream would have, and pay off materially. Especially in the very-long term.

        In your head it's Ebeneezer Scrooge, but it can just as well look like ...err, Scrooge McDuck maybe? I struggle to really find a good example for what I'm talking about. But if you make a challenge to yourself, being frugal can be very fun and fulfilling, even moment-to-moment.

        Different people play different games!

      • augment_me 3 hours ago

        You can see it from other aspects than just money. For example, renting instead of owning frees up time and gives you much more predictable expenses. From not needing to fix the house to being able to be unemployed with predictable monthly costs.

        Home ownership in the west is seen as some sort of pinnacle and goal because of the perceived security it provides, but its also possible to see it as golden handcuffs that force you to stay at safe, predictable jobs for 20 years.

        • BoxOfRain 2 hours ago

          >From not needing to fix the house

          Someone unfamiliar with the 'landlord special' I see!

          • bluecalm an hour ago

            It's a good point that renting often sucks, especially renting from private individuals. I wish EU countries were more focused on civilising renting market instead of just home ownership.

      • bluecalm an hour ago

        It's not but it's also not about dumping money into a sink or instant consumption. You can live a fulfilling life while making good financial decisions. As money gives you freedom and more choices I would argue it's easier to live fulfilling life this way.

      • hintklb 7 hours ago

        So It's really sad to think about the value of time or things? Don't you implicitly do that every time you chose an activity over another? When you chose a job over another? when you chose to spend your time with a friend or with your wife?

        • mvdtnz 5 hours ago

          I choose the things that bring me joy.

        • __loam 3 hours ago

          This kind of opportunity cost thinking can lead to things like overwork or ignoring your family. It makes sense up to a certain point but viewing your whole life through an overly simplistic heuristic can be a negative thing.

          • hintklb an hour ago

            I literally use opportunity cost as a reason to spend MORE time with my family. It is not about money strictly speaking but it is about maximizing what matters to you.

      • aspanu 7 hours ago

        As usual, I'd like to bring up that it is until you have enough profit for it to no longer be only about that.

        Also regardless of the quality of the examples, it may be the case that the point (opportunity cost is important to consider) is still valid.

        • hintklb 7 hours ago

          Thanks for clarifying. Being mindful of opportunity cost allows people to retire early, to spend more time with their loved ones, do better financial decisions.

          I have seen too many of my loved ones work until their 70s because they didn't think about those concepts enough. That is what is sad.

          • globular-toast 4 hours ago

            Don't forget though there are things you won't be able to do at 50 even if you're retired. I'd hate to think of someone being a virgin hermit finally coming out the shell at 50 thinking the world is their oyster now. Some things you have to do when you are young.

            • hintklb an hour ago

              I'm not sure what you are talking about? I did way more in my 30s and 40s than most of my peers that are not mindful of anything.

              The whole point of opportunity cost is to be mindful of what you are spending your time and efforts on. It is not only about money

            • bluecalm an hour ago

              My experience is that most decisions aren't of the type. It's not that you're choosing fun at 20 or longer fun at 50. Investing or not. Renting a cheaper place for a while or buying a bigger house right now. A lot of the time you will get more money and more fun if you do it right.

            • esperent 4 hours ago

              Probably far fewer things than you think, though, as long as you're healthy. You can still have love affairs, travel the world, go to festivals, climb mountains, learn to dance well into your 70s or even 80s, as long as you are healthy. Sure, you might be climbing a small mountain instead of Everest, but small mountains are beautiful too.

              • bennyelv 3 hours ago

                True, but the chance of you being healthy diminishes strongly over time, and the chance of you being as healthy as your younger self is probably zero.

                • esperent an hour ago

                  Health in old age is something that you invest in, much the same as wealth. Of course you can suffer an accident, or lose your investments from bad luck. But in both cases you're guaranteed bad results if you don't put the effort consistently and starting when you're younger.

                  For health, this means making exercise, good sleep, and good diet a part of your daily routine. Much like investments, you can go as deep on that as you like, but if you start early all you need is basic knowledge.

      • goodpoint 4 hours ago

        It's more than sad - it's unhealthy.

        • hintklb an hour ago

          And so is your sad judgement of other people.

  • gopalv 12 hours ago

    > What Trick of the Trade took you too long to learn?

    "Everything worth doing is worth doing badly"

    And as a corollary, every complex system that works came from a simple system that works.

    I learned this in programming, but now I apply it on everything from motorcycle maintenance, home appliance repair to parenting.

    --

    Often the easier way to fix a complex system is to pretend that it could be simpler and then reintroduce the complexity-inducing requirements.

    I had a professor who taught debugging as a whole another skill from programming and used to say "Most of programming is starting from an empty editor and debugging until your code works".

    The debugging "lab" in Java course (in the year 2000) was one of my transformational after-school classes - where I got a java program which fits within 2-3 pages of print code with a bug and was told to go find it in print for ~20 minutes, then given 40 minutes with a debugger instead.

    • zigman1 an hour ago

      My new life motto, thank you very much! You just made a stranger's day better

    • mrheosuper 4 hours ago

      Not always true. For example, if you work on your bike's brake, you should make sure the work is correct and well done. You dont want it stops working when cruising at 60mph.

    • tstrimple 11 hours ago

      > And as a corollary, every complex system that works came from a simple system that works.

      "Do the simplest thing that works" is one of the few core architecture principles I stick my neck out for time and time again. Why write a simple function when you can spend a week accounting for every imagined corner case and implement modular expansion capabilities! Please... stop...

      I empathize with the debugger story. If you're super deep in a language it makes sense to know the debugger inside and out. But stdout is universal and I've never been a specific language developer rather than being able to jump into whatever is needed.

  • jeremyscanvic an hour ago

    Writing code from bottom to top instead of from top to bottom. Usually the interesting stuff happens in the bottom part and the top part is merely prepping data and taking care of edge cases: it's way easier to write it once you know how you're gonna end up using it.

    • theshrike79 36 minutes ago

      Rule #5 of Rob Pike's rules of programming[0][1]:

      "Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming."

      [0] https://users.ece.utexas.edu/~adnan/pike.html

      [1] https://news.ycombinator.com/item?id=24135189 (HN Discussion from 8/2020)

    • bluecalm an hour ago

      I was recently explaining to my non-programmer gf what programming is to me. I said that I first make some bricks and then when I have enough I try to assemble bigger bricks from small ones and then after a while build things from them.

      I agree 100%. Bottom up of the way to go if you're doing it without deadlines, requirements or investors with expectations looming over you.

    • pydry 19 minutes ago

      Damn. I would have written the exact opposite.

      Each layer serves as a customer for the layer above. If you havent figured out what the layer above needs by building it you're probably going to provide the wrong thing to it in the layer underneath if you write it first.

      It is super counter intuitive, too. The instinct of most juniors is to build foundations first.

  • Eduard 5 hours ago

    It took me two decades to finally decide to memorize "... | awk '{print $1}'" as a command pipeline idiom for filtering stdout for the first column (... "awk '{print $2}'" for the second column, and so on).

    All it required from me was to intentionally and manually type it down by hand instead of copy-pasting, on two purposeful occasions (within two minutes). Since then it's successfully saved in my brain.

    • penguin_booze 4 hours ago

      I'd like to give a shoutout to jq for (non-JSON) text processing, and also as an almost-replacement for awk:

        echo "foo bar" | jq -Rr 'split(" ")[0]' # prints foo
      
      I say 'almost', because jq right now can't invoke sub processes from within, unlike awk and bash. But otherwise, it's a fully fledged, functional, language.
      • Eduard 30 minutes ago

        `jq -Rr 'split(" ")[0]'`? That would easily take me three decades to memorize ;-).

        for selecting the second column, PID, from `ps aux`,

            ps aux | awk '{print $2}'
        
        works for me, as gawk's default $FS field separator treats runs of whitespaces as a single separation of fields ( https://www.gnu.org/software/gawk/manual/html_node/Field-Spl... ), quite similar to "standard" Open Group/POSIX awk ( https://pubs.opengroup.org/onlinepubs/9799919799/utilities/a... ).

            ps aux | jq -Rr 'split(" ")[1]'
        
        on the other hand doesn't work here due to `ps aux` adding a variable number of spaces for formatting.

            ps aux | jq -Rr 'split("\\s+"; null)[1]'
        
        seems to work though.
      • wwader an hour ago

        Same! and jq's regexp functions are quite powerful for transforming text into something more structured:

          $ echo -e "10:20: hello\n20:39: world" | jq -cR 'capture("^(?<timestamp>.*): (?<message>.*)$")'
          {"timestamp":"10:20","message":"hello"}
          {"timestamp":"20:39","message":"world"}
        
        
          $ echo -e "10:20: hello\n20:39: world" | jq -Rn '[inputs | capture("(?<t>.*): (?<m>.*)$").m] | join(" ")'
          "hello world"
        
        Also using inputs/0 etc in combination with reduce and foreach it's possible to process streams of text that might not end.
    • apples_oranges 2 hours ago

      Now imagine what all the LLM copy pasting could do to our skills ..

    • cluckindan 5 hours ago

      Why not `… | cut -f1 -d ” ”` though?

      • efrecon 4 hours ago

        Because awk understands "columns" better.

        echo '999 888' | awk '{print $2}'

        prints 888

        • cluckindan 37 minutes ago

          How is that different from

              echo '999 888' | cut -f2 -d " "
          
          except for the default delimiter being space for awk?
          • Eduard 26 minutes ago

               echo '999  888' | cut -f2 -d " " # notice two consecutive spaces
            
            returns NULL.
            • cluckindan 20 minutes ago

              Right, that would be expected though? I suppose awk is better for parsing formatted (padded) output.

        • bregma 23 minutes ago

          How can it be "better" when it is exactly the same?

      • stevekemp 4 hours ago

        Speaking personally I find that I always use awk for printing (numbered) fields in shell-scripts, and when typing quick ad-hoc commands at the prompt.

        The main reason for this is that it's easy to add a grep-like step there, without invoking another tool. So I can add a range-test, a literal-test, or something more complex than I could do with grep.

        In short I can go from:

               awk '{ print $2 }'
        
        To this, easily:

               awk '$1 == "en4:" {print $NF}'
  • david422 9 hours ago

    When you buy a house and get a mortgage, you are going to be paying MUCH more in interest (than expected). Over the course of the mortgage, you are going to be paying MUCH more than the sticker price. Between closing costs and taxes and fees maintenance, you will need more cash than you think.

    My advice is look at the numbers very carefully and choose something that is (below) or fits your budget. Sudden financial issues like the loss of a job or new vehicle purchase can put a big strain on all this.

    • Etheryte 3 hours ago

      This is a topic that often comes up, but once you pry, people usually overlook inflation. As an example, let's say you took out a $300,000 mortgage 30 years ago. The inflation adjusted cost of that today is $634,546 [0], so figuratively you end up paying more than double the sticker price just because of inflation.

      [0] https://www.calculator.net/inflation-calculator.html?cstarti...

    • mitthrowaway2 8 hours ago

      What do you do when the people you're bidding against don't understand this?

      • cpursley 2 hours ago

        I feel like most of the response to housing comments are from coastal US perspectives where the math really does not work at the moment. But that is not the case everywhere nor outside of the US.

      • hintklb 8 hours ago

        it's called renting.

        Americans are obsessed with owning a home at all cost. This means that you are effectively bidding against people that do not even do the math. They are ready to spend Millions of dollar on something that is comparatively cheap to rent.

        The fact that absolutely everyone wants to buy pushed prices through the roof. The good news is that you can take the other side of this bet. it's called renting.

        Currently in most places in the US you will save literally millions over the 30 year mortgage by renting and investing in the market instead.

        Reminder that renting and owning is functionally almost exactly the same thing.

        Never trust your realtor and never trust other homeowner that most of the time never did the math (We all know those people: "I bought my home for 500k 15 years ago. It is now worth 1M$, therefore I made 500k$").

        In other words, let other people take the irrational side of this bet and take the rational side by renting. It's an arbitrage opportunity.

        • ameliaquining 7 hours ago

          An important fact that this doesn't account for is that, in the United States, living in housing that you own is highly tax-advantaged, at least if you can get a mortgage on it. For example, mortgage interest is tax-deductible for owner-occupied housing (whereas landlords usually can't deduct interest on their mortgages and so those taxes are passed on to renters), and mortgage rates for owner-occupied housing are far below market due to government subsidies and guarantees (whereas landlords have to pay higher rates that, again, they pass on to renters). This isn't good policy, but as long as it's the case, buying a single-family home is a smarter financial choice for most Americans than renting one.

          • hintklb 7 hours ago

            I live in the US and I'm aware of this. Those tax deductible interest should be calculated in the complex buy vs rent equation.

            In fact, even when taking them into account, it still doesn't make sense for most Americans to own. (In today's market).

            Renting and investing is still the way to go for at least 75% of Americans (this is slightly more nuanced for low cost of living areas, but hold true for any MCOL or HCOL areas).

            Eventually the math could make sense again, but right now owning is a huge luxury that will cost you millions in the long run.

            I invite you to play with this calculator: www.nytimes.com/interactive/2024/upshot/buy-rent-calculator.html

            • deanmoriarty 7 hours ago

              I am a renter so I don't have a horse in this race, but renting is many times the financially worse choice even in HCOL.

              Why? Because rent inflates like crazy over here! In the Bay Area 7%+ a year is completely expected, and 10% is not unusual. I have been all over the Bay Area for more than a decade (San Francisco proper, East Bay, South Bay) and know this well. It's been nuts.

              Random example: the 1 bedroom apartment that I lived in 2012 and was then going for $1,500 a month, is now going for $3,800 in the exact same building (with no/minimal renovations it seems, I just looked it up). An ~8% YoY increase. That will do it to any buy vs rent calculator, very easy to break even in under 5 years, and that's excluding the speculative ability to refinance if interest rates go down from the current 7%, in which case it becomes a huge boost.

              Renting as a long term choice just works in European countries where normal people can lock in 5+ year leases with no or minimal rent increases. America is too profit-seeking and greedy for that.

              I still rent for flexibility reasons, but I definitely see it as a luxury lifestyle choice, the most financially responsible thing would be to buy, even in HCOL.

              All this in my opinion and personal experience, totally fine if people see it differently.

              • hintklb 7 hours ago

                SF is the poster child of a HCOL where buying makes absolutely no sense.

                Even if rent increases a lot, the buy to rent ratio is so horrible that it could continue to increase for MANY more years before buying could make sense.

                I invite you to use the NYT Rent or buy calculator, It is clear as day: www.nytimes.com/interactive/2024/upshot/buy-rent-calculator.html

                • deanmoriarty 7 hours ago

                  I just did, picturing exactly the situation I'm in right now:

                  - Rent: $3,500

                  - Home price: $700,000 (a similar unit just sold for this price a few months ago in my building)

                  - Rent increase: 8%

                  - All other parameters left as default, which seem reasonable (and as I said, there might be chances of refinancing over the next 10 years, which would drastically skew the picture, but I'm leaving that assumption out)

                  The ratio of 0.5% monthly rent/price is common for non-luxury "dated" condos all over the city, so I think my situation reflects well the typical renter.

                  Once again, in my personal experience, guided by a decade+ of living here, what people miss is the crazy rate of rent inflation. There is always a massive rent increase right around the corner, and God forbid if you are forced to move (because the landlord wants you to, it happened a couple times), then you take a gigantic hit at market rate. Once you factor in these occasional resets and the standard yearly increase, you get very close to 10% rent increase.

                  • socalgal2 3 hours ago

                    I think you're leaving out other expenses. You'll be paying HOA fees (one friend in SF pays ~$1000 a month and I've heard of worse). You'll also be paying property tax at around $650 a month. You'll probably be paying some maintenance that your landlord would have had to cover (though maybe HOA fees cover some of that?)

                  • hintklb 6 hours ago

                    Is this a condo with an outrageous HOA that you are not including? Many such cases that explain why condos are valued so much lower.

                    In SF I have been renting a 1.6M$ townhouse for 4k$/month, and that is very typical of what you can find in SF and in SV.

                    That has been my experience. Rent increase have been outrageous, but not as bad as the ratio between renting and buying. I would still rent even if my rent went up 50%...

                  • exodust 5 hours ago

                    On a related note, how do routine inspections work in the US? Does someone walk through the house taking photos every 6 or 12 months, making sure you're keeping the place clean and no damage etc? That's how it is here in Australia, and is absolutely the worst aspect of renting IMHO.

              • archagon 5 hours ago

                If you live in rent controlled housing in SF, your rent increases are gonna be a lot less than 10% a year. And you're unlikely to ever be evicted due to a house sale.

                During our last apartment search, it was not particularly difficult to find a rent controlled apartment.

                I wish other cities would do the same thing.

            • silisili 7 hours ago

              It's not all numbers, though. Both have a lot of intangibles that can and should affect your decision.

              Owning can feel suffocating at times, and like a ball and chain at others. You can't just decide you don't like it or the area anymore and go. Maintenance is also no joke.

              Renting feels ephemeral. Getting kicked out at lease end sucks, it's hard to uproot everything and start over. Having inane rules and a landlord constantly drive by can make you feel both infantile and spied on.

              I've done both off and on and those are my own thoughts on the two.

              Financially only it's easy to pick a winner. But for some, one of these factors may be worth the extra however much money the difference is.

              • hintklb 7 hours ago

                The best way to calculate those intangible is to associate a value to them, Most people love to say that owning is so good because they can decide on their own house improvement.

                Ok, but how much do you really value this over? Is it worth 2M$ over 30 years? Because in a lot of cases this is what you leave on the table by deciding to own.

                • silisili 4 hours ago

                  How much is your kid's smile worth because they are able to build a treehouse, or ride a go kart around the yard?

                  Breaking everything into some numerical value misses the whole point of life. But hey, who cares if you're rich when you're old?

                  • socalgal2 3 hours ago

                    I agree there are pluses to living in a house. One, you can rent a house. But also, there are benefits for kids living in apartments, condos as well. If we're just talking about money, maybe the things you can afford (more travel with your kids, more activities for your kids, more money for kids hobbies, etc...). More time (instead of spending time maintaining your house, gardening, mowing the lawn, etc... you can spend that time with your kids).

                    I'm not saying an apartment is better than a house. I'm only saying it's not about "rich when your old" vs "kids treehouse and go kart".

                    Thinking about all the things I loved about my house. Had a pool (but so do many apartment complexes). Could be much noisier than I can in an apartment. Had a garage for tools. I thinking most of the other things I liked have analogs in apartments/condos. But again, you can rent a house.

                  • hintklb an hour ago

                    I think you are missing the point entirely and have an "holier than you attitude"

                    The whole point of optimizing for some things is exactly so that I can spend more time with my kids and wife. I will be retired in the next year (in my 40s) and spend time with them while most people will continue to work in their 70s to pay their mortgage.

                    I am regularly traveling the world with my son and loved ones while most people use their weekend to "repair their homes".

                    The exact reason I do all of this is to spend way more time with my loved ones. Most people that act in autopilot mode never think about this and therefore end up not spending time with their kids (But Go Kart around the yard!)

                    You seem to think the only way forward is to provide a house to your family. I think retiring early, spending more time with them and experiencing the world is a good trade off for renting. I would invite you to consider different point of views

            • gertlex 5 hours ago

              Aww, they ~~paywalled~~ login-walled(?) the calculator since I last used it (my saved link of https://www.nytimes.com/interactive/2014/upshot/buy-rent-cal... also redirects to your 2024 version)

          • Cyph0n 7 hours ago

            But mortgage interest is an itemized deduction, which means it only becomes a tax benefit when your interest + other deductions exceed the standard deduction. And if you do take the deduction, only the delta between it the standard deduction is a benefit.

            • hintklb 4 hours ago

              At this point, the so-called tax benefits are mainly a realtor talking point (the same as "Renting is throwing money away")

        • globular-toast 4 hours ago

          > Reminder that renting and owning is functionally almost exactly the same thing.

          Erm, apart from the bit where you, you know, own the property meaning you can put pictures on the wall, and that's just the start...

          But I've always said, if you have no desire to use the benefits of owning (ie. modifying it), then it's more of a liability as now you have to pay for repairs etc.

      • nothercastle 6 hours ago

        You wait and invest In something else and you try to convince your spouse that living in a super nice neighborhood as a renter isn’t a bad deal. But sometimes you lose rational arguments on feels and that’s just life

        • socalgal2 3 hours ago

          2 anecdotes

          * Met a guy who bought a place in Manhattan Beach LA. He said it was the best investment of his life. It was more than he and his wife could afford be she insisted. Of course maybe they just got lucky that nothing bad happened the would have forced them to sell.

          * Have a friend that looked for over 20 years. He go out looking 2 or 3 times a month. Everything was always beyond what he was willing to spent, people out bid him etc. Finally he just came to the realization that if he didn't buy he'd never live in a house (one of his goals). So, he bought, higher than he would have. He seems pretty happy to have a house. He's been in it 6-7 years now and at least according to RedFin it's worth less than he bought it for but I don't think he cares. He's happy to be living in his own house and not an apartment.

          PS: I'm not suggesting the alternative is worse.

    • bozhark 8 hours ago

      Exactly, calculate total cost of loan vs. cost of purchase

    • tootie 7 hours ago

      Also, there's no shame in renting and it's frequently a better financial decision.

  • vouaobrasil 17 hours ago

    I only learned this in the last five years: do less, automate less, do more by hand, and use the limited capability of the manual method to really choose projects that are worthwile, rather than aim for maximum efficiency.

    • juliansimioni 15 hours ago

      Similar to this: if you want to optimize your productivity*, do so on a timescale of at least weeks if not months or years.

      Simple example: Can you get more done working 12 hours a day than 8? Sure, for the first day. Second day maybe. But after weeks, you're worse off in one way or another.

      It's easy to chase imaginary gains like automating repetitive tasks that don't actually materialize, but some basics like sleep, nutrition, happiness, etc are 100% going to affect you going forward.

      * I actually hate that word, and prefer saying "effectiveness". Productivity implies the only objective is more, more, more, endlessly. Effectiveness opens up the possibility that you achieve better results with less.

      • theshrike79 32 minutes ago

        In Finland we have flex hours or "working hours bank", basically you can do extra work now and get free time later. You can also go into negatives.

        Usually the recommended range is -20 to +40

        Some People(tm) go into the negatives and think it's easy to "just" do an extra few hours every day. It's not.

        What I do is work ~15 minutes more every day so I bank about a hour a week, sometimes a bit more. It's a LOT easier and more manageable. Just sit on my computer 15 minutes earlier or if I'm at the office I take the later train back home.

        This way I tend to have a day or two of flex hours banked if I need to take some quick time off.

      • noreplydev 2 hours ago

        it's not a 100 meters race, it's more like a marathon

  • block_dagger 25 minutes ago

    It was written on the wall at a submarine sandwich shop: “it’s nice to be important but it’s more important to be nice.”

    This trick of the trade called life will serve you and your associates well.

  • oumua_don17 15 hours ago

    Start as early as possible in investing (in index funds) and otherwise being financially savvy. It is very beneficial to realise early on that growing your hard earned money and spending it wisely is way more important as it will in the future lead to some unexpected benefits. Freedom of thought and action!

    • Terretta 15 hours ago

      Call Vanguard: 877-662-7447

      An investing prof at Chicago puts this on the whiteboard at the start of semester, saying this is really all most people need to know and this class is unlikely to learn anything in his or any class that will let them, personally, do better.

      • lurking_swe 13 hours ago

        That’s good advice for a layman but most high earners can do much better if they care and are motivated. Most are neither though lol.

        Mostly on the tax side. Some specific examples:

        - after maxing out your 401k what should you do next? IRA? Mega backdoor roth? Something else?

        - If you have kids, how to best save for future education expenses? Hint: consider 529 plan.

        - HSA is technically the best tax advantaged account, most high earners don’t realize it and “waste” the HSA funds to reimburse typical medical bills. HSA has triple tax benefits: contributions are tax-free, growth is tax-free, and withdrawals are also tax-free after age 65 for any reason, not just medical expenses. So basically investing without any tax obligation. You can also withdraw tax free before 65, but for medical expenses only.

        i could go on…investing is great, but reducing your tax obligation is an even more powerful technique if you want to grow your net worth.

        • arjvik 9 hours ago

          The HSA thing intrigued me and so I did some digging. It appears that post-65, you still have to pay income tax on non-medical withdrawals from an HSA? That is, besides the tax-free-for-medical-expenses part it reverts to a traditional IRA?

          One additional trick though is that it looks like you can pay for any HSA-eligible medical expenses (incurred after you created the HSA) out-of-pocket now, and reimburse your bills at any point in the future? Thus you can still earn interest on the cash before withdrawing it at any point in the future (treating it as tax-free liquidity).

          (I don't fully understand this so these are questions not statements, but hopefully I'm correct!)

          • lurking_swe 9 hours ago

            i replied below already, i misspoke. Apologies!

            https://news.ycombinator.com/item?id=44793595

          • shmerl 9 hours ago

            > The HSA thing intrigued me and so I did some digging. It appears that post-65, you still have to pay income tax on non-medical withdrawals from an HSA?

            That's what I understood too. That claim that you can completely skip taxes looks wrong.

            • sokoloff 9 hours ago

              You can completely escape taxes for any amounts that you have receipts for medical expenses incurred after the HSA was opened.

              You can pay cash for a qualified medical expense in 2025 and take out that amount of money from the HSA decades later.

              • slipnslider 5 hours ago

                But does this mean I need to keep receipts around for decades? What if a claim gets denied and dr. is dead or no longer practicing?

                Has anyone tested this HSA claim approval amd reimbursement of 30/40/50 year old medical work before? Is there a chance the rules could change and the medical care has to be recent?

              • koolba 9 hours ago

                You can also use it to pay for Medicare premiums.

              • hopelite 8 hours ago

                One thing to note!!!! Make sure to also keep records on the HSA start date and any transfers you may engage in, e.g., after leaving an employer or just changing providers. It is worth having that on record in case 20, 30, 40 years later your claims are rejected because the original opening date was lost in some transfer at some point.

            • lurking_swe 9 hours ago

              i’m the parent. You are correct, my mistake! It’s too late to edit at this point. :(

              What I should have said is that after 65 you can spend it on non medical stuff without penalty. BUT if you do so you’ll owe tax that year (withdrawal).

              So to summarize, you can avoid all tax if it’s spent on medical stuff. For non medical (post 65) it’s still good, but not as good.

              Still an amazing deal because old people tend to spend a lot more on healthcare.

          • scarface_74 9 hours ago

            Yes and you can invest your HSA funds just like anything else.

        • xhrpost 9 hours ago

          Looked into HSA recently at work but legally you need a high deductible health care plan to be eligible. Looking at the options, just nothing looked good compared to my current $0 deductible/$0 co-pay plan. Hard to know for sure but just seemed like I would be paying a lot more out of pocket every year.

          • SlightlyLeftPad 8 hours ago

            You have the unicorn health plan it appears

          • yieldcrv 6 hours ago

            Yeah get a high deductible plan as secondary insurance JUST for the HSA

            Max out contributions to the HSA

            all medical expenses (except for premiums) since the beginning of the hsa account’s existence are eligible for reimbursement, decades later

        • matt_s 13 hours ago

          What you have stated is almost the same as call Vanguard, all those options are the same in the sense that they all involve investing, leaving it alone for a long time. Its just the vehicle thats slightly different and tax advantages.

          I wouldn’t consider those options needing much motivation or research. The key with all of them is investing early and leaving it alone.

          • lurking_swe 12 hours ago

            If one is clueless with investing and taxes in general, and they call vanguard, their eyes will glaze over. It would be like me explaining software development to my 85 year old father.

            I do agree people should call vanguard. But just blindly following steps they give you is unlikely to be productive if you don’t understand why you’re doing those steps. Furthermore, those people who don’t understand _why_ will freak out every time there’s a huge market correction. They get scared - because they don’t understand any of it.

            I’m also curious, do they offer financial advice for your accounts outside vanguard? Genuinely curious since i’m unsure.

            • matt_s 12 hours ago

              I’ve think the “call” part is a bit from the past, should be a setup account online with Vanguard, put it in VOO or VTSAX or the equivalent low fee market index fund and leave it alone.

              Replace Vanguard with any other firm but the key is picking low fee ETFs and leaving them alone. Vanguard tends to have a reputation for the lowest fees.

        • d_burfoot 10 hours ago

          #1 Rule of Investing: you can't beat the market, but you can beat the tax man

          • 1241231241 6 hours ago

            Is is beating when taxes are setup in a way to incentivize investing ?

        • davidivadavid 13 hours ago

          At that point get someone to do it for you for x% of what they're getting you back and live blissfully unaware of arcane tax code specifics.

          • Jtsummers 13 hours ago

            At least the 401k, IRA, and HSA don't require knowing anything particularly arcane. Money goes in, don't touch until 59 1/2 (401k, IRA) or 65 (HSA).

            529 plans can get a bit more complicated because you'll want one from your state (if your state has an income tax) and they may offer several, but then it's less about knowing tax code specifics than about what the differences are between their offerings.

            • lurking_swe 12 hours ago

              right, it’s not that arcane at all. I discovered all this over a couple weekends in my 20s. Started on reddit, then moved on to more official guides and books. I spent maybe 5 weekends in total doing this learning.

              It’s really not that hard and i don’t understand why more people aren’t interested. Let’s reframe for a minute…if i said a high earner could retire a year earlier, or maybe even a few years earlier just by learning some semi-advanced tax strategies. Should they do so? Yeah. They’d be crazy not to lol.

              • recursive 9 hours ago

                For a beginner it's hard to tell which information is trustworthy and which is a sales pitch.

            • tylerflick 11 hours ago

              529s are also capped based on the recipient, not donor.

          • laserlight 4 hours ago

            > what they're getting you back

            Even that is not a simple thing. What’s your benchmark? Is that the right benchmark for you and your goals? Agency has a cost.

          • taneq 3 hours ago

            Is it really x% of the profits? Most of the investment and financial advising services that I've had pitched to me (although that's not too many, tbh) seem to charge x% of your portfolio, and if their sage advice doesn't create a return greater than x% then sucks to be you.

        • 1oooqooq 8 hours ago

          i tried that hack one year. Cigna just emptied my account on the first try with a provider charging 2 emergency room visits when I was there only for a xray.

          Cigna refused to lift a finger unless i sued them both.

          yeah, i wouldn't recommend that.

      • hattmall 8 hours ago

        An important part that could have been beneficial would have been to add, "today".

        I had a class where the teacher did something similar, but she showed that if you started a ROTH today and contributed only the 4 years you were in college and then stopped forever. You would have nearly the same amount of money as someone who started 1 year after they completed college and invested every year until retirement.

        Ultimately she was encouraging us to take out student loans and invest it or use any excess scholarship money to max out a ROTH IRA. She even advocated for investing all student loan money and opening credit cards tp actually pay for college, making minimum payments until graduation. Then moving away to a LCOL country and learn the language for 8-9 years while remaining in school taking 1 online class a year and travelling the world on student loans and not to worry about starting a career until 30 and start paying once you are back and start a job.

        • culopatin 6 hours ago

          The today does matter but just did the math on that and your teacher was whack.

          The gap is so big I’m going to be imprecise and won’t matter.

          A Roth allows 7k a year I believe. So 4 years of school, 28k total.

          Let’s be generous and say you start with 30k at age 18. At 65 you’ll have 700k.

          I started at 26, my salary has been increasing at 6k a year average. I don’t max it out, but hover around 10-15%, I get a 100% match on up to 7% of my salary. I’m 10x ahead of the 18yo on the same projection and 5x ahead 10 years earlier.

          Not even going to get into the interest rates and how you’re fucking up your finances tremendously for the rest of your adult life

        • karp773 7 hours ago

          ROTH IRA contributions have to be from earned income, though. The rest of the advice is of the same quality, imho. Beware!

        • yieldcrv 6 hours ago

          There are limited ways of acquiring money that can be contributed to a Roth IRA, this way is not one of them

      • scarface_74 9 hours ago

        This is generally not applicable to most people.

        1. Invest enough to get the company match in an S&P 500. It probably isn’t Vanguard that your company uses

        2. Pay off all of your debt except your house (and maybe your car)

        3. Max out your HSA - if you are married it’s - $8550

        4. Max out your 401K - again that’s probably not through Vanguard - $23500

        5. Step 5 - then call Vanguard and depending on your income just do a Roth up to $8000 (?).

        (Unless you are over 50 then do catch up contributions as 4.5)

        If you are under 50, you can do $40,500 tax advantaged and over 50 $48050

        • hattmall 8 hours ago

          Step 0: Have enough extra money to do all that.

          • healsdata 7 hours ago

            And also Step 4a: Don't need to use the healthcare system.

        • bronco21016 8 hours ago

          Step 6 is the mega-backdoor Roth. Do after tax contributions to your 401k and have your 401k servicer do an in-plan conversion to Roth 401k.

          Also, on step 4, you may need to do a backdoor Roth IRA if you’re over the Roth IRA income limits.

          • scarface_74 7 hours ago

            I’ve only had one employer that allowed after tax contributions (which for other people reading this is not the same as Roth 401K).

            The issue is that most companies don’t allow it because of compliance reasons and rules regarding highly compensated employees. Of course the one company that did allow it was BigTech.

            Not that I’m missing much. I doubt I will be in a higher tax bracket at retirement than I am now and I live in a state tax free state.

            • bronco21016 7 hours ago

              To me the primary benefit is when it comes to RMDs. Having a mix of traditional and Roth allows me to draw down the traditional in lower tax years to avoid RMD and have the Roth to fill in those later years or pass on to children. Plus, if you’ve maxed the $23,500ish of the traditional 401k and still have extra to save, it’s more tax advantaged in a Roth vs a taxable brokerage account.

              These are obviously champagne problems but if you’re a high earning W2 it’s worth considering.

        • sgc 7 hours ago

          For those of us very late to the investing game, what is the best strategy to try to catch up at least somewhat?

          • scarface_74 4 hours ago

            I can speak this as someone who is also behind because life…

            https://news.ycombinator.com/item?id=44377380P

            There is no secret. I’m 51 and the math says I won’t be able to retire until the earliest when I’m 66.5 and my wife turns 65 and probably won’t retire until I’m 68.5 and my wife turns 67. Since she will be claiming spousal social security (50% of mine) and that’s when hers doesn’t get any larger by waiting.

            That’s with my projecting maxing out my 401K + catchup contributions + in a couple + in two years after another obligation falls off maxing out a Roth.

            Don’t cry for me. I work remotely, we travel extensively and do the digital nomad thing sporadically. Like next year we are going to Costa Rica for a month and half in the winter and travel domestically in the summer. We live in a unit of a condotel we own and it gets rented out when we aren’t at home to cover the market.

            The way I see it, no need to wait until retirement to travel and by the time I do, we will be doing longer stays in Costa Rica, Panama City, etc

            I’m not rich, and I make around $200K as a staff consultant working at a third party cloud consulting company.

            https://news.ycombinator.com/item?id=44162993

            https://news.ycombinator.com/item?id=44159562

      • dmichulke 6 hours ago

        Especially, if you don't want to invest in a bitcoin ETF

        https://markets.businessinsider.com/news/etf/bitcoin-etf-van...

      • jkmcf 12 hours ago

        My millionaire, step-father-in-law, gave this advice to my brother when graduated.

        I was lucky, my physics department administrator told me the same thing when I was graduating.

        The 2ND best piece of advice is to rollover your 401k when you move to a new company -> this cost me at least 500k because they effectively stagnate when your company isn't paying the maintenance cost (AIUI).

        • slapstick 11 hours ago

          > this cost me at least 500k because they effectively stagnate when your company isn't paying the maintenance cost

          Is this true? My understanding is that the fees come out of the account itself. There's other good reasons to roll over (primarily investment flexibility) but I have not heard of something like this.

        • bcyn 9 hours ago

          I don't think the point about 401k stagnation is true. At most fee structures and optionality of funds change. How did that cost you 500k exactly?

      • monkeyelite 9 hours ago

        Why are we advertising this particular broker?

        • arjvik 9 hours ago

          Vanguard is one of the cooler-structured brokerages. Vanguard (the management firm) is owned by the mutual funds themselves, of which you are an investor of. So their shareholder obligation is genuinely towards "clients" of the individual mutual funds. As far as I'm aware, this is the only mutually-owned mutual fund firm.

          It's definitely got a solid track record and good fees, but these are things I'd feel weird about advertising it on HN for.

        • nemomarx 9 hours ago

          vanguards very large and they're a mutual fund, so they have a lower profit motive than most brokers for it. they're basically the standard retirement fund company now

          • monkeyelite 6 hours ago

            > lower profit motive than most brokers for it

            This doesn’t make sense.

            • gertlex 6 hours ago

              What I think they're referring to is their sheer size (ratio of customers or $ invested to staff) has meant historically the annual % fees on mutual funds and other investments have been lower than at other institutions.

              It's... less unique to Vanguard these days, as several of the large providers have equivalent low-cost funds you can invest in; but 15 years ago it was more significant, iirc.

    • al_borland 8 hours ago

      My mistake was not starting early, because the numbers were small and it didn’t seem worth the time. The habit and systems are important to build, so that when the numbers do get bigger it goes to the right place.

      • calvinmorrison 8 hours ago

        my mistake was to graduate in 2008 and then start a business right when covid hit.

        • bongodongobob 8 hours ago

          In other words, 2008 had no meaningful impact on you then.

          • bsimpson 7 hours ago

            I also graduated in 2008.

            Starting my adult life with the markets in freefall made it hard to get in the habit of investing. All through school, people told me "most people don't start investing until their 30s, and end up in a worse than they ought to because the time-value of money compounds a bunch if you add a few more years." I thought I knew better than to be one of those people.

            Instead, I ended up keeping a lot of savings in cash during years when the interest rates were approximately 0. I've tried to get better at putting money into the markets over the past few years, but my financials look very different than they might have.

            > In other words, 2008 had no meaningful impact on you then.

            People who graduated in the late 00s might not have accrued big financial losses, but it had a very meaningful impact on my comfort investing.

            • bongodongobob 7 hours ago

              I don't follow. The markets were low, great time to invest. Great time to buy a home. 2008 was bad for people who owned homes or were already investing.

              • widhhddok 6 hours ago

                You have to view it from a new investor's perspective. They have just started their career, earning (small amounts of) money for the first time, and investing would have them see a loss of 5-10% of their hard earned money, at least in the short term. They wouldn't know, or would have to believe that the loss will be outweighed by future returns at the time.

                It's tough to swallow.

              • gertlex 6 hours ago

                I seem to recall a bunch of folks lost jobs around that time. Hard to invest in that situation. Extra so as a new grad without a job.

              • Eduard 6 hours ago

                > The markets were low, great time to invest. Great time to buy a home.

                in the US maybe?

    • FristPost 9 hours ago

      I didn't start investing until I understood it.

      This is a fantastic course. It covers a lot of ground.

      If you want to actively invest, this will help you learn the mechanics. But in the end, what you really learn, is that you can't beat the market.

      https://ocw.mit.edu/courses/15-401-finance-theory-i-fall-200...

      • r0b05 7 hours ago

        Excellent resource. The videos link to a YouTube channel with a treasure trove of content in multiple disciplines. Thanks for sharing!

      • sitzkrieg 6 hours ago

        buy vti and wait. thats it

        • itake 5 hours ago

          I think that works if you have less than $1m. But if you have more wealth and are older, you need to diversify a bit more.

    • ropable 5 hours ago

      Compounding interest is a powerful force.

    • emmelaich 14 hours ago

      Get a financial advisor that you trust.

      • culopatin 6 hours ago

        But to trust one you need to have the knowledge, might as well DIY at that point.

        • emmelaich 35 minutes ago

          Use word of mouth. Or relative's recommendations. You're right that nothing is guaranteed.

  • zappb 16 hours ago

    Writing tests first is a good way to end up with testable code. If you skip that, retrofitting tests is incredibly difficult.

    • atomicnumber3 15 hours ago

      While it can be a useful forcing function, I find it also just fits into a higher velocity workflow in general, one I would describe like so:

      1. Make PRs small, but not as small as you can possibly make them.

      2. Intend to write at least one nice-ish test suite that tests like 50-80% of the LOC in the PR. Don't try to unit test the entire thing, that's not a unit test. And if something is intrinsically hard to test - requires extensive mocking etc - let it go instead of writing a really brittle test.

      3. Tests only do two things: help you make the code correct right now, or help the company keep the code right long term. If your test doesn't do either, don't write it.

      4. Ok - now code. And just keep in mind you're the poor sod who's gonna have to test it, so try to factor most of the interesting stuff to not require extensive mocking or shit tons of state.

      I've found this workflow works almost anywhere and on almost any project or code. It doesn't require any dogmatic beliefs in PR sizes or test coverages. And it helps prevent the evils that dogmatic beliefs often lead you into. It just asks you to keep your eyes open and don't paint yourself into a corner, short term or long term.

      • AnimalMuppet 14 hours ago

        One more piece - if the test would be hard to write, use that to drive you to clean up the architecture of that piece of code.

    • socalgal2 3 hours ago

      I'm not disagreeing with you but there's a large number of programmers who viscerally disagree with "test first".

      https://www.youtube.com/watch?v=NyiMOmCqu00

    • ryoshoe 15 hours ago

      Even if you aren't going to do the complete test code just writing down the expected checks for each test makes things so much easier

    • deterministic 6 hours ago

      And only write tests against the API you are responsible for.

      Never let tests depend on implementation details.

    • globular-toast 4 hours ago

      I'll add that retrofitting good tests is almost impossible. Too many people write tests against working code that just tests what they know the code already does. At best these are regression tests. If you write tests first you are forced to think about what you want the behaviour of the software to be before you've gone deep into a solution and forgotten about the original problem.

  • MrDresden 14 hours ago

    Technical skills will only take you so far in most orgs. Learn to play the soft game.

    • ipnon 9 hours ago

      When I stopped trying to be right and I started trying to be friends my career finally took off.

  • kevinqi 7 hours ago

    duplicate code is not that bad. reduce duplication over time as you find the common patterns/abstractions, instead of trying to build abstractions too early

    • socalgal2 3 hours ago

      Maybe obvious but also, don't deduplicate if it means adding options or making things too abstract. I don't know if I can think of a good example. Maybe you make a function that compares arrays of strings. Then you decide to add an option to make it case insensitive. Then someone comes along and decides they want to compare arrays of structs. So they had a comparison function option. Most times I've seen this pattern the code gets way harder to understand and more brittle. All the options etc cascade into spaghetti and changes start breaking things because so many paths expect some original behavior. Better to have just kept them separate, most of the time.

    • ipnon 5 hours ago

      Duplicate or near-redundant functions are either no problem or even useful. But duplicate or near-redundant data structures are a plague on any codebase.

      The prophet Perlis declared: "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures."

    • aitchnyu 4 hours ago

      Have you set up a copy paste detector that fails the build if you write too many duplicates?

    • gwlperl 7 hours ago

      Yes.

  • Minor49er 4 hours ago

    My most productive hours are towards the evening because the day is spent addressing points and problems that people have brought up since the previous day. Once others' activity has been addressed and everything has been caught up with, my mind is able to focus on technical details and achieve a state of flow

  • postit 3 hours ago

    It’s not about skill and knowledge, but networking and visibility

  • bravesoul2 10 hours ago

    Make use of L1 wetware cache by learning how to do common things and dont make AI do them.

  • pyzhianov 2 hours ago

    Finding the right balance between "zero dependencies, building everything from scratch", and relying too heavily on third-party code. Both extremes are full of misery and frustration, and it's so hard sometimes to get it right. But most of the time these days I find it easier to start with fewer dependencies and probe for balance from there

  • tibbar 8 hours ago

    You can memorize the correct opening moves in chess. For maybe my first year playing chess, I just YOLO'd the opening moves. My judgement there was probably not much worse than the rest of my play, but with other players playing engine moves in the opening, I was probably in a losing position early on in most of my games. I gained about, I think, 100 ELO after learning some 3 or 4 move opening combinations.

    • Ericson2314 5 hours ago

      We should all play Chess690 so we don't have to waste time learning openings, right?

  • muzani 3 hours ago

    Get a screenshot app. Shottr is awesome. CMD+SHIFT+CTRL+4 and I can take a picture. Paste UI on a GitHub PR. Paste Figma into a LLM. Paste bugs into Slack or a support tool. It does text recognition too, so whenever my wife sends me some kind of ID via a screenshot, I can just copy from that.

    • chamoda 2 hours ago

      For anyone interested, here’s how I achieve the same in i3wm: it works with the Print key and lets you select the area using only CLI tools.

      bindsym --release Print exec "scrot -s '%Y:%m:%d:%H:%M:%S.png' -e 'xclip -selection clipboard -t image/png -i $f && mv $f ~/Pictures'"

    • alper 2 hours ago

      Is it better than Cleanshot?

  • sriram_malhar 2 hours ago

    ================== No Frameworks

    Do not create a framework to encapsulate what you are doing. For example, given annotations in Spring one loses touch with the level of indirection, and by the time you figure out why performance sucks, you are too deep in the way that framework works.

    Instead, provide simple abstractions that do not dictate the control flow.

    =================

    Digital Dry Days

    I find that not looking at the screen (no mobile, no TV, no laptop) twice a week has helped me immensely. There is no automatic reliance on the internet or AI. Sometimes I have to prep in advance for a dry day, but there are plenty of books to read and lots of theory and rigor to be understood without distractions. More importantly, I find myself being actually more productive.

    I surf the web less, am distracted less and get a lot of non-work stuff done too.

    • rk65536 an hour ago

      Dry days is a really interesting idea. I wonder if it’s doable to do this in a working day when you need to work at a screen, might be too tempting to procrastinate at work. But maybe 1 of the weekend days could already bring benefits like you describe.

      • sriram_malhar 13 minutes ago

        It is esp. important on a working day. I thought I'd need to be responsive to emails and messages, but nothing that could not wait at least until evening. Every so often, I'd have to spend a half hour going through all messages to make sure nothing got dropped, but the rest of the day was dry.

  • cjfd 42 minutes ago

    There are many more things that are interesting to do than there is time to do them. Pick one or a few and drop the rest.

    • _kb 33 minutes ago

      Counterpoint: there are many things that are interesting to do. Explore and learn from them.

  • FinnLobsien an hour ago

    Most goal-setting and "systems" will not help you reach that specific goal, but are a forcing function to introduce momentum and get you moving in a direction where you often discover the real reward that activity brings.

  • bacon_fan123 4 hours ago

    You dont change through motivation, rather through your habits

    • socalgal2 3 hours ago

      I'm not saying you're wrong but it seems so backward. I didn't love computing as a kid because I had a habit of computing already. I got that because I was motivated to play with the computers. The motivation came first, not the habit.

      Same with learning a 2nd language. First I got motivated to learn it. I didn't get the habit first. In fact I can't name anything I got a habit for before being motivated.

      Again, I'm not saying you're wrong. I've heard this advice many times. And maybe forming a new habit leads to motivation. It's just counter intuitive based on what think is most people's experiences.

    • treetalker 4 hours ago

      A related (restated?) point I like to keep in mind is: acting produces motivation, but you can't count on motivation to produce action.

      Taking even the smallest step (or working on something for even 30 seconds) often overcomes the inertia that keeps the task/project unfinished. A little nudge is all I need to start building the momentum that will carry through to completion.

  • thebeardisred 9 hours ago

    A shell script has to start with "#!" with no spaces before it. I spent about a week figuring that out 25+ years ago.

    • procaryote 3 hours ago

      Technically it doesn't... If you drop

          echo "hello world"
      
      into a file and chmod +x it, it will run with /bin/sh

      You technically only need the shebang to set a specific shell, or options.

      ... This little quirk allows you to commit crimes like:

          //usr/bin/cc -o ${o=$(mktemp)} "$0" && exec -a "$0" "$o" "$@"
          #include <stdio.h>
          int main(void){
              printf("hello world\n");
              return 0;
          }
      
      which will autocompile and run on execution.

      (don't)

    • ramses0 8 hours ago

      Similarly, it's `XXX=123`, and cannot be `XXX = 123` or `$XXX=123`.

      Shellcheck (and Wooledge) are crucial!

  • commandersaki 6 hours ago

    It's easier to tell the truth then maintain a complex web of lies.

    • saaspirant an hour ago

      Also you don't have to remember your lies if you tell people the truth

  • hintklb 7 hours ago

    Realizing that buying a house is absolutely not a good investment and that the whole society is on a narrative to convince more and more people to blindly buy (realtors, lenders, other homeowners, the governments, parents,...)

    Doing the real math is the trick of the trade. The math for owning has been made so that it looks like a good deal while in reality it is not at all. Most people will literally compare mortgage to their rent, or "I sold my house I bought for 500k for 1M$, therefore I made 500k$".

    Treat owning as a luxury item. The same way you would own a sport car or travel on a private jet. Do the (real) math and realize Owning is costing you money.

    Also don't let yourself get emotional about buying a house. Society has made it look as if buying a house was a proof of success. A lot of research shows that once people buy they lose flexibility, feel more stuck, cannot access higher paying job in a different places etc. Renting has a ton of advantages.

    This calculator get most things right. As an exercise, you can try to retroactively put the numbers for the house you bought and the rent equivalent. The results might surprise you: www.nytimes.com/interactive/2024/upshot/buy-rent-calculator.html

    • vayup 7 hours ago

      As I grew older (and hopefully wiser), I have internalized investment returns is a lot more than sanitized numbers. I did the numbers and as a result did not buy much real estate when I was yonger. It was pretty clear, if I put the same cash outflow into stocks, I would come out ahead... Way ahead!

      The things is, I didn't put the same cash outflow in stocks. For various reasons. But mainly, it was just not psychologically palatable to max out my investments on equity by streching my finances. With hindsight, given the buffer in most real estate investments (left with tangible assets, banks shouldering some of the risk etc.) it would have been a lot more psychologically palatable to investment my max in real estate.

      My point is not that real estate is "best". But merely, there is a lot more to returns than cold numbers. If you think you already understand it, and are under 30, you are likely underestimating the significance of that. I know I did.

      • hintklb 7 hours ago

        This is the argument that buying a house serves as a subpar, forced investment for most people.

        But I don't know if I agree with you, I understood in my twenties that housing was generally a bad investment. We are now 10 years later and I invested everything in the stock market instead and came way ... way ahead than if I bough one or more houses.

        I personally find it way way more scary to buy an average 2M$ house that could crash and lose half of its value overnight than the whole American economy that is relatively diversified. What happens if there is a fire in your neighborhood? Or if your city is the next Detroit? We have been made to believe a house is a safe investment. I personally think it's the scariest least diversified investment you could ever make.

        • itake 5 hours ago

          The other factors beyond cost to consider are:

          1/ with renting, you might outlive your landlord (forcing you and your kids to move / switch schools).

          2/ control over the health of your home (installing water filters, air quality sensors, fixing mold immediately instead of waiting for a landlord).

      • bfg_9k 7 hours ago

        You know I hear this all the time but it never quite makes sense to me. REA is inherently a better asset class than the vast majority of assets, simply because you can leverage up without a risk of being stopped out.

        Doing the numbers on (most) developed economies, buying freehold housing is typically a worse investment than stocks before leverage, but after, RE almost always comes ahead. Nobody is going to let you mortgage a basket of stocks, but almost any bank will let you do that with a house.

        That said - I hate this idea because I think this kind of thinking is what has lead to many of societies problems in the developed world at the moment. But, from a rational point of view the numbers make sense.

        • hintklb 7 hours ago

          It's worse than that. Buying a house without leverage is a terrible investment.

          The leverage is absolutely required because all the fees that come with real estate (Realtors, Interest, HOA, Taxes, Insurances, Closing costs, Downpayment opportunity cost,...). The leverage makes it an OK investment, but still historically not on the level of a diversified basket of stocks.

          The leverage also works in both ways and essentially makes your house an even more risky asset. It supposes that it only ever goes up which has not always been the case historically.

          • esseph 6 hours ago

            VA loans with no down payment and 3.5-4.5% rates did a lot of good work for quite awhile.

            But, with the desires of builders to maximize profits, I don't see supply of homes (especially smaller ones of 1-3 bedrooms) easing anytime soon.

    • alexey-salmin 4 hours ago

      I find this logic shortsighted and I don't think the right chapter of math is being applied. You need the probability theory not calculus.

      Yes, renting is often better than owning on average. However, as any good poker player knows, having a positive strategy on average is nothing unless you control the standard deviation. You need to have reserves deep enough and to be able to play long enough for your average to consistently manifest itself.

      In lifetime investment choices the human lifespan is the major limitation. You won't be able to live long enough to absorb multiple economical collapses and surges — which indeed had always been profitable in the end, just not necessarily for you. You draw your card and you play your hand. In such circumstances a strategy with less gains but also less variability is usually preferable.

      A good analogy is insurance: having insurance is always worse on average than not having one, otherwise insurance companies won't exist. Buying insurance for something small, some loss you can absorb yourself, like your phone or bicycle, is in most cases a bad idea. However, buying insurance for your house or your health is usually a good deal. You pay money to tap into reserves that are bigger than yours, you get slightly negative mean expectation with near-zero variance. Even the insurance companies themselves do it when they judge their reserves are not deep enough for a given contract — and resell parts of it to other companies to spread the load.

      • hintklb 4 hours ago

        I understand probability theories but I don't see how this applies here. I don't see either how the insurance concept applies for housing? There is a healthy rental market that will always exist, Are you arguing that you might get priced out and therefore you should buy (even if overpriced) to avoid that potential issue?

        Both housing and stocks will go down during an economical collapse. They are both correlated. You can actually make a point that housing being a highly leveraged asset is way worse during a downturn than being long on stocks.

        • alexey-salmin 4 hours ago

          Stocks, deposits and currencies can all crash to zero while your primary residence never goes below the value of housing your spouse and kids (which is pretty damn high as far as I'm concerned). Some rental market will exist almost always but that's not necessarily true for your job and your savings.

          My parents lived through times like this and so will my descendants eventually. The probability of this happening to my generation is low but non-negligeable so I find it necessary to hedge against.

          • hintklb an hour ago

            your house is never truly yours. What happens if you stop paying taxes and HOA for example? You can never fully hedge against everything, live with it.

            There are no certainty in life and thinking that a house is yours forever is an illusion.

    • solatic 3 hours ago

      By and large, I agree with you. Especially if you are single, owning real estate represents a massive commitment, both financial and to the local place, that nobody forced you to take. People need to remember that the default for real estate is to fall into disrepair and turn back into the dust of the earth; as someone who owns real estate, you are responsible for fighting that entropy, as is everyone else in your neighborhood, as living in the only well-maintained house on a block full of abandoned blight isn't going to rescue your property value.

      With that said, sometimes you want to make that commitment, because it's a socially good choice, rather than a financially good choice. Children need stability. Moving houses, neighborhoods, schools is not good for them. Good parents make sacrifices for their children, including staying in jobs where they might make a little less compared to Yet Another Move.

      For most families who want to provide stability for their children, the choice is between purchasing a house, or a long-term rental of an apartment owned by a public housing authority that is bound by law or regulation to keep rent increases down and renters in-place, so long as they continue to pay their rent. In the US, most people do not have access to the latter, or the latter are only found in bad neighborhoods where the public housing authority was underfunded and mismanaged. That leaves purchasing real estate as the only option.

    • pepinator 6 hours ago

      This is obviously not true. You don't have to do the math to realize: when you pay rent, every moth, an important part of your salary simply disappears, leaving nothing for the future. When you pay a mortgage, your paying the house you'll own. Of course, there are interests and fees and whatnot, but you'd need to pay huge amounts so that it becomes unviable; I can't imagine a single scenario where that occurs.

      • Swizec 5 hours ago

        > This is obviously not true. You don't have to do the math to realize [rent is throwing money away]

        This greatly depends on your specific numbers.

        We did the math with my partner: our current rent is 5k/mo. Our mortgage for the same place bought when we moved in would be 9k/mo + transaction cost + maintenance. It will take our rent almost 10 years to catch up to the cost of a mortgage. Max increases are capped in California.

        Over those 10 years, investing the delta in index funds puts us about 200k ahead of buying in terms of net worth. We’re also not handcuffed by a mortgage for 30 years which gives us optionality.

        Not buying has let us build about 700k net worth debt free in the last 10 years we’ve been together. We’ve also moved 3 times with essentially zero transaction cost. I think that’s fine

        • hintklb 5 hours ago

          you definitely came ahead by not buying and you did the math. Good for you!

          Generally, this holds true today for most HCOL and MCOL areas. It is still a good idea to buy in a few LCOL areas.

          What I have seen is that in high-earner areas (Bay area for example) buying completely outpaces renting in cost (buy to rent ratio_. Mainly because the pool of buyers outbid each other. This is mainly due to the narrative and social pressure to buy at all cost. Similarly, renting stays relatively low as people do not compete as much.

          • Swizec 5 hours ago

            > Generally, this holds true today for most HCOL and MCOL areas. It is still a good idea to buy in a few LCOL areas

            We have friends who rent to live in SF and buy in LCOL as investment properties. Also seems to work well as a strategy.

            I think of primary residence as a consumption expense. It's not really an investment because you can't cash out[1]. So unless you put value on the act of owning itself, it's best to do whatever gives you a lower monthly. In our case that's renting.

            [1] yes I know about HELOCs. I'd rather get margin loans on index funds than risk getting kicked out of my home.

            • hintklb 5 hours ago

              I fully agree with you. I also think that there are as many good intangible argument for owning as for renting.

              Renting allows you to be flexible for new opportunities. They allow you to focus on other things in life than your house, treat your landlord as a service provider, free your time to do more important things.

              Frankly it is sad that as a society we value homeownership so highly and judge people that decide to rent so harshly.

        • globular-toast 4 hours ago

          With those kind of numbers it doesn't really matter what you do, you'll still come out ahead.

          1. Be rich,

          2. Don't be poor.

      • lesuorac 6 hours ago

        In the majority of markets an individual that invested the down payment into the SPY500 as opposed to a house comes out a head. Especially if you sell the house on average every 7 years ...

        Just do the math yourself; it's pretty easy [1] [2] [3] [4].

        That said, not every decision in life needs to be profit maximization. You can enjoy owning a house.

        [1]: https://research-tools.pwlcapital.com/research/rent-vs-buy

        [2]: https://www.nerdwallet.com/calculator/rent-vs-buy-calculator

        [3]: https://www.zillow.com/rent-vs-buy-calculator

        [4]: https://www.calculator.net/rent-vs-buy-calculator.html

        • ternaryoperator 5 hours ago

          This doesn't take into account that you need to live somewhere.

          If you spend $2K on rent (which gets no return) and put $1K into the SPY500 every month or put all $3K into your house, you will be far, far ahead with real estate.

          • hintklb 4 hours ago

            I don't know why you think this is not taken into account by those calculator. They obviously include the cost of rent for a similar place...

      • hintklb 6 hours ago

        if you buy a house today, you are literally paying a "huge amounts so that it becomes unviable". Check the concept of opportunity cost.

        • esseph 6 hours ago

          The problem is you still have to live somewhere, and buying is a real asset.

          I would like to take the Opportunity to not pay a fucking landlord, thanks.

          • hintklb 6 hours ago

            you obviously include the price of the rent-equivalent of the place you would buy in the math. Cannot even believe I have to say this.

            • esseph 6 hours ago

              Recently I looked at what it would cost me to move.

              First, I would be giving up several acres of land, and my dog and cats would be very unhappy.

              Second, for me to get a house with the same bedrooms, housing cost would almost DOUBLE, and on average it looks like I'd lose around 800sqft.

              I've been here for more than a decade. Moving would cost us a TON of money for no gain. (If we went to buy another home)

              And that calculator also agreed (on rent not being viable, either!)

              • LeonM 36 minutes ago

                > I've been here for more than a decade.

                I think that is where the difference is.

                The buy-vs-rent discussion is more aimed at first-time buyers. If you already own a property that is largely paid off and has had the benefit of appreciation over the time you owned it, then yes, it may be more beneficial to keep the property, as you have seen from the calculator.

                If the answer was always that rent would be cheaper, then the calculators wouldn't have to exist ;-)

                > housing cost would almost DOUBLE

                Except that you will now have the profits from selling your previous property, which you can invest. That investment payout can partially or even completely offset the cost of renting, which means your monthly costs will be much lower.

                Say you make 500k by selling your house, and invest that against 6% ROI, then you make 30k/year passive income, thats 2.5k/month. So deduct that from the rent you'd pay and compare again.

    • nothrabannosir 7 hours ago

      *> Most people will literally compare mortgage to their rent, or "I sold my house I bought for 500k for 1M$, therefore I made 500k$".

      I’ll bite: what’s the problem? If anything mortgage is even more favorable than rent because part of it goes to paying off the principal. Which is still your money, just in a different asset. But I guess you include this and still reach the opposite result?

      Are you talking about taxes or maintenance or something ? Which country / locality? What time span? How many places are there where you would’ve been better off renting than buying in recent memory… not where I’ve lived but you never know!

      • hintklb 7 hours ago

        Because the mortgage and the rent are completely different numbers.

        The rent is the maximum you will ever pay for that period. The mortgage is the minimum you will pay and doesn't include the downpayment, repairs, HOA, Insurance and tax increases. It also doesn't include the closing costs, realtor costs, all the fees.

        This is why the math is so complex. People easily forget all those fees and costs to make the math look simple.

        This also takes into account that you invest into the US market and equity with all the cash that you would have had to spend on your house.

        I'm talking about the US, but this holds true in multiple countries.

        To answer your last question: In almost all HCOL (SF, Seattle, ...) you would have been way better renting than buying, except if you time it perfectly. If you look at today's market you would almost definitely be better renting than buying (But nobody knows the future...)

        • bigstrat2003 6 hours ago

          This is just plain wrong. Let's break it down:

          * Insurance and tax increases: real and you have to deal with them, but they don't go up as fast as rent does. Advantage: owning

          * HOA fees: don't buy an HOA home, problem solved. You should do that anyway just because HOAs suck ass.

          * Down payment: not a real cost, that money is yours in the form of equity

          * Closing costs and other fees: real but completely negligible when amortized over the life of the home.

          * Repairs: real, and they suck. This is the only place renting can stack up superior, but you can do a lot to mitigate this by doing your due diligence up front and not buying a dud house. Overall, unless you get unlucky you should come out ahead, but you can lose the die roll.

          * Realtor costs: greatly depends. When we bought our house we paid zero, because the seller pays the buyer's costs. This can be a serious cost if you're changing houses a lot, but... just don't do that (for multiple reasons).

          Overall, after buying my house 7 years ago I'm coming out ahead month over month (thanks to rent going up like clockwork every year, while my mortgage has stayed the same). By the time I die, I will be significantly ahead, and that's not even taking into account unrealized gains in the value of the property. Which I don't count for much, because my home is a place to live and not an investment vehicle. But maybe someday it'll do me good, or my heirs.

          Owning a home really is a great deal for the vast majority of people in the US. It's not some society wide conspiracy, it's not an ad to get others into the market so you can benefit, it's the truth.

          • hintklb 6 hours ago

            This is wrong in so many ways. Just using the buy or rent calculator demonstrate this. You are essentially repeating realtor talking points ("Renting is throwing money out of the window"). You need to use real numbers and compare them to the rent equivalent.

            * Down payment: not a real cost, that money is yours in the form of equity

            The opportunity cost of the downpayment is the issue. The equity you gain from downpayment is nowhere close to the opportunity cost of investing it in the stock market.

            Owning MIGHT have been an OK investment for most Americans 20 years ago. that is absolutely not the case today anymore.

            Ah yes, so you timed buying your house perfectly due to the one time increase during covid ("7 years ago"), and you think this generalizes to anyone buying today.

            This is the same story as me anecdotally saying that I bought Nvidia 6 years ago therefore Stocks are always absolutely better.

            So let me ask you? Based on your logic there is no price at which buying makes no more sense? What is the cutoff for you? What if you could rent a 4M$ house for 4k$/Month? Is it still a great deal? What if that house only goes up 2% a year?

            Those are the only things that matter. The hard numbers! And right now they do absolutely not make sense.

            • Group_B 6 hours ago

              Rent numbers aren’t making sense either though. I mean have fun renting if that’s what you prefer!

              • hintklb 6 hours ago

                Oh I don't like renting, but so far it has saved me so...so much money that I will be able to buy as a luxury down the line something WAY better than if I bought directly.

                The difference is that I will treat it as a luxury. Not as an investment. The same exact thought process as if I bought a sport car.

    • aakast 5 hours ago

      Did you account for leverage? I agree with you all the way, however, the top reason it can actually be beneficial to most people is the fact, that they can leverage their money.

      Putting it a bit simple, it would mean, that for most people, ncr_(real estate)^t > c*r_investing^t

      It all depends where in the world you are, but most places have easier access to loans for real estate than investment, and everything else being equal, the risk is also higher. There might be this line of thought in wake of the financial crisis, that real estate carries close to or as much as the same risk. It doesn't. It's just not zero, and that is the lesson learned.

      • cloudbonsai 4 hours ago

        The best argument I've heard (and I'm somewhat sympathic to) is to compare home equity with real estate investment vehicles.

        1) REIT is a diversified bet on a group of high-grade properties that has positive cash flow, levered with a commercial loan borrowed at 3-4%. It's as liquid as stocks, and managed by someone other than you.

        2) Home equity is an undiversified bet on a single residential property that has no cash flow, levered with a retail loan borrowed at 5-6%. It's fundamentally illiquid, and managed by you.

        Here is a question: People normally consider it's dangerous to lever your REIT position. Doesn't it suggest that home ownership is actually risker than commonly perceived?

      • hintklb 5 hours ago

        All the calculators include leverage, yes.

        In fact leverage is absolutely required for real estate to even be considered an investment, and not even a good one. The fees, interest, etc are eating all the gains from the leverage.

        A leverage also goes both ways. Making the housing investment so much more risky if not well timed.

        Houses in Denver for example went down close to 10%. Now imagine you leveraged this...

    • nothercastle 7 hours ago

      There are a couple good resources on this. The nyt rent vs own calculator is good but also there is a great podcast episode (tailored for Canada but mostly the same in the us) https://rationalreminder.ca/podcast/323

      • hintklb 7 hours ago

        You are exactly right and I will add this to my post.

        This calculator get most things right. As an exercise, you can try to retroactively put the numbers for the house you bought and the rent equivalent. The results might surprise you: www.nytimes.com/interactive/2024/upshot/buy-rent-calculator.html

    • cco 5 hours ago

      I just penciled out several home buying scenarios in HCOL, according to the calculators you posted, it only very recently became a questionable purchase if you don't plan on staying 7+ years in a home.

      At any other point in the last 20, maybe 30-40 years if you re-finance well, it was always better to buy if you intended on living in an area for any reasonable amount of time.

    • NalNezumi 5 hours ago

      Another positive is that you're morally clean.

      "A place to live is an financial investment" is a perverse idea to begin with. You won't be a passive participant of one ill in the society. HN is quick to debate often about how housing is one core issue in many socially bad phenomenas but look at that, when you question the fundamental premise causing that everyone comes out trying to dismiss that. It's easy to lament "societal" issue when it's some other group (society) but it's all justifications that comes out when money is involved and it's pointed out that it's the individual actions that causes it (yours).

      Which is kinda why we are at the point we are. "everyone needs a house right?!?" and someone realized (artificial) scarcity is a way to milk money out of that. Everyone bought it. Now every middle class person and their bank are in the game. "housing always increase in price" is a goal that is turned to a belief/principle. It was made a social issue by all the people who bought in to it

      Go to a place where housing is not considered a financial investment but a consumable,(such as Tokyo) and you'll realize the mode is not as bad or an unalienable truth as many think. It's rather a symptom of a inefficient use of wealth, as a society.

    • pmg101 5 hours ago

      Let's simplify by assuming you can choose between two scenarios:

      1. The bank lends you £1m to buy a house, you pay them 5% interest for this service = £50,000 pa.

      2. You rent a £1m house from a landlord and pay £50,000 pa for this service.

      Financially these are identical. And in either case if you stop paying you will lose your home - because it's not really yours, it belongs to the bank/landlord.

      However surely 1. is always preferable?

      * You can make any change you like to your living environment up to and including moving walls around

      * Assuming you do continue to pay you have the absolute right to live there and will not be forced to leave

      * Rents can rise out of your control, even to the point you can no longer afford it. Mortgage rates can change over time too but you get to choose your level of risk appetite explicitly by fixing for the period you prefer.

      • sladoledar 4 hours ago

        These are not financially identical at all, at least where I live. If heating breaks down, it is landlord's financial burden. Sooner or later you'll have to replace the roof. You don't have this type of financial burdens if you rent.

        • pmg101 3 hours ago

          Yes it'd be interesting to see all those kinds of decadal costs factored in.

          My head is still very much turned however by the fact that rents rise with or above inflation every year, meanwhile I'm still paying off my mortgage in 2012 pounds. But I'm quite willing to believe I'm behaving irrationally.

      • hintklb 4 hours ago

        except that those are not the numbers we have today (in the US, I don't know in the UK).

        Rather, for a $1M house:

        1. The bank lends me $800k to buy a house with a 6.5% interest. you need to put 200k$ as a downpayment.

        2. The rent equivalent is 28000$ a year.

        The math is way more complex than this, but what really matter at this point is the gap between renting and buying a place.

    • ropable 5 hours ago

      I'd phrase this quite differently: realise that buying a house might not be the optimal investment strategy, depending on life circumstances, goals and economic conditions. Boiling it down to "not a good investment" is overly reductive IMO.

    • lelanthran 3 hours ago

      > This calculator get most things right.

      It's paywalled. I also doubt it gets most things right. I've been pointed to so many and I have not yet found that that takes into account all the variables (and there's so few, so if they're leaving it out I'm suspicious!)

      > A lot of research shows that once people buy they lose flexibility,

      They lose that once their kids are in school.

      > feel more stuck,

      They're stuck anyway, once the kids are in school.

      > cannot access higher paying job in a different places etc.

      They cannot do that anyway, once the kids are in school.

      All of those disadvantages you list are not even noticed by people with kids in school, hence they don't count as disadvantages.

      The only advantage you realistically realise from renting vs owning is the ability to move within a month's notice. If you have kids in school or a spouse who is working in-person, not remote, you won't be moving on a month's notice anyway.

      IOW, why optimise for the use-case "Hey, we can move on a months notice!" when that use-case won't come up anyway?

      It's like a vegetarian optimising their life around access to meat-only burger joints. Or someone living 2000km from the nearest sea optimising their life for surfing.

      No one optimises their life for use-cases that won't come up.

      • hintklb an hour ago

        I have kids in school and none of your example holds.

        • alirezaxdehghan 19 minutes ago

          So you're implying that you can move to another city in a month? How's that possible? I need at least a 6 months window to move!

        • lelanthran 34 minutes ago

          > I have kids in school and none of your example holds.

          Okay. Different question then, how many times have you yanked all your kids out of their peer groups, permanently?

    • motorest 5 hours ago

      > Doing the real math is the trick of the trade. The math for owning has been made so that it looks like a good deal while in reality it is not at all. Most people will literally compare mortgage to their rent, or "I sold my house I bought for 500k for 1M$, therefore I made 500k$".

      Can you try to offer some explanation for your reasoning?

      I mean, for blue collar or even white collar workers, lower monthly payments for a mortgage does increase disposable income. When you eventually pay off your mortgage your expenses drop to zero.

      > This calculator get most things right.

      I think you need to educate yourself. There are rent vs buy calculators that allow you to do parametric tests and eventually arrive at the rather obvious conclusion that renting is marginally advantageous only in short time windows (up to around <5years) whereas buying is advantageous beyond that point.

      • hintklb 5 hours ago

        I spend more time than 99.999% of people on this subject and I'm quite educated in economics.

        I'm not arguing that buying a house is never right. I'm arguing that on average, especially in today's environment it is extremely difficult to make the number work in favor of owning as an investment. As a lifestyle luxury for the intangibles? Sure. But as an investment, this doesn't really make sense anymore.

        >> Can you try to offer some explanation for your reasoning?

        Those two numbers simply do not represent the same thing. A mortgage is an absolute minimum that dismisses the opportunity cost on the downpayment, doesn't include all the fees and definitely doesn't account for the increase in taxes, HOA and insurances.

        >> When you eventually pay off your mortgage your expenses drop to zero. Who pays for Taxes, Insurance, HOA, Repairs? Who pays the 6% realtor fees the day you sell?

        Based on those questions, I would invite you to similarly get educated.

    • nikkwong 7 hours ago

      This is of course true if your house is not income producing. If you rent out rooms of your house, the calculus changes considerably.

      …and now having viewed their calculator, I find it disingenuous that they haven’t added this as an additional configurable step, given how many bells and whistles their tool has. The takeaway from the tool is that you should never buy in HCOL areas, but renting out rooms in your unit is potentially a way to make it work out financially.

      • hintklb 7 hours ago

        I don't know if I agree. On average renting a room out of your place is the same as buying a place as a rental investment with the difference you can claim you live there (which gives you some small tax advantage).

        In general, real estate rental investment are terrible subpar investment. How would this be different?

    • archagon 5 hours ago

      While financially this is true, it does not account for aggressive landlords deciding to spike rent and/or deciding to sell and evicting. Housing stability can be worth a lot. (Of course, strong tenant protections help mitigate this issue.)

    • esseph 6 hours ago

      "Buying saves you $176,000 over ten years."

      Also the chart tells me that if your rent costs more than $1,000 a month, to buy.

      It also says if you stay longer than 5 years, to buy.

      I fucking signed up for this. Fuck. Now I get to go cancel...

      • hintklb 6 hours ago

        Let me guess. You put 8$% of YoY house appreciation? 3% of YoY stock appreciation? 10% of yearly rent increase?

        • esseph 5 hours ago

          No it just didn't cost my much to buy my home, I got a good rate that's locked in, and I have a family. Moving is not really something in the calculus. Rent is crazy, housing prices are crazy.

        • tayo42 4 hours ago

          > 10% of yearly rent increase

          Why call that out, that was my last 3 rent increases

  • entrepy123 17 hours ago

    How do you maintain tests, in order for LLM edits to not keep breaking things?

      - As a formal test suite in the program's own language?
      - Or using a .md natural language "tests" collection that must pass, which an LLM can understand?
    
    
    To answer the OP, I learned use different models for reasoning vs. coding.
  • procaryote 2 hours ago

    control-r

    for reverse shell history search. Took me a couple of years of history|grep before I bothered to look it up

    control-x *

    to expand a glob pattern directly. So if you're writing "rm foo*" and you want to be sure what it will actually do, C-x * and you now have it explicit and editable

    Works in bash at least

  • vishnugupta 8 hours ago

    Making sense of probability and statistics and incorporating them in day to day life.

    • quantdev1 7 hours ago

      Do you have any examples of ways you incorporate them into your day-to-day?

  • aitchnyu 3 hours ago

    I took too long to accept rebasing and squash merging ie faking/rewriting history. In 2012, I was a fan of Git and Lucene (underlying DB of Elasticsearch and its predecessor Apache Solr) storing immutable data stuctures to disk and Scala which does gymnastics to avoid mutable data structures so I kept that dogma.

  • 01HNNWZ0MV43FF 8 hours ago

    Always fix errors in reverse order, from the bottom of the file to the top. That way the line numbers don't change as you go.

    • procaryote 2 hours ago

      Oh I learnt the opposite lesson, as later errors might be spurious and just exist because of earlier errors, especially in single pass compiled things like C

      But I also do M-x compile, and emacs is clever enough to still find the right line when doing next-error, even if I edit things before.

    • undebuggable 3 hours ago

      Import transaction history into spreadsheet reversing the rows if necessary to start with 1st Jan at the top. This way you can make calculations mid year or mid month then complete them after receiving full statement only by appending rows, hitherto row numbers remain unchanged.

  • elevaet 2 hours ago

    Name things well when writing computer programs.

  • cwmoore 15 hours ago

    Observe as much mastery as possible at what you would like to do.

    • Terretta 15 hours ago

      Apprentice, journeyman, master: worked for millennia, will work for millennia more.

    • dandano 10 hours ago

      But don’t fall into the trap of that’s all you do. This can lead to procrastination of the thing you’re trying to do.

      • exodust 5 hours ago

        True, but at least your procrastination activity is learning about the thing, as opposed to unrelated procrastination activities.

  • sagarpatil 7 hours ago

    Claude Code recently showcased how powerful it can be when you don’t have to memorize commands. My AI agent works similarly. It finds the right CLI commands instead of relying on Playwright or an MCP server to perform tasks. What’s interesting is that even the agent doesn’t know many commands upfront; it simply uses the help option to discover what’s available.

  • tptacek 10 hours ago

    Always have a stack of deli cups handy.

  • WalterBright 15 hours ago

    That macros ruin everything they touch. I used them extensively for maybe 15 years, stopped adding them, and then a bit later removed them all from my code. My C/C++ code was a lot nicer without them.

    • jwrallie 2 hours ago

      Everything powerful is also potentially destructive. Macros have their places, but most of the time they are not the right solution. I too have removed most of my macros, and have a few that are worth to keep. Usually time saved with macro cleverness is paid off with time debugging with cryptic compiler behavior.

      When there is no other way, wrapping multi-line macros in a do while and #define constants in parenthesis can definitely help.

    • peterfirefly 14 hours ago

      My early C code would have been awfully slow without them. We needed enums and good inlining before we could ditch (most) macros. When did Zorland/Zortech C become good enough?

      There are still a few special cases where macros are useful, such as the multiple #include trick where a macro #defined before the #include determines what the macro invocations in the include file does -- really helpful for building certain kinds of tables.

      • WalterBright 14 hours ago

        Zortech had an inliner even before it was Zortech.

        The #include trick is called the "X Macro". I used it extensively, and eventually just removed it.

        • peterfirefly 13 hours ago

          Was it reliable enough?

          (I have never played with it -- I saw the ads in Byte but I never met anybody who had tried it. It seemed so ridiculously cheap that I felt it had to be a scam ;) )

          • WalterBright 11 hours ago

            It was frequently better and faster than the others. Mine was the first (for the PC) to add data flow analysis.

  • socalgal2 3 hours ago

    Since some of these responses are "life lessons" then mine would be, whatever you wanted to do, do it NOW! If you think, I'm going to take this job and then someday I'm going to do X, there's a high chance you'll never do X, whatever X is. You'll get into a groove and look up and see 10-15-20 year of your life disappeared. Your lifestyle changed. It's more expensive or you have kids or something that will prevent you from doing X. You might also have changed as a person and just not want to do X anymore even though you still feel X was your dream.

    The point is, don't delude yourself into thinking you'll someday do X if you wait.

  • aghilmort 10 hours ago

    read something new every day before going to bed

    journal before you start your day

    buy some sort of electric kettle

    • davewasthere 4 hours ago

      The fact that there's an entire country mostly unaware of the utility and ubiquitousness of a simple electric kettle, blows my mind. But then again, I'm a product of the Empire (British) not a North-American.

      But while the idea of using a stove top kettle (have done so in the past) is fine, the thought of using a microwave to heat up a cup of water for tea seems abhorent. (although it's really not)

      I guess it came about because 110V not being as efficient? Or more American's are coffee drinkers?

    • sakesun 5 hours ago

      I won't be able to have enough sleep then.

  • TMWNN 15 hours ago

    When I realized that a) `screen` exists and b) what it does, I felt like an utter fool for having gone for years—YEARS—without benefiting from it.

    • lpa22 9 hours ago

      Can you please elaborate here?

      • cturner 9 hours ago

        It is a terminal multiplexer. You will be able to find youtube videos. The gp is talking about a tool called gnu screen. If you need a more distinct token to search on try “tmux”.

      • sureglymop 9 hours ago

        Pretty sure they mean GNU screen, a terminal multiplexer. Similar in functionality to tmux or zellj (a newer alternative) if you have heard of those.

  • KingOfCoders 5 hours ago

    Delegation.

  • barrell 6 hours ago

    “Everything around you that you call life was made up by people that were no smarter than you” Steve Jobs

    Id heard this a hundred times, but around 30 years old it clicked and has fundamentally changed how I view things.

    • pmg101 5 hours ago

      I like the quote up until the word "people" because it is quite an epiphany to realise that anything that was made can be remade.

      I don't buy the "no smarter than you" part though.

      • kaffekaka 5 hours ago

        To me the point of "no smarter than you" is that you should not baseline assume they were smarter than you because that leads to apathy.

        Whether some people really were "smarter" than you (whatever that means) is not relevant to the point of the Jobs quote, I think.

        • pmg101 4 hours ago

          Yes, I am apathetical because it seems self evident to me that the reason Jobs invented the smart phone and I never could is because he's smarter than me. I guess I call that humility.

          Perhaps the point of the quote is to encourage people to falsely over-estimate their own smartness in order to maximise the likelihood they'll try to make a difference - because a tiny percentage actually will.

    • vannucci 2 hours ago

      My personal version of this was realizing that the bar for being a functional, relatively successful adult is FAR lower than I realized as a kid. Many adults can't get things which I find fairly rudimentary right and it explains a lot.

  • tjmc 9 hours ago

    Easy transfers between different people's iThings with Airdrop. I got my CompSci degree over 30 years ago and yet my 74yo aunt taught me this - the shame!

    • hirvi74 9 hours ago

      One other benefit, if it happens to matter to you, is that Airdropped files like photos or videos retain their original quality as opposed to taking a slight hit to quality when being transferred via text or email.

      • sureglymop 9 hours ago

        Also good to know is that if you crop a picture in your iOS photos app and then airdrop it to someone, they can undo the crop in their photos app. It is a non-obviously non-destructive operation.

      • AnonC 4 hours ago

        Make sure you select the “All Photos Data” in the Options, right at the top showing the selection in the share sheet. This has to be, somewhat annoyingly, done each time one Airdrops photos/videos.

      • esperent 4 hours ago

        That's why I always zip anything important before sending.

  • BilalBudhani 3 hours ago

    learning the crux of

    > Hard conversations, easy life. Easy conversations, hard life

  • mixmastamyk 10 hours ago

    Environment variables can be expanded at the command line, just like files. Believe I started before it was a thing and never thought to check until twenty years later(?), when I hit the tab key by mistake. :-D

  • 65 8 hours ago

    If you're selling something physical, always have free shipping. Include the price of shipping in the price of the product.

    I guess people now expect free shipping via Amazon and boy does this make things sell faster.

  • brcmthrowaway 9 hours ago

    tmux

  • austin-cheney 12 hours ago

    Measure everything. There are two benefits to this.

    1. Discarding the bullshit. A consistent practice of weighting assumptions and conclusions on evidence/numbers helps identify biases and motives from other people.

    2. Measures allow for value identification and performance. Most people just guess at this. Guessing is wrong more than 80% of the time and often wrong by multiple orders of magnitude.

    Most people don’t think like this and find this line of thinking completely foreign, so I often just keep my conclusions to myself. To see a movie about this watch Money Ball.

    • quantdev1 12 hours ago

      This is interesting. I’ve often thought about building a dashboard for my personal life, comparable to the dashboards I build for growth teams.

      And then iterating on it over time, and I find what’s valuable and what’s not.

  • prashantgupta24 6 hours ago

    Persistence > skill.

  • jcgrillo 7 hours ago

    Learn how to stab your colleagues in the back and play petty mean spirited office politics games. That's most of what being employed in this industry actually is, and if you accept that now and optimize yourself around it you can save decades wasted trying to actually get good at doing tangible (albeit economically useless) things.

    • Minor49er 3 hours ago

      You must be my former colleague whose behavior convinced me to quit my job

    • deterministic 6 hours ago

      That is not my experience at all (30+ years here working in different countries).

      I have only experienced this kind of environment once. And the fix was to quit and join a functional company instead.

  • ropable 5 hours ago

    That pretty much all modalities of resistance training work, no individual training session matters all that much, and what's really important is just doing it consistently for years.

  • lagniappe 9 hours ago

    CIDR

  • swader999 9 hours ago

    Scala

  • deterministic 6 hours ago

    1. Write exhaustive automatic tests against the API you are responsible for.

    2. Don't write tests for anything else.

    If you are responsible for implementing a server/service, the API is the protocol for the server/service. If you are responsible for implementing a module/library, the API is the public interface to your module/library.

    The tests are basically a specification for how any implementation of the API needs to behave. So you can give the tests to another developer, who has never seen your implementation, and they should be able to re-implement everything based on your tests.

    • ChaosMuppet 28 minutes ago

      I wholeheartedly agree! And would add:

      3. Make sure your API test suite runs fast, runs locally and is easy to use. Effort put into the test suite and tooling pays dividends for a long time.

  • moralestapia 10 hours ago

    Ship, even if it's crap.

  • tootie 7 hours ago

    You should never look at code and say "this should work". If it "should" work it would work. If it doesn't work, you definitely made a mistake. Poke every assumption one by one. Preferably with an interactive debugger.

    This may seem obvious but when I was younger I used to spin out in frustration at bugs.

  • scarface_74 9 hours ago

    Learning that it is more important to know how to communicate, how to promote myself and the art of persuasion to get ahead than any technical skills I could know.

  • jshprentz 15 hours ago

    Drum cards

  • jimsojim 7 hours ago

    Excellence in anything is a byproduct of having fun. Fun is a byproduct of understanding. Understanding is a byproduct of going slow. Going slow is a byproduct of curiosity. Curiosity is a byproduct of saying "I don’t know," of shunning beliefs and attending to what is in front, with zero baggage or impositions of your own—shunning the ego in the moment, moment by moment. Excellence comes when each piece is as equal as any other, when preference is shunned, when space is created to allow what is in the moment, without resistance, without insistence.

    • smokel 5 hours ago

      I don't think understanding leads to fun in most people. It probably is the case for most people here on Hacker News, but I doubt it's universal.

      • Bluestein 5 hours ago

        It is probably not universal. Whole point, I guess, is it should be (much as excellence itself, by the way...)

      • 1718627440 5 hours ago

        I think it does when the understanding follows couriosity.

    • duckkg5 7 hours ago

      This is relatable. Once one gets over the frustration of failing and making mistakes (thousands of times in some cases), it becomes fun and easier to stay curious.

    • ramraj07 5 hours ago

      I've seen a lot of people play cricket and soccer all their lives, they had a metric ton of fun, and im sure I will not put them close to the word excellent in any aspect of their lives. Im not sure any of the statements you made are agreeable in fact.

      • kaffekaka 5 hours ago

        I don't think GP is saying that if something is fun you will become excellent at it. Rather, of you want to excel in anything it is a huge advantage if you enjoy doing it, so try to keep it fun.