The last three Perl codebases I have worked with were overly complicated when I started and had major sections that only a few people had the domain knowledge to touch. With one of those, I became the domain knowledge expert (financial accounting). But the other two I just haven't had time to do that. For example, I am not a quantitative finance guy and I would have to learn that field (and the other is even more specialized).
But what I have learned to do is be guided by a few principles:
1. I much prefer to work with people smarter than me.
2. I try to be good at the little things everyone else ignores ("is this really the right way to handle exceptions?" "Are these functions really written with testability in mind?").
A big problem of course is that codebases don't just fall from the sky, nice and sleek. They are built up over time and entropy within them slowly grows. What starts out as simple get tweaked and made a little more complicated, then again and again until it is a monster you can hardly touch safely.
Simple, beautiful code is darned hard to write and I haven't yet met anyone who succeeds at that all the time (I know I don't). But one can hope with feedback from outside eyes, and a willingness to watch and rewrite over time, that it may eventually get there.
Some time ago, an upgrade to Foundation framework required NodeJS and Ruby 1.9+, a version not preinstalled on my Mac. OK, at the time I knew nothing about NodeJS and have never used Ruby, how hard could it be? 5-10 minutes max?
- NodeJS installed fine, but I had to use "sudo" to install modules or I'd see errors
- Googled... many people used "nvm". I installed nvm, had some issues, but in the end all worked fine
- Next, Ruby. "rvm" is popular, I'll try that.
- rvm installation failed with a cryptic error message, Googled message...
- I need to install "command line tools" which come with Xcode
- I don't have Xcode and apparently it's several GB, after an hour or more I finished downloading it.
- I had to open Xcode, find some random preferences panel and click some button to install "command line tools"
- rvm installation still did not work, Googled.... many people use Homebrew
- installed Homebrew, ruby 2.x installed (with strange warnings) but showed 2.x in the console
- Foundation tools did not work
- Googled how to uninstall Homebrew, found some random "gist" script some guy made which does scary things on my system
- Tried installing rvm again, and for a reason unknown to me, it was successful!
- Foundation tools still did not work
- Didn't notice, last two line of rvm installation required me to copy/paste two lines into the shell.
Great, now I can use Foundation in my Grails project that has nothing to do with Ruby or NodeJS. This whole process took ~6 hours, half of the time I spent just googling error messages.More recently, I couldn't figure out how to properly package/bundle my React app into a single minified JS file with browserify. The docs linked to a nice simple template:
https://github.com/petehunt/react-browserify-template
The package.json has a few useful commands in the "scripts" section:
"scripts": {
"start": ...
"build": ...
}
"npm start" works fine, so why isn't "npm build" working!?!? I posted on stackoverflow and got no answers. Ten days later I figured it out. Knowing very little about npm I had no idea "npm start" was a shortcut for "npm run-script start" and thus I needed to do "npm run-script build".Somehow I feel better knowing there's at least one another person on the planet losing 6 hours at time for `just installing X piece of tech`.
Worst thing I had to figure out was that the node package on raspbian is originally related to some radio thing and I had to symlink node-js to node to make it work.
It just goes to show the utter most importance of good documentation. Good as in `human readable` not `logically correct sentences à la man GIT`.
You've got 3 frameworks installed, each based on a different programming language, using bits from each, whereas each framework was intended to be a "full-stack" product used standalone. If anything, the real issue is with Grails not supporting Foundation.