Spot any errors? let me know, but Unleash your pedant politely please.

Monday, 25 April 2016

Prince. Sadface. What an idiot!

The untimely death of Prince has me saddened and confused. Saddened for obvious reasons. Confused by own stupid neglect of my erstwhile fan status. I'm kicking myself that I never quite got around to seeing him live. I'm annoyed that I stopped listening to his music.

I was a fan from Around The World in a Day to Diamonds and Pearls.  I remember rushing from work to Our Price in a lunch hour the day that Diamonds and Pearls came out, getting back to the office a little late and plying it on my CD Walkman for the rest of the week.

This span, from 1985 to 1991 was what I considered my metal years. I'd buy lots of terrible hair metal on Roadrunner Records. I was into guitars and guitarists that were written about in Guitarist magazine. Nuno Bettencourt and Steve Vai and Joe Satriani and Jennifer Batten and Paul Gilbert.

Astonishingly, I'd have probably bought Project Driver at about the same time as Parade. 

You've probably seen the video of Prince's astonishing playing on 'While my guitar gently weeps' with some rock dinosaurs. I don't know if it's true, but I read that this performance was shortly after, and perhaps a response to being absent from a Rolling Stone list of the 100 greatest guitarists. If true, what a fabulous "Fuck You!"

But here's the weird thing: I really liked Prince. I was really into guitarists. I never put these things together. It seems utterly bonkers in hindsight, but I think I know why…

Prince wrote some great songs, arranging and producing them, often playing most of the instruments himself.  Guitar was just a part of what he did. Just part of a song.  Maybe exemplified by When Doves Cry, where it's pretty much just an intro to the intro. Not a run of the mill guitar solo in the middle of a song in the middle of an album of other songs full of guitar solos.  In Paisley Park, it's kind of easy to miss the moments of guitar virtuosity, or forget that it's Prince himself playing them, because they're part of a whole.

Maybe it was a compliment to his song writing and production skills that Rolling Stone overlooked his guitar playing.







Friday, 1 April 2016

Tabs, spaces and alignment.

I just read this...
http://cocoawithlove.com/blog/2016/04/01/neither-tabs-nor-spaces.html

I agree with it all completely, except the parts I disagree with.

I agree that I t doesn't matter whether you tabs or spaces as long as you and your team are consistent.

I think my preferences come from coding on actual VT100s an VT220s in the 80s. Physically 80/132x24 monochrome. 

I prefer spaces. A space is a fixed unit and a tab is unpredictable. You need spaces in your code, but you don't need tabs. It makes sense to pick just one, and that can't be tabs. 

Where I really disagree though, is that manually formatting and aligning to make the code pretty is a waste of time and effort.  Readability is really fucking important. Code is read far more than it is written. To not make the code pretty will annoy or inconvenience readers, including future me. The most valuable tool in making code readable is space. We see this most obviously in left indentation implying or defining scope. It's also good for indicating arbitrary blocks. Or giving a complex line room to breath. 

The other thing that really, really bugs me about this drive for efficiency while coding. I'm not 100% creative coding at full speed the whole time. It's more like crafting or interval training. There's a creative burst, then a period of recuperation. This is when I prettify the code I've just written. There's low cognitive load, pride in a job well done, and I'm ready for the next creative burst. 

In monochrome, there's no syntax highlighting. Keys and values, formal parameters and their default values or actual values, names and literals. They all look the same. Maybe pretty code yields more readability in that context.

While I'm at it… Comments that add value are fine. Yeah, yeah, they can atrophy, and code should be self-documenting, but a little explanation can make skimming the code a lot easier. Anyone maintaining or reviewing code needs to take responsibility for the comments.

Lastly, I was intrigued by this post, in which an editor would present code like an outliner rather than just text: http://inessential.com/2015/12/21/how_to_solve_tabs_vs_spaces_forever