4 ms·
In the end, nobody cares how I renamed all the images from lolimag_{i}.jpg to 2015_05_20_img_{i}.jpg, they just care that I did it. Yeah sure if you mastered p
by Killswitch 11y ago
In the end, nobody cares how I renamed all the images from lolimag_{i}.jpg to 2015_05_20_img_{i}.jpg, they just care that I did it.
Yeah sure if you mastered perl, grep/awk/sed and can whip up what you need in a few seconds, more power to you, but I'm not going to waste an hour of my time googling and reading man pages when I can take 3 seconds to write a quick function in JavaScript to do what I need for that one task.
- eropple 11y agoLearning to use sed for that kind of trivial task would take, what, a minute? Maybe two? If you know regex, you know enough of sed to do anything, and if you're not using regex in your JavaScript transform you're quite inarguably (and I don't use that word lightly, but regular expressions really are required knowledge) screwing up anyway...so what's the point? Polluting the global namespace with yet another tool that's worse at its job than the existing ones because of a particular breed of aggressive incuriosity and epistemic closure is real weird. (This isn't a failing unique to the JavaScript community. Go people love doing this, too, creating bad solutions to solved problems. You used to see it a lot in Ruby, but the community seems to have grown up a little.)
- ams6110 11y agobasic regexp search and replace with sed is pretty simple, but it gets hairy VERY fast beyond that in my opinion. awk I love, I find it very simple and intuitive. Also gnu awk, sed, and grep are not the same as BSD variants. The gnu versions have (some would say suffer from) a lot more features. For me, anyone who uses unix and doesn't have working knowledge of how to use find, xargs, sed, awk, and grep is missing out on a lot and very likely wasting time reinventing wheels.
- eropple 11y agoI'll use awk for that stuff when it occurs to me, sure. Most of what I do is pretty straightforward transforms, and chaining together a couple sed commands often comes to mind first. I use the GNU tools for consistency, as it's easier to install them on a BSD system than the reverse, but your point is well-made.
- jzelinskie 11y ago> Go people love doing this, too, creating bad solutions to solved problems. My anecdote: most "Go people" doing this are actually "Go beginners" that are still learning the language and attempting to write something familiar to cement their understanding. I imagine this is often the case for other languages.
- falcolas 11y agoYou'll also see this (that is, go replacements for common tools) as a direct result of a Suckless challenge to do exactly that. The idea being to get rid of the complexity of the current bash tools (let's be honest, when `cp` has options you would expect from `rsync`, it's gotten rather complex), with the side benefit of being statically compiled. I'll admit, I've written a few of these myself to help nail down both my knowledge of Go and the basic toolset I use every day. It was quite useful as a learning tool, even though they'll never replace the originals. Heck, I'd even recommend re-creating `dc` to anybody who is interested in learning a language, or writing a parser/interpreter for a language.
- eropple 11y ago> You'll also see this (that is, go replacements for common tools) as a direct result of a Suckless challenge to do exactly that. This is what I was referring to, yeah, and it is to my mind a sign of a certain amount of cultural insularity and maybe a little hubris. Reimplementing something like `dc` to learn a language is great, it's when you start movements to start replacing things--or even trying to be taken credibly as an alternative--that I think you had best come very correct or be ready to defend your contention that the status quo is for some reason unsuitable. "I don't already know sed" is not, to my mind, a good defense, which touched off this subthread.
- falcolas 11y agoNo, nobody will care. However, you'll care when ten years down the road you will still working around your lack of knowledge about your operating system, when you could be spending that time working on something interesting. Let's look at it briefly from the flip side. I'm in Devops myself, and I am quite confident chaining together seds, awks, and greps. Those didn't help me when I had to troubleshoot a Node application, though. What did? I also learned enough about Javascript to be able to not only navigate code, but debug what was happening. Artifically limiting yourself by not taking these opportunities to learn about an OS you seem to spend a fair bit of time in is only hurting you.
- bronson 11y agosed and awk have very little role in modern operating systems. It's easy to be a Linux whiz and still have to look at the manpage every time you see an awk script pulling out columns. Heck, awk is two generations removed. Even Perl one-liners are fading into history.
- falcolas 11y agoWhat do you see as a replacement for Awk, then? And what does your Linux whiz use instead of sed and Awk for getting things done?