Sunday, March 15, 2009

Book Review: Pragmatic Thinking & Learning

prag_cover.pngIn what may be become the first in a series of reviews, I thought i'd share some of my thoughts and some insights into various Computer Science/Programming/Developer related books. I am always reading something so I thought i'd provide some thoughts on these books as I read them. Pragmatic Thinking & Learning is a book that I came across in an unusual way, basically Bill Dudney said he was reading it on twitter, posted a couple updates on his progress and then never really mentioned it again. I was getting done reading Predictably Irrational and the book left me very fascinated about Psychology. I have taken Psychology class, but Predictably Irrational brought it down to a practical level and showed how it applied in the real world with behavioral economics. In that same spirit Pragmatic Thinking & Learning is to Programming & Learning what Predictably Irrational is to behavioral economics. It's a fascinating journey through behavioral theory, cognitive science, neuroscience and some psychology, all while you are learning how your brain is wired and how it all works. Don't let these science terms make you think it's some boring study on how our brains work, as the title says it's Pragmatic Thinking & Learning. In essence it takes you through how your brain works and then quickly applies it to the real world and offers more of a framework for how you can begin to apply the principals presented. Through the tips and studies in this book you gain a lot of unique insight into problem solving, for example how do you teach someone how to play tennis with only 20 minutes of time? One of the things that makes this book somewhat unique is that it forces you to stop every so often and do an activity or think about something. For example I meditated for 5 minutes today, where I don't think I've really ever been instructed on meditation, and I liked doing it so i'll probably continue trying meditation for a while and observe what differences it makes in my day. It's also not just the author making a case for an opinion, there are many citations throughout the book to external resources or studies on a particular subject. It offers some very good tips on things from how to keep yourself organized, how to think out solutions to problems, how as a developer you can try and recover from being interrupted when your in "the zone" and many other things like that. I was surprised when I saw the Rubber Duck debugging technique online one day and then came to read about it later that evening in the book. The book presents a case for something and then tries to get you thinking and get you involved in actively applying that to your situations. My only complaint is the author mentions using a personal wiki to keep things organized and keeps showing he is on a mac and never mentions VooDooPad which I use everyday. I got started using VooDooPad as a way to keep my School notes organized and now I use it for a lot more things, including notes about Cocoa, specific Classes, personal things,etc, it's essentially a Wiki in a convenient self contained document. Overall it's a nice collection of information on how our brains work, techniques to solve problems, how you can learn information or a skill faster and find techniques that work better for you individually. It's been a surprisingly good read and I am glad I bought it because Im sure I'll reference it from time to time from now on.

Wednesday, February 25, 2009

On Safari 4's Tab Design & UI

Untitled.png
Everybody has been bashing Safari 4's Tab design like crazy and so I thought I'd try and be a sane middle of the ground response, offering my honest opinion here. Honestly I am a bit mixed on them, one would think that seeing Google Chrome with this type of UI that I would be prepared for a User Interface like this. So What's different?
chrome_tab.jpg
Well one thing I noticed is that Google Chrome has a background which the tabs are placed on. I can't say I am a fan of this as it reminds me of the MS Windows MDI interface I have a disdain for. It makes it look like there is a larger encompassing container holding all the tabs together which it may have in the data structure design in the application logic, however the user doesn't really need to see this unless it offers something that makes the overall UI more usable. Contrast that with Safari's tabs...
Picture 5.png
...which literally are at the top of the window and in which the tabs appear to exist without any encompassing container. In principal I agree with Apple on redesigning the interface. To me it makes more sense as it looks like Safari's tabs are literally like file folders where the whole interface is contained inside the bounds of the tab vs the older style tab UI used by older versions of Safari and shared with other browsers like Firefox and Camino where just the web view is inside the tab and the UI happens to adjust/switch to reflect to whatever the web view for the tab contains (i.e. the location bar suddenly switching it's url text when switching to a new/different tab.)
Picture 7.png
However my likes of principals and general use are different. I think the reason I (and many people) don't like the new tabs may be that it appears initially that the tabs have gotten a lot smaller. However when comparing the 2 tab styles it appears they are about the same size. One thing that does annoy me about the interface is the deceptive tab resize icon...
Picture 5.png
I say deceptive because it's the same icon (just rotated 90 degrees) that shows in the bottom right of each window on Mac OS X to indicate a drag area where you can click your mouse and drag the icon to resize your window. However on Safari 4 this only allows you to reorder your tab and drag it left to right and out of the window to create a new window, whereas clicking on the tab text is the same as clicking on the window itself and allows you to drag the window around. Really I think this is annoying only in their choice of icon. My First impression of this was that it would allow me to resize the tab width in the window. Another annoying thing is that the title bar is now suddenly complicated with a bunch of tabs. Leave it to Apple to try and simplify the user interface, but there is a balance between reducing the area that UI controls take up and a simplistic user interface, It feels like by merging the tabs and title bar into 1 control that the User Interface as a whole has gotten more complex, for 1 thing is now you can never really see the whole title of a webpage when it's in a focused tab and has and significant length for its title. It almost feels like this could work, but the UI control itself isn't quite polished yet like it's missing something if this is the direction that Apple is going to proceed in.
Picture 6.png
One thing I LOVE that Apple has done that is so stupidly simple & brilliant is the extended tab list. I love that Safari introduces this simple concept of shading the rows in the menu that aren't visible so you know what is and isn't visible. I really hope other browsers copy this concept. Conclusion Overall I am still mixed, I honestly think every browser sucks at something that makes it just short of perfect, however for me Safari ( with Webkit Nightly ) sucks the least and therefore is the best browser for me at the moment. However I don't stop using Camino, Firefox & now OmniWeb, they all have their purposes, just not as my primary browser. The thing to remember is that Safari 4 is a BETA yes I know it's not polished, but last I checked that's what Public Betas are for. Safari 4 will get better and maybe we will adjust to this new style of tabs at the top of the Window and it may become an accepted standard in browsers, however only time will tell and if you really don't like the new tabs you can always just change them with a hidden preference. For now I think I need a few more days to a week to get at a real deep sense of if I like the new tabs or not. Also another interesting trend is more eye candy in the browser ( Top sites and cover flow for history ), I can't wait to see where Apple takes this. Google Chrome CC screenshot http://flickr.com/photos/brullonulla/2826039336/sizes/o/

Wednesday, February 18, 2009

NSConference

nsconference_block.png
If you haven't heard already Scotty is putting together a Mac Developer conference for Europe called NSConference which will be April 16-17 in Hatfield, UK. I would love to go to this, but I am at an odd stage where I am still really a student and am trying to figure out what I am going to do to transition to a full time job in Mac Development, so $1,000+ for a few days in Europe is really beyond my means at this point. However I fully support conferences like this, WWDC and C4 where developers can get together, socialize and learn from each other and exchange ideas and information. Plus I have talked to several of the speakers who will be at the conference (either in person or online) and they are all top notch mac developers, I can only hope that Scotty publishes the videos (like C4) so I can watch them later on after the conference has ended. I am totally jealous of anybody going to NSConference for 2 big reasons (1) I've never been outside the United States (not by choice, I really want to get outside the US sometime) and (2) The sessions and workshops look like fantastic things I'd want to learn about from UI Design desicions, designing custom controls, foundations of Objective-C, etc. If you haven't thought about it already I'd suggest you look into it and head to NSConference. NSConference in the US? Also Scotty appears to soliciting feedback for a possible conference like NSConference in the US. If you would want something like that please give him your honest and constructive feedback here: http://cocoadev.com/forums/comments.php?DiscussionID=731

Thursday, January 22, 2009

Late Night Cocoa: DTrace

Last week I recorded an episode of Late Night Cocoa with Scotty in which I discuss DTrace (why it was created & how it works) and reveal the origin of the name "Cocoa Samurai", you can listen to it here: http://www.mac-developer-network.com/podcasts/lnc/lnc038/ I realize listing to my conversation I left 1 big thing hanging. Mainly I mentioned that it'd be great if the OmniGroup had DTrace probes in their apps (they do, not USDT's as far as I know, just standard ones) and if I could trace that, what I meant is that its great from a pro-user/consumer perspective if say OmniFocus acts up on me one day and I can use DTrace to trace OmniFocus and give them tracing information to help them fix the bug, I am against using ptrace() on an app because it stops me from helping you debug your apps with DTrace, especially when it's not too much trouble for me to gather this information and send it to you to help you. Also for those of you asking... Yes I am considering writing a DTrace/Cocoa book to give this subject the justice is deserves. I've got some ideas, and as soon as I get settled into my last school term (for real this time) I'll think about this in more detail, but for the moment I am fairly busy.

Wednesday, January 21, 2009

Debug Cocoa with DTrace Guide & Embedding DTrace into Xcode Video

Debugging Cocoa with DTrace Guide

dbg_guide_tmb.png

Finally today I can finally reveal my Debugging Cocoa with DTrace guide to you. I had originally meant that this be a quick article on this site, but I kept adding and adding to it and finally by the time I knew what I had gotten myself into it was 40+ pages long. This guide isn't as comprehensive as I would like even at the length that it is. It covers many things regarding the nature of tracing Cocoa apps with DTrace and some various useful techniques. If you don't know DTrace this guide has links to this site and Suns sites that introduce you to DTrace. Again many thanks to the reviewers who helped me in recognizing the things that could be improved or the finer points I missed. Thanks for your help! You can download it from here (right click & save as): http://www.1729.us/cocoasamurai/Debugging%20Cocoa%20with%20DTrace.pdf Embedding DTrace in your Xcode/Cocoa Project Video In this video I explain how to embed DTrace probes into your application which you can then use to get a lot of useful information about the state of your application. Watch it below or you should be able to watch and download it at viddler: http://www.viddler.com/explore/Machx/videos/8/ Update Viddler isn't allowing downloads at the moment. I don't know what is happening here as the downloads usually work fast, but if they don't work in a while I'll try and find out what's going on with Viddler. All I know is downloading/embedding is set to everyone so Viddler should be allowing downloads. Update 2: Viddler Downloads are working now :)

Thursday, January 08, 2009

Announcing the DTrace TextMate Bundle Beta 1 (Updated)

UPDATE: The DTrace TextMate Bundle is now on Beta 3 and I am no longer hosting it, it is on GitHub and will be updated there. You should also go to GitHub to get the latest version and fixes for the bundle. I've been working for a little while on a DTrace Bundle for TextMate to make life writing DTrace Scripts a lot easier and now you can download Beta 1 of the DTrace TextMate Bundle. Now I should warn you it's very rough, but the bulk of the functionality is there. So if you are okay with an evolving bundle for TextMate go ahead and try it. Heres a video showing it off You can download it here: http://github.com/Machx/dtrace-textmate-bundle/tree/master This bundle is open source and is hosted at github: http://github.com/Machx/dtrace-textmate-bundle/tree/master. So go get git and you can keep it in sync with the latest fixes. Here are the things that work: Syntax Highlighting (mostly) D Language Code Folding All Tab Triggers All Included Scripts (Core Data, Garbage Collection, Cocoa Events, etc.) Bugs/What Doesn’t work After you do a tab trigger if you immediately try to do another tab trigger TextMate won’t let you (don’t know if this is my bug or a TextMate bug) Syntax Highlighting only highlights with one color (this will be corrected in the future) Run in Terminal Command doesn’t work right now There is a menu item “More Mac OS X D Scripts” that doesn’t contain anything at the moment, in time several useful DTrace scripts will be added, but for now it’s empty

Tuesday, January 06, 2009

Coming Soon... DTrace Bundle for TextMate

I've been working on this for a little while and it's still a relatively early work in progress, but the idea it to make scripts that you intend to run from Terminal much easier and even write scripts that mirror what's available in Instruments so you can make your own custom modifications if you want to. Stay tuned for more word on when this will be available....

 
...