21 ms·
Ask HN: What trick of the trade took you too long to learn?
Every week for the last 3 months I’ve learned a new trick when it comes to getting whatever LLM I’m using at the time to produce better output. That’s my trade, but lots of HNers have more interesting trades than that.
In my case, only recently I learned the value of getting an LLM to write and refine a plan.md architecture doc first, and for it to break that doc down into testable phases, and then to implement phase by phase.
Seems obvious in hindsight. But it took too long to learn that that should be my approach. I had been going phase by phase myself- no overarching plan.md for the LLM.
What Trick of the Trade took you too long to learn?
- vouaobrasil 1y agoI 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 1y agoSimilar 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.
- noreplydev 1y agoit's not a 100 meters race, it's more like a marathon
- theshrike79 1y agoIn 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.
- CrimsonCape 1y agoFinland is a "high trust" country, isn't it? I can't see this concept working working when > 10% of the population would game the system to get more "off-the-record" free time.
- theshrike79 1y agoThe flex hours are usually only for office workers where performance can be measured - sometimes it replaces overtime. So the employer can "suggest" you work longer hours now when there's a ton of stuff to do (like end of year rush in accounting or payroll) and then you take days off when it slows down. But yea, it's not something that's easy to police.
- entrepy123 1y agoHow 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.
- zappb 1y agoWriting tests first is a good way to end up with testable code. If you skip that, retrofitting tests is incredibly difficult.
- ryoshoe 1y agoEven 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
- atomicnumber3 1y agoWhile 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 1y agoOne 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.
- specialist 1y agoI call this "outside-in programming". The synthesis of TDD and API design.
- oumua_don17 1y agoStart 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 1y agoCall 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 1y agoThat’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.
- davidivadavid 1y agoAt 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 1y ago
- TMWNN 1y agoWhen 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 1y agoCan you please elaborate here?
- cturner 1y agoIt 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”.
- dredmorbius 1y agoOn which, see: <https://news.ycombinator.com/item?id=44787374 https://news.ycombinator.com/item?id=44787374>
- sureglymop 1y agoPretty sure they mean GNU screen, a terminal multiplexer. Similar in functionality to tmux or zellj (a newer alternative) if you have heard of those.
- gaws 1y agoWait until you discover tmux[1]. [1]: https://github.com/tmux/tmux/wiki https://github.com/tmux/tmux/wiki
- cwmoore 1y agoObserve as much mastery as possible at what you would like to do.
- Terretta 1y agoApprentice, journeyman, master: worked for millennia, will work for millennia more.
- dandano 1y agoBut 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 1y agoTrue, but at least your procrastination activity is learning about the thing, as opposed to unrelated procrastination activities.
- cwmoore 1y agoI wrote “observing mastery”… Are you talking about watching YouTube?
- exodust 1y agoAre you saying masters of their craft aren't on youtube?
- cwmoore 1y agoNo, I did not say that. But unless mastery of video production is the goal you are seeking, watching pre-recorded video is not the experience I recommended.
- exodust 1y ago> "mastery of video production" If a master craftsperson records a video in their workshop demonstrating their craft and talking about their craft, you are observing mastery. This isn't some wild theory, this is a cold hard fact. Which leads us to the question, what the hell are you talking about?
- WalterBright 1y agoThat 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.
- peterfirefly 1y agoMy 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 1y agoZortech 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 1y agoWas 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 1y agoIt was frequently better and faster than the others. Mine was the first (for the PC) to add data flow analysis.
- jwrallie 1y agoEverything 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.
- yummypaint 1y agoMost 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 1y agoI 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?
- sceadu 1y agonot 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 https://www.youtube.com/watch?v=KZeIEiBrT_w also in general bayesian statistics random medium article: https://medium.com/pythoneers/monte-carlo-simulation-ideas-and-examples-for-advanced-day-to-day-applications-447ec3ce9063 https://medium.com/pythoneers/monte-carlo-simulation-ideas-a...
- bobbiechen 1y 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/ 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.
- jshprentz 1y agoDrum cards
- betaby 1y agoLike this https://www.themusicstand.com/Drum-Rudiments-Playing-Cards-p/623629.htm?srsltid=AfmBOorWr-Xsk6kZBjpXOOdfNwHgzsmF1JCV5m0ye3vVvVbhSf2cKMbj https://www.themusicstand.com/Drum-Rudiments-Playing-Cards-p... ?
- jshprentz 1y agoNo. Like this: https://en.wikipedia.org/wiki/Keypunch#Program_card https://en.wikipedia.org/wiki/Keypunch#Program_card
- analog31 1y agoMan, I'm dating myself by admitting that I know what a drum card is.
- MrDresden 1y agoTechnical skills will only take you so far in most orgs. Learn to play the soft game.
- treetalker 1y agoThe 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 --> …
- itsmevictor 1y agoI 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/0735211299 https://www.amazon.com/Atomic-Habits-Proven-Build-Break/dp/0...
- johnfn 1y agoThis is a good one. What's gonna happen if I respond to comments on HN for 1000 days in a row? Uh oh.
- etothepii 1y agoYou will have high reputation and be able to change the background colour, down vote comments etc.
- carlosjobim 1y agoCute women who before didn't give you the time of the day will suddenly start paying you attention, slipping you their phone number, asking what you're up to on the weekend.
- jesterson 1y 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.
- rickcarlino 1y agoGit 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 https://git-scm.com/docs/git-bisect
- benreesman 1y agoAnd interactive rebase. Master interactive rebase and reflog until you can do it blindfolded.
- lanfeust6 1y agoAgreed 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 1y agoIt 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).
- pseudo_meta 1y agoI've only used reflog really to look up a hash and reset back to it. Is there anything else about it one should learn?
- Cthulhu_ 1y agoInteractive rebase is something I use a lot, but I should look into improving its ergonomics; sometimes I just want to apply the current changes to a previous commit. I did have a shortcut / script the one time but it was very finnicky and fragile.
- austin-cheney 1y agoMeasure 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 1y agoThis 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.
- gopalv 1y 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.
- tstrimple 1y 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.
- mrheosuper 1y agoNot 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.
- zigman1 1y agoMy new life motto, thank you very much! You just made a stranger's day better
- spcebar 1y agoI'll add, from Soul of a New Machine, "Not everything worth doing is worth doing well."
- tptacek 1y agoAlways have a stack of deli cups handy.
- bravesoul2 1y agoMake use of L1 wetware cache by learning how to do common things and dont make AI do them.
- moralestapia 1y agoShip, even if it's crap.
- penguin_booze 1y agoTo a friend but not to prod.
- mixmastamyk 1y agoEnvironment 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
- aghilmort 1y agoread something new every day before going to bed journal before you start your day buy some sort of electric kettle
- sakesun 1y agoI won't be able to have enough sleep then.
- davewasthere 1y agoThe 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?
- deleted 1y ago[deleted]
- aghilmort 1y agointern suggested years ago and now electric kettle pretty much first thing buy anytime stay somewhere longer than a couple of weeks if doesn’t already have
- deleted 1y ago[deleted]
- swader999 1y agoScala
- lagniappe 1y agoCIDR
- brcmthrowaway 1y agotmux
- penguin_booze 1y agoman tmux
- scarface_74 1y agoLearning 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.
- cindyllm 1y ago[dead]
- tjmc 1y agoEasy 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 1y agoOne 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 1y agoAlso 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.
- gaws 1y agoIs there a way to prevent "uncropping"?
- sureglymop 1y agoI am not sure as I mostly use android. Perhaps there is an app to help with that. On android, I use an app called Imagepipe[0] as the default app for sharing/opening images. It crops images destructively and removes exif information. [0]: https://f-droid.org/en/packages/de.kaffeemitkoffein.imagepipe/ https://f-droid.org/en/packages/de.kaffeemitkoffein.imagepip...
- AnonC 1y agoMake 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 1y ago
- thebeardisred 1y agoA shell script has to start with "#!" with no spaces before it. I spent about a week figuring that out 25+ years ago.
- ramses0 1y agoSimilarly, it's `XXX=123`, and cannot be `XXX = 123` or `$XXX=123`. Shellcheck (and Wooledge) are crucial!
- procaryote 1y agoTechnically 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)
- david422 1y agoWhen 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.
- bozhark 1y agoExactly, calculate total cost of loan vs. cost of purchase
- mitthrowaway2 1y agoWhat do you do when the people you're bidding against don't understand this?
- hintklb 1y agoit'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 1y agoAn 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.
- kylebenzle 1y agoGrow plant on plastic! I fought it for years but now ALL my crops are under black plastic every year and it's made all the difference.
- tibbar 1y agoYou 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 1y agoWe should all play Chess690 so we don't have to waste time learning openings, right?
- laserlight 1y agoChess960 is even better.
- Ericson2314 1y agoah oops I meant that, I didn't know there were two.
- laserlight 1y agoI'm sorry that my deadpan delivery didn't work :) There aren't two, to clarify. There's only Chess960.
- Ericson2314 1y agoOh I googled too quickly and didn't realize it was auto-correcting me implicitly, and thought there was both!
- red369 1y agoI had the same experience, except it wasn't my first year playing. It was my entire childhood and for years afterwards whenever I'd casually play someone (I still only play casually, just less casually now). Only recently did I decide to learn the good and bad moves for my favourite openings. It can be much more fun that it sounds. Instead of only memorising, you can play with a chess engine and see, and hopefully internalise, why a move is bad or another move is better, e.g. stopping that pawn moving forwards any more is more important than getting a knight out. And you can start with just a few openings - your favourite opening for white, and for black, just your favourite defence to each of the common openings.
- 01HNNWZ0MV43FF 1y agoAlways 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.
- undebuggable 1y agoImport 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.
- procaryote 1y agoOh 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.
- godshatter 1y ago"Just fix the first error in the list" greatly reduced my anxiety about pages of errors being kicked out when compiling a C program.
- 65 1y agoIf 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.
- gaws 1y ago> Include the price of shipping in the price of the product. Shipping varies by location. How can you accurately account for that in the price without losing money?
- hintklb 1y agoUnderstanding 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).
- mvdtnz 1y agoIt's really sad when you hear about people living this way. Life isn't about profit maximisation.
- aspanu 1y agoAs 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 1y agoThanks 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 1y agoDon'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.
- vishnugupta 1y agoMaking sense of probability and statistics and incorporating them in day to day life.
- quantdev1 1y agoDo you have any examples of ways you incorporate them into your day-to-day?
- vishnugupta 1y agoDistribution of data is something I use the most. E.g., For understanding compensation for different job families I used to just look at the market salary range. Now I dig into the distribution. I am now more confident when I make an offer at a given percentile. On a similar topic, someone says that a farmer here (in India) is making multiple of a typical SWE salary. I go back to distribution. Or take quality of specialized food in cities (e.g., Biryani in Hyderabad, Dosa in Bangalore). When someone says Biryani in Hyderabad is great I now realise what it means. That the quality distribution of Hyderabad Biryani is to the right of Biryani in Bangalore i.e., the top 10% of Bangalore Biryani overlaps with bottom 10% of Hyderabad Biryani. It also means that I can walk into a random restaurant in Hyderabad and be confident that Biryani there will taste mind-blowingly better than Bangalore.
- chthonicdaemon 1y agoMost 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.
- pydry 1y agoAlso half of those people will "tell" you what you need to build and you need to work backwards from there to figure out what their actual problem is before working forward again to figure out what you actually need to build.
- scruple 1y agoDealing with this at work right now. A newly promoted lead is struggling to delegate and all of the work coming out of his team right now is instructions on how to do what they believe they want. Very frustrating!
- sumtechguy 1y ago> Most people really cannot tell you what they want in any reasonable way. But build them something and suddenly they know exactly what they want and what you built isnt it.
- snowwrestler 1y agoThis is the origin story of agile software development. You can’t avoid building what they don’t want, so might as well do so as fast and cheap as you can.
- sumtechguy 1y agoThen the flip side is 'oh i love what you built' uhh wait a min that was an utter rubish version. 'no no no its great'. now you are kind of stuck with it.
- hintklb 1y agoRealizing 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
- deleted 1y ago[deleted]
- nothercastle 1y agoThere 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 https://rationalreminder.ca/podcast/323
- hintklb 1y agoYou 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
- nothrabannosir 1y 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!
- jimsojim 1y agoExcellence 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.
- duckkg5 1y agoThis 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.
- smokel 1y agoI 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 1y agoIt is probably not universal. Whole point, I guess, is it should be (much as excellence itself, by the way...)
- 1718627440 1y agoI think it does when the understanding follows couriosity.
- ramraj07 1y agoI'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 1y ago
- tootie 1y agoYou 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.
- sagarpatil 1y agoClaude 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.
- kevinqi 1y agoduplicate code is not that bad. reduce duplication over time as you find the common patterns/abstractions, instead of trying to build abstractions too early
- gwlperl 1y agoYes.
- ipnon 1y agoDuplicate 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."
- kevinqi 1y agointeresting, I didn't know that corollary. sounds about right though.
- aitchnyu 1y agoHave you set up a copy paste detector that fails the build if you write too many duplicates?
- socalgal2 1y agoMaybe 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.
- roncesvalles 1y agoMost of the shitty code I've seen has been from poor attempts at reducing code duplication, usually resulting in some overfitted generalized solution or abstraction. Efforts to reduce duplication should be focused on chunking out reusable pure functions. Trying to dedupe the flow of logic is almost always a fool's errand.
- jcgrillo 1y agoLearn 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.
- deterministic 1y agoThat 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.
- Minor49er 1y agoYou must be my former colleague whose behavior convinced me to quit my job
- leoh 1y agoThis is wild, you may really benefit from engaging with a therapist.
- jcgrillo 1y agoIt's not all that wild, just an observation that narcissists and sociopaths tend to excel at navigating the corporate ladder. Doing good work is not (usually) rewarded, self promotion and taking credit for others' is.
- deterministic 1y ago1. 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 1y agoI 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.
- deterministic 1y agoYep agree. Good point!
- commandersaki 1y agoIt's easier to tell the truth then maintain a complex web of lies.
- saaspirant 1y agoAlso you don't have to remember your lies if you tell people the truth
- prashantgupta24 1y agoPersistence > skill.
- barrell 1y 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 1y agoI 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 1y agoTo 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 1y agoYes, 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.
- ta12653421 1y agoThe right question would be: "Would you have been able to invent the smartphone if you had made the same experiences and insights as Jobs did"? Because, a lot of people like jobs had similar experiences in the early days, e.g. Palo Alto Research Lab around them - though, it was Jobs who came up with the idea, not any other of the SC veterans :)
- vannucci 1y ago
- KingOfCoders 1y agoDelegation.
- m463 1y agogood 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
- motorest 1y 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 1y agoThat'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.
- fmbb 1y ago
- Eduard 1y agoIt 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.
- cluckindan 1y agoWhy not `… | cut -f1 -d ” ”` though?
- stevekemp 1y agoSpeaking 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}'
- cluckindan 1y agoYet using cut, even with extra piping to tr or grep before, is probably over two times faster than awk, which may or may not matter depending on what you’re doing.
- efrecon 1y agoBecause awk understands "columns" better. echo '999 888' | awk '{print $2}' prints 888
- cluckindan 1y agoHow is that different from echo '999 888' | cut -f2 -d " " except for the default delimiter being space for awk?
- ropable 1y agoThat 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.
- bacon_fan123 1y agoYou dont change through motivation, rather through your habits
- treetalker 1y agoA 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.
- socalgal2 1y agoI'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.
- kaffekaka 1y agoNot 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 1y agoOne 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 1y agoI 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.
- bionsystem 1y agoI do bowling now and read your post as if you did as well :) Completely pointless and quite fun too.
- edoceo 1y agoIf you're looking for a game with a point, try darts!
- garrickvanburen 1y agoOr Kubb! It has a high silliness factor
- deleted 1y ago[deleted]
- Minor49er 1y agoMy 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
- aitchnyu 1y agoI 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.
- leoh 1y agoAmen, first thing I always do in a new GitHub repo is disable merge commits.
- socalgal2 1y agoSince 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.
- postit 1y agoIt’s not about skill and knowledge, but networking and visibility
- augment_me 1y agoTemporary 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.
- lazyasciiart 1y agoAlso, 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!
- noreplydev 1y agoold codebases are always, plenty of these
- fmbb 1y agoAll successful code bases have this ”problem”. You become successful by making priorities. All parts of your product do not need to be perfect.
- mettamage 1y agoOh damn. I guess I've learned something. Thanks :)
- bdcravens 1y ago16 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)
- muzani 1y agoGet 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.
- alper 1y agoIs it better than Cleanshot?
- muzani 1y agoNo idea. I got Shottr and it was just right. If Cleanshot doesn't have enough, then maybe give it a shot.
- chamoda 1y agoFor 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'"
- marliechiller 1y agoIs this advice also for mac users? If so, whats the benefit to using this over the built-in screenshot tool?
- Bjartr 1y agoOn Windows WinKey+Shift+S opens a snapshot tool that lets you click+drag over part of your screen and puts it into your clipboard
- snowwrestler 1y agoChrome has powerful screenshot options built in. Open the web inspector, choose “Run command”from the dot menu, and then type “screen” to find those commands. Full-height screenshot is particularly useful.
- 1y ago
- BilalBudhani 1y agolearning the crux of > Hard conversations, easy life. Easy conversations, hard life
- sriram_malhar 1y 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 1y agoDry 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 1y agoIt 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.
- procaryote 1y agocontrol-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
- jwrallie 1y agoescape + . for repeating the last argument from the last command There are other commands to grab other arguments [0]. [0] https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command https://stackoverflow.com/questions/4009412/how-to-use-argum...
- elevaet 1y agoName things well when writing computer programs.
- shafyy 1y agoThere'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.
- 0x737368 1y agoVery relevant to most advice one finds on HN
- defraudbah 1y agohow did you make your comment in gray?
- apples_oranges 1y agoGray means the comment was downvoted
- noreplydev 1y agodamn
- alexey-salmin 1y agoOnly when you're viewing it from US, in other regions it looks grey
- shafyy 1y agoSick burn
- rambambram 1y agoThanks guys, this was the best read of the morning.
- apples_oranges 1y agoIn programming however, the skill and foundational understanding varies greatly, and while everyone is cooking with water, there are big differences how you cook. :P
- pyzhianov 1y agoFinding 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
- deleted 1y ago[deleted]
- suchoudh 1y agoI 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 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=NewStudents 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)
- boccaff 1y ago>2. be very careful when using rm command (use alias rm='rm -i' ) and treat mv/cp/rsync like rm
- scruple 1y ago> 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 ) Your backups are only as good as your ability to restore them (under pressure).
- FinnLobsien 1y agoMost 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.
- jeremyscanvic 1y agoWriting 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.
- bluecalm 1y agoI 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.
- theshrike79 1y agoRule #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 https://users.ece.utexas.edu/~adnan/pike.html [1] https://news.ycombinator.com/item?id=24135189 https://news.ycombinator.com/item?id=24135189 (HN Discussion from 8/2020)
- leoh 1y agoThis is such a good one and I have wondered for years where it came from. Thanks!
- pydry 1y agoDamn. I would have written the exact opposite. Moreover, it is counter intuitive, too. The instinct of most juniors is to build foundations first and it took me a long time to learn to do the opposite. Each layer serves as a customer for the layer above. If you havent figured out what the layer above needs precisely by building it you're probably going to provide the wrong thing to it in the layer underneath if you write it first. It's also more resilient to requirements mistakes and requirements changes - it's easier to change course on a feature after showing a UI to a stakeholder if you didnt build the lower layers.
- pif 1y agoConcerning 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 1y agoAnd 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.
- zwnow 1y agoThat people in the industry barely code, its just stitching together 3rd party dependencies.
- HarHarVeryFunny 1y agoThere are some jobs like that, maybe especially in areas like web development, but obviously it depends on what you are building. If you are working in areas like embedded programming or robotics, for example, than obviously you are more likely to be mostly coding from scratch, even if there are libraries that you may be using.
- zwnow 1y agoYea makes sense, its also a total normal thing to use packages from people who are way more versed in a specific problem you are trying to solve. Just takes away the whole magic of building things for me.
- cjfd 1y agoThere 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 1y agoCounterpoint: there are many things that are interesting to do. Explore and learn from them.
- block_dagger 1y agoIt 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.
- sgt101 1y agoFind 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.
- Pinegulf 1y agoMore of a work-culture thing, but really useful: First you fix the problem then you look for the culprit and administer punishment if it's needed at that point.
- becominghim 1y ago[dead]
- UmGuys 1y agoThe best programming advice I was ever given was given to me before I started while I was in college. It took me too long to appreciate how strong it made me. KEEP AN ENGINEERING JOURNAL. Keep it somewhere you have access to outside company property and update it daily with what you worked on learned. Bonus: take notes in every meeting. Also: how to make bad co-workers hate you.
- mercenario 1y agoCould you expand on it? What are the benefits, what have you gained by doing this?
- UmGuys 1y agoIf you keep a journal of what you work on and learn each day it reinforces the concepts so you remember better. And you can use it for reference in the future. This is extra important for juniors starting out when everything is new. Taking good notes will accelerate your growth. It helps develop an understanding of the context you're working in faster. Here's an example: the first time you learn a design pattern you can create a journal entry about that pattern with some psuedocode. Then next time you want to build something using that pattern, you can look at your journal. Even 10 years down the line and 3 companies later. Does that help?
- mercenario 1y agoThanks. I was wondering if the benefit was on just writing by itself, randomly rereading it with no purpose, searching for something specific, etc. I've tried journaling before but I would rarely read it for anything. This is something I want try again.
- sklargh 1y agoA few big corporate things. These do not apply to small firms. They may apply to certain middle market shops. Nothing revelatory, just hoping to help a “me” at 21. 1. For large corporations the most appropriate governance analytical model is usually a feudal state and you can think of business units like manors. 2. Over the long run, proximity to revenue is usually a good proxy for survival. 3. Most people just want to do their job, feel good about themselves, and go home. 4. All things being equal, if people like you, you are far more likely to advance than if they do not like you.
- augment_me 1y agoDocumentation is the most valuable if it captures the design decision and intention at the time of the creation of the software, rather than the functionality of the software itself. Its pointless to write "This function splits the input data into two equally sized chunks, multiplies each chunk with Y and then adds it together" It makes more sense to write "The hardware X that this code runs on has a cache size of Y which makes this split necessary for optimal compute throughput". This provides the next person an understanding of why the code looks as it does, and if it should be changed at this new moment in time, when perhaps new hardware is available. I have seen so many design decisions being forgotten with time, and despite "documented code", a new engineer comes in and spends weeks trying to solve something that it inherently correct or is there for a good reason.
- dmos62 1y agoI think of this is answering the questions of what vs why. When what is being done is self-evident, that's readable code. When why it's being done is evident, that's good documentation. And, you need both.
- alexpotato 1y agoExcellent points on documenting the intention and design decisions, not just the "what". I also use the following metaphor using an airplane: There are three types of documentation: 1. 800 page manual with page 1 being "Congratulations on purchasing your 747!" 2. 10 page "How to change the oil in the engine" 3. 5 item checklist "How to deal with a fire in the engine" Too many people think documentation is just one of the above. And if you are a developer, #1 feels overwhelming to write but the SREs may only want #3 (and may even help you write it).
- percevalve 1y agoAgreed. I remember hearing very good talk from someone working on Django documentations that was very close to what you describe. Cannot find the reference to the talk, but indeed this is how the documentation is organized: https://docs.djangoproject.com/en/5.2/#how-the-documentation-is-organized https://docs.djangoproject.com/en/5.2/#how-the-documentation...
- deadbabe 1y agoComputer Programming is just turning data from one form into another. If you focus on the data structures you need everything else becomes fairly trivial.
- blueflow 1y agoReading documentation. Knowledge transfer, both receiving and sending, is the most essential skill in engineering. Without it, institutional knowledge will be lost over time and end up inaccessible to mankind.
- ChrisRR 1y agoLearn to debug efficiently. Don't just keep testing every little possibility just in case it's the one thing that's wrong, but try to test things which narrow the scope of your search instead It applies to both software and electronics
- seidleroni 1y agoI work in embedded systems, and the best advice I can offer is: resist the urge to speculate when problems arise. Stay quiet, grab an oscilloscope, and start probing the problem area. Objective measurements beat conjecture every time. It's hard to argue with scope captures that clearly show what's happening. As Jack Ganssle says, "One test is worth a thousand opinions."
- fedeb95 1y agothis works also in general purpose corporate programming.
- teiferer 1y agoImplicit or explicit, you need a hypothesis to be able to start probing. Many issues can surely be found with an oscilloscope. Many others can't and an oscilloscope does not help in any way. It's experience that tells you which symptom indicates which class of issues this could be, so you use the right tool for debugging. That's not to say that at some point you don't need to get your hands dirty. But it's equally important to balance that with thinking and theory building. It's whoever gets that balance right who will be most effective at debugging, not the one with the dirtiest hands.
- jdhwosnhw 1y agoI thoroughly disagree with this sentiment. In my experience, the most helpful approach to performing RCA on complicated systems involves several hours, if not days, of hypothesizing and modeling prior to test(s). The hypothesis guides the tests, and without a fully formed conjecture you’re practically guaranteed to fit your hypothesis to the data ex post facto. Not to mention that in complex systems there is usually 10 benign things wrong for every 1 real issue you might find - without a clear hypothesis, its easy to go chasing down rabbit holes with your testing.
- seidleroni 1y agoThat's a valid point. What I originally meant to convey is that when issues arise, people often assign blame and point fingers without any evidence, just based on their own feelings. It is important to gather objective evidence to support any claims. Sounds somewhat obvious but in my career I have found that people are very quick to blame issues on others when 15 minutes of testing would have gotten to the truth.
- alexpotato 1y agoIf you have a giant legacy code base with no unit tests, there are probably 2-3 unit tests you can write that will MASSIVELY improve delivery rate. Example: - owned a legacy system that deployed software to production - there were "deployment windows" for different applications - the "is now time to deploy app X?" logic was a giant rat's nest of if/then statements - AND it used datetime.now() in the function - that meant you had to wait for the window to actually hit to see if any changes worked - changed the function to be can_deploy(current_time = datetime.now()) so you could pass in a time - meant we could add unit tests - changes to the logic went from taking two people 45 minutes hand tracing to <30 seconds I tell this story whenever people say "I don't have time for unit tests!". I think they mean "I don't have time to write an entire suite of unit tests" which might be fair. But there is ALWAYS time to write a couple key tests.
- Joeboy 1y agoYou could also do this with freezegun or time-machine without changing the function signature. Although I guess your way is less off-putting for people who don't like tests.
- fedeb95 1y agodon't always feel forced to express your opinion.
- chilmers 1y agoAlmost any task on a software project that you need to is worth doing as a script, if at all practical. Unless you are really, _really_ certain that it will be 100% a one-off, then writing and committing a script to do it will almost always save you and the rest of your team pain in future.
- nicman23 1y agojust start with something. you are always gonna have to do it twice and you are not going to know every edge case or usage pattern off the start.
- malwrar 1y agoThis one took me years to develop: build minimal demos with all new technologies you want to use in a new project, _then_ begin thinking about how you’re going to build your project. You need to understand how a tech works and _if it even works the way you think it does_ before you use it. Otherwise, you’re gambling on hope and overconfidence. Maybe I’m just dumb, but I always find that learning new tech while simultaneously trying to build with that new tech usually ends up in me rethinking the project repeatedly as I learn new tricks and techniques. I’ve dropped projects that I realized were too ambitious or just weren’t evolving right after months, years of effort. I’ve since learned that building needs to feel more like assembly than fabrication. You can dream, but it shouldn’t leave the whiteboard until _all_ of your technical assumptions not backed by experience are resolved into certainty. You move so much quicker and more predictably if you can predict success.
- deleted 1y ago[deleted]
- rorylaitila 1y agoDon't think about the task at hand at all, like don't think about what you need to get done or how you're going to accomplish it, in advance. This creates anxiety. Just think about how good the end goal will feel to have done. Virtually eliminates procrastinating and analysis paralysis.
- 762236 1y agoHow to exit Emacs
- wanda 1y agoSaying no.
- padraigf 1y agoDon't worry about impostor-syndrome (everyone has it). It seemed like around the time I was graduating college, there was this kind of culture of hotshot programmers, which looking back was kind of toxic. It was all this "he's good", "he's not good", and it kind made you afraid to admit you didn't know things (for me anyway). And for a long time I went around with this imposter-syndrome, thinking I should know everything (and knowing that I didn't). And now, with a bit more experience, I realise, not-knowing is the default. Things change so quickly, no-one can know everything. One person might be better in one area, a different person in another. There is no absolute ranking. Better to admit this. We're all continual learners.
- pbamotra 1y agoFirst, Lean into pain Ofcourse not every time is the right time to lean into it but every once in a while do “that” thing. Many people don’t realise their potential or just get too complacent. If there’s not one thing that put your mind into what-ifs spiral, you’re not pushing yourself hard enough. Second, if you must distill life into absolute minimum - focus on relationships, health, and career. Don’t make excuses to yourself or others in either of these.
- mrweasel 1y agoWeird one for me, also not really a trick, I just never really thought about coding in that way. A former colleague showed of some code and it was completely reversed from how I'd write. The code uses a library, which provides a number of classes. Rather than encapsulating those classes within his own code, he'd simple use them as base classes and overwrite and extend a needed. Again no tricks, but basic OOP, but I just never really considered doing it like that, but it saves a ton of code.
- deleted 1y ago[deleted]
- deezmofonutz 1y agoPutting the kabosh on GenZ’s ridiculous individual & management contributions.
- Gud 1y agoTake a nap
- closeparen 1y agoI used to puzzle over the limited information at my disposal and make trial-and-error code changes to solve a bug. Now I put all of my effort into getting the relevant information about what's actually happening in situ. It's dramatically more effective.
- hypertexthero 1y agoWhen playing guitar, instead of gripping the neck tightly as if your hand was a vise, grip it lightly and pull the neck toward your body instead. Make sure the action of your guitar is not too high; if it is, get it adjusted. Listening is more important than talking, but don’t automatically believe what you hear. Find out for yourself. Observing animals and plants can teach one about humans and living in harmony with nature’s cycles. Some people are not capable of feeling empathy. Learn to recognize them. Your initial intuition is often wrong about numbers and statistics and many things, even if you are an expert. Double check. Triple check. Discuss with others you trust. A little at a time goes a long way (understanding compound interest). Certainty leads to insanity (regarding the “trade” of life). References: - The Creative Act by Rick Rubin - The Listening Book: Discovering Your Own Music by W. A. Mathieu - Braiding Sweetgrass by Robin Wall Kimmerer - The First and Last Freedom by Jiddu Krishnamurti - The Psychopath Code by Peter Hintjens - Thinking, Fast and Slow by Daniel Kahneman - Fingers Pointing to the Moon by Jane English
- Joeboy 1y agoI'll add that I spent decades not learning to set up a guitar properly or acquiring the tools to do so. It turns out it's not nearly as difficult or expensive as I feared. To be fair it's a lot easier now than when I started, with youtube tutorials etc. In particular, I now own a string height gauge, which was very cheap and makes the action assessment more empirical.
- hypertexthero 1y agoA tuner, either built-in or stuck to the guitar is also very helpful. Recommended to anyone starting to play. If you stick with it eventually you learn to tune the instrument by ear.
- doppelgunner 1y agoYou can just ask people things. Like, with words. Out loud. Turns out “sitting in silence for six hours trying to guess the spec” is not a required rite of passage.
- doppelgunner 1y agoFor all those obese/overweight people who wants to change: If you want to complete intermittent fasting or control your diet more easily, use water. When hunger strikes, drink water first. It helps reduce cravings, keeps you full, and resets your focus. Since water doesn’t convert to calories and just passes through your system, it won’t break your fast. Most hunger is manageable if you stay hydrated — water becomes a tool, not just a drink.
- doppelgunner 1y agoFor people like me who can't find what they want out of life: When you feel like everything is falling apart — like rejection, failure, or hopelessness is too much — pause and imagine you're about to die in this very moment. Everything fades. Suddenly, all the pressure, shame, and fear lose their grip. What really matters becomes clear. You’re still here. You still have a chance to move forward, even if it’s just one step.
- nicbou 1y agoNetworking! It's ridiculously effective, and fun! I never quite grasped what it meant until I experienced it. It's basically just business friends. You help each other informally, without contracts or invoices. You think of them and they think of you, and generally you both come out ahead. It's barter with intangible goods.
- gaws 1y agoNetworking is the only way to climb the career ladder.
- helph67 1y agoBeing aware of the Pareto principle can provide positive advantages to most parts of life. https://en.wikipedia.org/wiki/Pareto_principle https://en.wikipedia.org/wiki/Pareto_principle
- canerdogan 1y agoWhen I first started trying to build games with LLMs I did what almost everyone does at the beginning. I went straight for a one-shot prompt to make a complete game. Just like many others, I expected the model to almost read my mind. I imagined it would somehow capture all the little connections and decisions happening in my head in a fraction of a second just from a few lines of text. Of course, that is not how they work. After some time I began to understand the mechanics of how LLMs operate on a deeper level. That naturally led to the now fading term “prompt engineering”. These days people talk more about “context engineering” but the core idea is the same. We have to teach our own brain how the LLM works so we can structure the context in a way that lets it deliver maximum value. With my current work on GameByte, where AI builds studio-quality mobile games from prompts, this understanding has become crucial. When you explain the problem in a way that matches how the model processes information, even something as short as “3D platformer game” in the system prompt can be enough. The model will then ask the right follow-up questions and move you toward your goal without constant manual steering. Another lesson is that all the old pain points developers faced before AI are still pain points for LLMs. Spaghetti code, excessively long files, poor documentation, lack of comments and missing test cases all reduce their effectiveness. This is why Amazon’s recent “Kiro” and the spec-driven development approach resonate so well. They are basically formalizing best practices that those of us building with LLMs have learned over time. And finally, LLMs do not particularly enjoy editing someone else’s messy code. Just like human developers, they perform much better when writing from scratch. If you clearly define the boundaries of the task and ask them to start fresh, the results are often significantly better.