Live data from Hacker News

Ask HN: Which tools have made you a much better programmer?

news.ycombinator.com

181–190 of 519 posts

Re: Ask HN: Which tools have made you a much better programmer?

#182
Sonar: code formatting nagware for Java. I spent a few months being very strict with code style and it has made me permanently a more productive programmer. I used to look at my code and wonder how to improve it, now I know what to do until I'm happy with it. I've learnt to apply this to other languages. Sonar showed me how to make code consistent, that is easier to read, write, grep and work with.

An unexpected result of being anal about whitespace for a few months was productivity with large code bases.

I no longer have Sonar itself in my workflow. But I defo feel that tool made me a better programmer.

This is not really a recomendation for Sonar but a recomendation to go find a relevant code style tool and work with it until it you are no longer learning code formatting and you are learning code clarity.

Re: Ask HN: Which tools have made you a much better programmer?

#183
post #154

Earlier quoted context omitted.

Nice! I create two-letter aliases, it truly helps: gc = git checkout gs = git status etc...

Here's mine: alias g="git" __git_complete g _git # enable git autocompletion (braches, etc.) alias gc="git commit -am" alias gp="git push" __git_complete gp _git_checkout # checkout is more useful than _git_push because it autocompletes the branch alias ga="git add -A" alias gd="git diff" alias gb="git branch" alias gx="git checkout" __git_complete gx _git_checkout alias gs="git status" alias gl="git log"

Good collection! I have many of these, plus a slightly longer one for quick fixups that happen all too often:

    alias gcane="git commit --amend --no-edit"

Re: Ask HN: Which tools have made you a much better programmer?

#184

For me, the transition from Bash to Zsh has been a huge efficiency boost. Mainly because of some great plugins for Zsh, such as z, zsh-peco-history (better history search), zsh-autosuggestions, and zsh-syntax-highlighting. My blog post about setting up a Linux workstation describes this in detail: https://tkainrad.dev/posts/setting-up-linux-workstation/#swi... . The best thing is, there is no initial productivity hit…

For zsh, I highly recommend zsh-histdb, it stores all your commands in a sqlite database, along with data like timestamp, current working directory, hostname, session id, etc...

It has its own "histdb" command but the best part is that it integrates well with zsh-autosuggestions, so with the right SQL query you can make it suggest something "the latest command in the current session that matches, or if not found, the most frequent in that directory".

I know it is controversial because it is not using a text file and UNIX loves text files, but it really nice, and you still have your .zsh-history if you want to.

Re: Ask HN: Which tools have made you a much better programmer?

#185
post #107

Earlier quoted context omitted.

My only beef with ripgrep is that "rg" is only a small typo away from "rm". One time I almost deleted my working directory but luckly I had passed the -i flag for case insensitive search :)

Have you considered creating an alias - such as "rip" or "grrr" - for using ripgrep to help avoid that concern of rg vs rm?

The "rm" thing was only (almost) a problem that time because I had passed a list of files to ripgrep, instead of passing it a list of directories to do a recursive search. rm by default don't erase directories.

But now that you mention it, creating an alias gr=rg sounds like a no-brainer. Thanks.

Re: Ask HN: Which tools have made you a much better programmer?

#186

Earlier quoted context omitted.

There is a paid version of VS Code?

Maybe the person meant to say Visual Studio Code is preferable to Visual Studio.

I feel that Visual Studio Code (a free programmer's text editor) suffers from its poor branding -- it's too easily confused with Visual Studio (a paid IDE), so folks dismiss it out of hand because of the perception that it's not free or is only for MS languages like C# (neither is true). Microsoft should have called it something else.

As a Vim user of 2 decades, I have to confess something: VS Code is a far better programmer's editor than Vim. It's pretty responsive, has seamless (and better) integration with language servers [1] than Vim, has better autocomplete than Vim (due to said language server) and the Vim keybindings are not terrible.

For the first time, refactoring (renaming variables) is easy because the editor now understands the language-specific structure of the code as opposed to the code being treated as a long string. It's possible to attach a language server to Vim but it's fiddly and doesn't work that well.

[1] https://langserver.org/

Re: Ask HN: Which tools have made you a much better programmer?

#187

I'll add two really simple, but also very effective tools. Search: in the form of things like "the silver searcher" ( https://github.com/ggreer/the_silver_searcher ) or "fd" ( https://github.com/sharkdp/fd ). And, Replace: with tools like sed ( https://www.gnu.org/software/sed/ ). These are really simple tools but they are also very powerful. I have surprisingly often needed to change from version X.Y.Z to version A.…

In the same vein as silver searcher, I'd mention ripgrep: https://github.com/BurntSushi/ripgrep

Re: Ask HN: Which tools have made you a much better programmer?

#189
Any profiler.

As a development tool: You can default to writing the majority of your code dumb, terse[1], and straightforward, even if you know there's a clever algorithm you might be able to use, because that way is easier to debug. Computers are fast and N is usually smaller than you think, and when you apply the profiler you'll find out that that the biggest performance problem isn't the thing you were going to optimize anyway.

As a product tool: People are more likely to buy responsive programs. The state of modern websites is so bad that non-programmers will actually comment. Every tester for Space Trains[2] commented on how smooth it is. That's a game, but I've seen the same comments on productivity software I've written.

[1] As in omitting layers, not as in omitting descriptive variable names.

[2] https://www.youtube.com/watch?v=LRJP0tie-30

Re: Ask HN: Which tools have made you a much better programmer?

#190
post #21

Using multiple programming languages. Using Golang has helped me create better data structures, and using C helped me understand linking, using python helped me understand closures, and using Ruby helped me understand that I hate programming.

can you elaborate on ruby? i'm curious to understand your experience with it and what brought you to the conclusion that you "hate programming".

I'm not the original person so I have no idea what their experience is, but I feel pretty much the same. Every time I work in a language other than Ruby, it feels like programming. When I work in Ruby the language feels almost effortless. I wish I could do everything in Ruby and it frustrates me when there is something I can't make work in Ruby. Especially Rails, everything that works works so smoothly. When it doesn't work I get very frustrated and switch to another language only to find out its even harder in another language.

I don't like programming. I like it when the computer does what I tell it to do. I find that drastically easier to accomplish in Ruby (especially Rails).

Post reply on HN