
Ask HN: What are some of useful but little-known tools you use for development? - tzz
Little-known meant little talked about in HN.
======
zo1
Code generation is a big one for me. A nice thing I like doing is defining
"interfaces" for a particular database table, along with the tables definition
in a particular format. Then I can generate any kind of access to that table
I'm willing to spend time on creating a generator for.

I'm still hoping to find a decent "SQL flavor" interpreter and/or translator.
That would be a killer feature, allowing me to define "procs" in vanilla ANSI
SQL, and translate them into whatever database's SQL format I need without
worrying too-much about syntax and optimizing. Because you know, it's 2016,
and I still need to know that fetching N rows of results from a table has
multiple syntax forms depending on your chosen database and version.

~~~
bottler_of_bees
Code generation used to annoy me a lot for some reason, in Java land, I guess
that was back when Ant was used and code generation made the build process a
bit more annoying. Also somewhat rigid.

I wonder if some of the ORM's would get you to a bit closer to the cross-
platform proc. They need to know all of the variances of the db's in terms of
the syntax I guess, but I doubt you'd ever get to a stage of writing cross-db
stored procs that compiled to TransactSQL etc... or whether the effort would
be worth it.

Have you had to do that? i.e. write the same functionality in two different
databases as a stored proc? I guess software vendors might face that. I'd
probably push the logic back into the app code if possible, unless the
amount/processing of data precludes it for whatever reason.

------
seanwilson
Wraith is super useful for web development on existing complex sites and I
rarely hear of it or existing tools. Setup a staging site along with your
production site, list the important URLs and when you run Wraith it'll compare
screenshots of changes between the URLs on staging and production. This lets
you update existing pages and verify you've not broken other pages with only a
small amount of setup.

See [https://github.com/BBC-News/wraith](https://github.com/BBC-News/wraith)

~~~
twunde
Nice, this looks great for regression testing

~~~
seanwilson
Exactly, minimal setup visual regression testing.

------
Jtsummers
tup [0]. It's a build system. Very fast, plays well with git (can
automatically add generated artifacts to your .gitignore file(s)). I only use
it for stuff at home, but it's worked very well for me. A few gotchas and a
bit too esoteric to introduce to my office (make is everywhere, have to deal
with other developers in other companies, migraine inducing IT bureaucracy).
The main thing keeping me from using it more is that most of my home stuffs
(these days) are straight rust and rust has its own build system (with cargo)
that works well enough.

tup only rebuilds the parts that need to be rebuilt. The build files you
produce are dependency trees, it can recognize when a node in the tree hasn't
changed and won't trigger further actions. Consider: You modify the comments
in your .c source file, correcting a typo from "alpabetical" to
"alphabetical". There has been no code change. Make will, without additional
configurations, build the .o file, and then rebuild everything else down the
line to the final lib or exe. tup will recognize, by default, that the .o file
is unaltered, and won't trigger any further action.

tup also has a monitoring system that I intended to port to OS X but got
distracted on. It will watch the filesystem for changes so it doesn't need to
walk the filetree to identify the change when you issue the build command.
It'll already know _exactly_ what has changed and be ready to issue the
(near-)optimal instructions.

[0] [http://gittup.org/tup/](http://gittup.org/tup/)

~~~
Jtsummers
This one is not little-known or little-discussed, but I found org-mode really
nice when paired with tup. I have a small shell script I put in my ~/bin which
calls emacs' org-mode's tangle functions on each of my .org files in a
project. I write everything (at home) as literate projects. Going back to the
nice feature of tup (recognizing that a target file hasn't changed and ceasing
build actions) comes in handy.

My .org files may change, but the .c or whatever files don't as often, or they
do but it's white space so the .o files don't change, etc. It's all in the
documentation or the layout, or changes to the export (as html/pdf) options.
So the whole project doesn't get rebuilt (like it might with make) just
because I added a paragraph describing an algorithm.

It's also great for source code dissection. Using the noweb aspect I can break
a file down from one initial source block into dozens, creating cross
references across files and documents very easily, and then export this in a
distributable format (currently doing this for a new project at work). I have
a 100k SLOC project that we've taken on and while we understand the high
level, none of us have ever worked on this source code (we work at the
maintenance end mostly, this project has entered maintenance). Technically
there's documentation on it. Doxygen can generate nice reports. But that
doesn't beat the act of tearing the code apart line-by-line for really
learning and understanding it.

This'll be the largest project I've attempted this on, so that's a new
challenge. Usually sub-10k projects that I've tried this with, or just small
sections of larger ones. But I'll be one of three guys on the developer side
of this one (one above me, responsible for more than just code, and a junior
dev just out of college with us). So either we fumble or one of us becomes a
SME. This work is also shareable by generating a PDF or set of html files from
my efforts and distributing it to them so what I learn can be more easily
shared with others.

------
itamarst
\- pex is really nice for packaging up Python applications:
[https://pex.readthedocs.io/en/stable/](https://pex.readthedocs.io/en/stable/)

\- Eliot, a project of mine, is a logging system for Python that actually
gives you a concept of causality:
[http://eliot.readthedocs.io/en/0.12.0/introduction.html](http://eliot.readthedocs.io/en/0.12.0/introduction.html)

------
cdvonstinkpot
When you don't want/need full-blown fail2ban:

[https://github.com/sofar/tallow](https://github.com/sofar/tallow)

