Live data from Hacker News

Ask HN: What are your favorite developer-efficiency tips?

news.ycombinator.com

251–260 of 532 posts

Re: Ask HN: What are your favorite developer-efficiency tips?

#252
post #204
post #164

I consider scripts to be functional documentation, so I write a lot of them, usually shell scripts but Ruby and Python, too. Any task that I might want to perform again, or tasks for someone else, gets a script if possible. All of my repos have a /scripts directory. It can take some work to write and debug but in the end when it's working you know you have correct "documentation". Text and wiki documentation may look…

I've found recently that Makefiles are my best friend for this kind of thing, even if it's just wrapping existing commands with the right arguments and conventions for the project. Being able to do a simple `make build`, instead of remembering all the right command syntax, repositories etc is so much nicer that having to trawl through a README in a couple of months time for how I was using this thing

+1 I've been using makefiles more and more. And the nice thing is, if you don't have hidden dependencies you can just do a make -jn and get parallelism.

Re: Ask HN: What are your favorite developer-efficiency tips?

#253
Learn how to use git's partial commit functionality `git add -p`, `git checkout -p`, `git reset -p`, etc.

Also get comfortable with rebasing. The most foolproof formula I've found is

   git rebase -i  [--onto ]
Using the two of those together, you can clarify your commits and have code that is actually reviewable rather than stream of consciousness spaghetti commits.

Makes reviews more pleasant and looking back through history more useful.

Also learn to use `git log -p` to look through the change history of files. Immensely more useful than `git blame`.

Re: Ask HN: What are your favorite developer-efficiency tips?

#254
post #205

Earlier quoted context omitted.

I'd love to subthread hear from people if alternate keyboard layouts have made a difference. ?

I've used Dvorak for the past few decades. As suggested by one of the other comments, it took about 2 weeks to learn well enough to get back to my normal speed (>80wpm). It makes a massive difference in comfort. 5 minutes typing at full speed on QWERTY and my wrists start to hurt. (I really don't know how people do it.) On Dvorak, I can type all day at full speed with no pain at all. Surprisingly, the keyboard hardwa…

> 5 minutes typing at full speed on QWERTY and my wrists start to hurt. (I really don't know how people do it.)

Wrist-bending to maintain the home row, I suspect. I have a different, self-taught style that partially involves holding my hands above the keyboard and using muscles all along my arms to move my hands without bending my wrists much - never had any problems.

Re: Ask HN: What are your favorite developer-efficiency tips?

#255

I keep two diaries, both MS Word documents. In one, I write summaries of what I read about -- papers, blog posts, books, and articles that interest me, along with the google search term, authors, URL, quotable quotes etc. In the other, I put together a free-form running log of projects I am working on, along with feature ideas, benchmark results (and the parameters used to get it),etc. Why MS Word, you ask? I am ordi…

Have you tried notion? Supports a lot of what you like about MS Word.

Re: Ask HN: What are your favorite developer-efficiency tips?

#256

Earlier quoted context omitted.

The first thing I do for every project is set up a development blog. Hugo + a nice free theme + Gitlab Pages + Netlify CMS. Everything is contained in Gitlab and I can keep the Pages site private and only accessible by members of the repo. It is less of a daily log and more exploring "issues" - basically anything I took time to research and figure out. I'm very adamant about recording details like dates, version numb…

I love this. I have a grouping of pages in Notion for tech notes. But I really like the idea of scoping it to a project. I like that you don't need a local repo. I'll have to experiment with this. Have you automated anything for it? And do you have any patterns you use (eg. organizing the information, etc). Thanks!

There's really not much to automate. The Gitlab CI/CD config file to build Hugo and publish to Pages is always the same so I just re-use it as boilerplate. Likewise the Netlify config is usually the same as well, so once you've learned that syntax and structure it's not much work to put in place. I always like to peruse the latest Hugo free themes before I start and I usually end up using a new theme for each site anyway. The only real patterns in terms of organization is making sure I categorize and tag each post in a detailed manner. Most issues are related to a certain piece of the project or tech used, so when you know for example that your issue is related to the database then you can look at all posts categorized or tagged in a similar way to see if you already addressed the issue. I do find the most helpful step I took was making sure the post had a nice meaningful title with the proper keywords - that helps keep you from reading multiple posts until you find the one you need. Hugo and Gitlab's CI/CD are really great but the open source Netlify CMS is the key to making this setup so easy and remote only.

Re: Ask HN: What are your favorite developer-efficiency tips?

#257
1. Learn a good plain text editor really well. Learn the shortcuts. Learn how to navigate text (skipping words, end/home, etc.) 2. Start using REPLs - saves a huge amount of time when trying to figure out small quips of logic. REPLs are extremely useful whether you’re an artist expert or a beginner. 3. Learn how to setup and use debugging tools. These are often a PIA to get properly working, but you’ll thank yourself later. For example I do a lot of Ruby/Rails and rspec work. Enabling byebug and leaning how to run rspec feature tests with the browser in non-headless mode can solve some really tough bugs. 4. Learn regexes (POSIX). They’re used everywhere and have pretty much identical implementations and syntax between languages; they can help you do anything from performing complex searches to parsing logs to writing your own search engines. 5. macOS: Cmd+` (backtick) lets you cycle between windows of the same application, e.g., all of your Chrome windows. This was a game changer for me. I still see a ton of people not even using alt-tab or using that awful expose crap. 6. Keeping your system “up”: Caffeine for Windows, Insomniax for macOS. One of my biggest annoyances is systems that automatically lock, sleep, or time out, wasting my time and mental energy on logging back in or waking my computer. 7. Taking more breaks and procrastinating. Yes! Procrastinating does wonders for me. Not sure why, but some of my best work is done after goofing off for hours. It’s probably counterintuitive to most of you, but surprisingly I can get more done by spending less time forcing myself to do it.

Re: Ask HN: What are your favorite developer-efficiency tips?

#258

Total commander. For any OS. Is among the 1st 3rd party programs I install regardless if it's a Win or Android or Lin installation I do.

I have used Double Commander a little bit, and I like it so far. Any chance you've used both? What do you like about TC?

Re: Ask HN: What are your favorite developer-efficiency tips?

#259
post #206

The biggest boost in productivity I've had in recent years is switching back to a statically typed language. TypeScript in my case. You can absolutely refactor and change course _so_ much quicker and with virtually no regressions at all. Just the other day we realized a feature I was building didn't handle an important case, and I had to really change the approach. Doing it in a JavaScript would have been dramaticall…

Yeah, TS has one of the most powerful type systems I've come across, with its distributive conditional types and type narrowing logic. Recently I've been using type predicates to "dynamically" expand 'this' in specific clauses.

It's very fun to work with and allows for really safe code.

Re: Ask HN: What are your favorite developer-efficiency tips?

#260
post #42

Have a sharpened pencil and stack of paper handy always. I can't say how many times it's saved me a lot of trouble programming some behavior because I was able to draw a picture of what I wanted it to do.

I am opposite of that. I can't stand paper and pen/pencils, so whenever I need to visualize something it's Paint time. And if I need to note something down it's Notepad time (well, Notepad++ lately).
Post reply on HN