Live data from Hacker News

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

news.ycombinator.com

381–390 of 532 posts

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

#381
fzf.

Anywhere you want to find something, but particularly find something and do something with or to it, aliases or small scripts or plugins using fzf are great.

No specifics because I think it's a great Unix-spirited 'one thing well' and it's better to implement what works for you around it yourself, but I use it in: vim (filenames, file by contents, buffer names), password management, several git aliases for running commands with either a fuzzy found SHA or file, and more.

I was going to leave it at fzf, but as a bonus - bat. Use it in fzf previews, to see, with syntax highlighting, what you're selecting before you select it.

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

#382

Earlier quoted context omitted.

Hence my love for ReasonML / OCaml with the Bucklescript compiler.

Do you use ReasonML on the backend as well? Or just something like ReasonReact? I've been interested in Reason and still wondering the best way to work it into my NodeJS/React/Typescript stack.

I am not parent comment's author, but I use TS on the backend and I did look into ReasonML. I love most of Reason's syntax and FP in general, but unfortunately, reason/bucklescript ecosystem just isn't mature enough for a serious project. I'd recommend against using it unless you are in some megacorp and you can afford to build general-purpose tooling.

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

#383
post #93

Earlier quoted context omitted.

I can touch type but can't get much faster than 60-70 WPM. I've been practicing for years. Any tips for speed?

Been on a compy since I was a toddler. 100 wpm when no-look-pecking, 60 wpm when no-look touch typing. Feels weird man. xD Also, I have a friend who used to be a court typist. Does zero coding. Borders on comically-computer-illiterate. Types like 170 wpm. So jealous. Such a gift, so wasted.

Why do you think writing so many words per minute (170) is a gift?

We have autocomplete for writing code that is likely more of a speed improvement than cramming out "words".

I would think it gets to a point where wpm doesn't matter since you've likely to stop and think about the logic etc.

I can see how it would help for emails and more generally.

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

#385
Over the past ~half year I gradually established a workflow consisting of a simple directory structure, a handful of bash-aliases and chromium profiles. It looks like this:

Each project gets its own directory somewhere in my $home with some subdirs. There might be various others specific to the project-domain, but these are the most common:

notes/ contains plaintext files of everything i write down. File-name structure is :, e.g. 2020-05-09:call (:call are the most typical ones). As others have also suggested, I take a lot of notes for record keeping & plannning purposes.

workspace/ contains all source code repositories, or other files necessary to work. Pretty much anything I might touch while coding.

auth/ for things like ssh public keys used on the project

downloads/ Project-specific downloads.

Then I create new entries in my ~/.bash_aliases that "get me" right into the coding-env of a project. Say I work on a python project, I might have an alias that looks sth like:

  alias fb='cd ~/fooproject/workspace/foobot && echo "loading virtualenv..." && source .venv/bin/activate';
On of my current side-projects is a full-stack clojure(-script) app with these aliases:

  alias foh='cd ~/opendecks/workspace/foh';
  alias fohj='cd ~/opendecks/workspace/foh/src/clj/opendecks/foh';
  alias fohs='cd ~/opendecks/workspace/foh/src/cljs/opendecks/foh';
First one gets me into the the source-root of the project, the other two into respective sub-paths for back- and front-end. These aliases allow me to immedeiatly "jump into a project" from any open terminal.

Lastly, I started employing chrome/chromium's user-profiles to seperate browsing for each project. This isolates work-related browsing from my personal activity (cookies, logins, passwords etc), and provides a nice cognitive barrier against procrastination. I'm not logged into any social networks on those work-profiles and switching to my private profile to browse facebook is a more concious act than opening a new tab in the current window. Each browser profile is set-up to save all downloads to the project-specific `./downloads` directory, again not to mingle (potentially confidential) resources.

I haven't automated any of the above steps, because it's so simple and takes me at most 10-15 mins to create a new instance. This has worked really well for me so far, because it clearly seperates almost all resources associated to a project, while being friction-less in tooling/switching between workspaces (versus e.g. waiting for a VM or docker instance to start). Another nice side-effect is that I can easily archive or clean-up past projects.

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

#386
Use Makefile, Readme and .env files more effectively (mainly to avoid WTF moments when you don’t remember why you did something when you did it).

I am not good at remembering commands particularly when you have to deal 10 different technologies (Kubernetes, Docker, Framework specific stuff) so create some standard wrapper functions as make shortcuts and document them in Readme.

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

#387
post #332

Earlier quoted context omitted.

Alternatively, if you don't care about having an audience, you can just do private livestreams directly to YouTube via OBS. After your stream is concluded, it saves the livestream as a VOD. With this method, you don't have to worry about storing large video files when recording yourself. Also, because it's YouTube, you inherit all of the benefits YouTube provides. You get the added benefit of having closed captioning…

I also considered this in the past but sometimes, I slip into procrastination mode unintentionally and might check my bank account (or pornhub) once in a while. So thinking my video is uploaded to somebody else's computer gives me the shivers.

Have a user account just for streaming. Then you can block any sites that you don't want shown.

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

#389

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 h…

i personally love partial staging/commits but haaate ’git add -p’. i use tig and a few other partial staging user interfaces. learning how to stage part of a line, in a favourite code tool, is a skill i appreciate for myself

I'd really like to know how you use tig for that. I am overwhelmed with the options and keystrokes that I can't remember.

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

#390
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…

Same realization here, but from JavaScript to Rust. I'm still a bit more productive in JavaScript but I now regard it as technical debt to be rewritten in TypeScript/Rust as soon as possible.

What kind of systems are you developping with rust? Especially if you also do javascript? Genuinely curious as I also want to start working with some lower level languages.
Post reply on HN