Make a ping() Function for Shorthand Logging
The number of times I've typed println!; in rust or console.log("here"); in javascript is too high to be counted with conventional numbers.
All I want is a quick indicator to make sure a piece of code ran. It's a lot of characters to type1 for what amounts to a binary indicator.
The code either fired, or it didn't.
One Ping (Function) Only
These days, I use a ping function. The rust one looks like this:
It gives me the file name, line number, and column of where I dropped the ping.
PING: /Users/alan/workshop/ping-example/main.rs:15:7
The file info isn't necessary if I've only got one ping in play. It's handy when there are a few scattered around.
A JavaScript Start
My javascript version is simpler.
I haven't looked into what's available for pulling location info yet. It'd be nice to have. Hit me up if you know how to get the details.
Fewer Letters, Better Quality of Life
The difference, of course, isn't huge.
Ten characters for rust. Fourteen for javascript.
That little different makes more of an impact than one might think. Give it a shot.
-a
Footnotes
I've used text expander apps in the past. It's nice for a bit. Then I forget about them.