2,220 karma · joined October 30, 2018
Though I've come to point where I'm starting to approach it strategically. For the most part the only thing that really matters is how employable you are. So long as you can find a job that meets your standards you are fine as you learn the minutiae on the job and it's always different for every job so you can't prepare in advance.
With that in mind this year I'm focusing mostly on the fundamentals doing deep dives into knowledge with extremely long half-life. I've got about 280 hours of courses I'm making my way through on Pluralsight this year. I'm about 1/4 the way through. Just started my SQL playlist and already I'm so glad I'm taking the time to dive deep on it. The difference between now and the end of the year will be night and day.
The tool is choosing to not sweat the small stuff sometimes.
As much as I love making old code new I'm not sure I could stomach a 10 year project.
The real reason they don't do it is because they can't. It's inherently unsafe. In order to always be sure something is never null you have to be aware of what all it's inputs are so you can reason about it. That's not possible with runtime metaprogramming techniques.
I dunno I guess I just think it's an odd choice. Don't get me wrong, it's a neat experiment and I value it. I'm just slightly miffed that that particular experiment had to mixed in with what amounts to a statically typed language with the beauty and simplicity of Ruby but the friendliness and discoverability of static typing.
I'm definitely a fan of Crystal of though as a project and would really like to see a bigger community and more libraries etc.
To get the level of safety they have gone for they have to disallow anything that could potentially blow up.
Besides it's crippled as a language due to never allowing anything to be null, so there isn't any powerful metaprogramming you can do with it. That is a big turn off for me. Otherwise Crystal would be such a nice sweet spot IMO .
There is still plenty to work on in terms of managing energy levels. Most nights I can hit 2hrs but ideally if I could hit 3hr or even 2.5hrs consistently that adds up. It's not a trivial difference.
^[0]*[1-9]*
You could use + if you want. I only do it if not doing will produce incorrect output for my given input, which happens occasionally but is rare.Bear in mind in this case there is also _A.csv or _B.csv you need to account for as well which your version doesn't. Mine will still pick it up because I'm not specifying the end, as I'm assuming I've done the necessary preprocessing steps to get good data so it will produce the expected output.
I'm not usually fussed on being that strict when I write regex as I tend to do various preprocessing steps like grep -v ^$ to filter out any blank lines if I don't want them in the stream etc.
With regard to the 'ints' it helps to not think about them as ints but rather just some text that follows the pattern ^[0][1-9] or some equivalent to that. "Starts with any number of zeros or no zeros followed by any number of numbers between 1 to 9 or none at all."
So long as you know the repeatable pattern you can always use sed to just replace the part of the pattern you want gone with nothing which effectively deletes it from the output. sed is like a Swiss army knife in that regard because you can do nice simple deletions like that and even iterate on them if you need or you can do quite complicated capture groups if you need to as well. Sed can get you unbelievably far in terms of shaping text in a stream.
I have a few tricks I've learned with various tools that I thought were worth writing down. Hopefully you can find some more useful stuff.
https://github.com/nicostouch/grep-sed-awk-magic/blob/master...
cat file.txt | awk '!x[$0]++'The half-life of the knowledge is so long it's just a big boost for a really long time to become an order of magnitude better at it.
So you have a task that takes X time. What's say optimizing it is a net loss time-wise because it doesn't in aggregate save you more than you spent to perform the optimization. Say after optimization it only costs 0.8X time but it took 0.2X time to do the optimization so all benefit cancels out. But the difference being now happiness is 1.5 multiplier so you feel 50% better and the same aggregate amount of time is spent but it's much more enjoyable and therefore more valuable to you.
Maybe I'm not explaining it well, but I totally feel this way about plenty of stuff.