Lately I've been reading lots of Hacker News, Reddit/programming and a myriad of other blogs all covering programming topics.
When reading HN, a great deal of the posts is about startups. Young people starting their own business writing code which will solve some problem we didn't know we had. I really envy them. They get to work on their personal little project all day and they get paid for it. Well that last bit isn't really true unless the startup actually succeeds.
I don't think the business world in Belgium is ready for this kind of thing. No, I really should rephrase that: I haven't encountered anyone who could be interested in (partially) funding an Internet startup. Maybe I'm just in the wrong place or I'm not networking enough.
Then again when I think of it a little harder, why would I even start a startup? I have a good job, a boss who lets me do my thing (within boundaries), great colleagues. I'm not in a position right now to be taking any big financial risks. Just bought a house, got married, the wife isn't really a fan of me doing something like that, and I completely understand.
Am I too late doing this kind of thing?
Maybe when I just got my bachelor's degree, when I was looking for a job, I could have worked on something instead of goofing off and playing video games with friends.
The itch to produce something is still there though. Maybe I can project this desire on my work...
My job right now is a one man project, writing software that automaticly tests the software my colleagues write. It's based on our internal SDK of one application, which I use to test the other application we make (client/server type of thing). I do all of my coding in C# at work, apart from a little side project for reporting for which I use Common Lisp (see my blog post about this). While C# is not my favorite programming language, it gets the work done. Most of the other coders, especially my direct colleagues write in C++.
The thing that struck me the most when I started this job was, while I thought I was a great coder when I got out of school, I'm miles away from my coworkers. I don't even come close. While I can hold my own in a technical discussion and grasp most of the concepts of what they're doing, I'm nowhere near the level of skill they have when it comes to actually writing code. At least that's what it seems like.
Granted, I haven't been 'professionally' coding for very long and I know I still have much to learn about, well, everything. Yet the same question pops up: Am I too late? I'm close to 30, should I have sharpened my coding skills earlier, never played online games or simply taken up another job that required me coding from day 1? Nearly all of my free time goes to learning more about programming, concepts, theories, language, yet I feel like it'll all be in vain. It's too little, too late. Did I blow my opportunity to be a 'great hacker' as Paul Graham calls it?
I could always join an open source project and start hacking on that, learning the chops as I go. Skill difference could be a problem again though.
OK, enough with the self-pity, here are the good sides to the situation.
I don't really have a deadline for my project at work. I can take time to figure new stuff out, ask my colleagues for help and just keep at it till I get it right.
For a lot of little things, I'm not bound to one toolkit. I can choose whatever tool (language) I want for the stuff I write. It's really nice to have this kind of freedom. (Of course I have to be able to defend why I would choose that tool.)
The atmosphere at work is great, my boss encourages me to learn new things and improve my coding.
All in all I'd say I'm in a good place to become at least a better hacker. If I'll be able to make an impact in the community of hackers, that's another question. Then again, how many coders can do that?
So yeah, maybe I am too late. But it can't hurt to try!
Tuesday, April 28, 2009
Thursday, April 23, 2009
Sticking with it
I've been trying to get TweetDeck to work but Adobe AIR and StumpWM don't like eachother. Since I'm not giving up the <plug>best wm ever</plug>, TweetDeck is not an option.
So what does a programmer do when he can't get the features he wants? Right, he codes it himself! I'll call it 'TweetSheet' for now. (it's not the best of names, but atleast it sounds better than TwitterSh.. well you know)
Learning a new language always comes with lots and lots of practice and this will be a good exercise for my Lisp skills. I've reached a point where I don't even think about using another language for coding anything. (Except work-related stuff, where C# is usually the choice I'm urged to make.)
It's going to be a TweetDeck-inspired web application featuring a columned view. For this I'll be using the awesome Hunchentoot webserver and a couple of other tools Edi Weitz wrote: Drakma and CL-WHO. For the JSON stuff there's cl-json.
Not long ago I was thinking of writing a blog post to complain about the bad state of the Common Lisp libraries. I was even tempted to ditch CL and try Clojure. (Because of the Java libs available.)
Assembling my toolkit for writing this Twitter app, I must say I'm quite impressed with the libraries I found. Weitz' stuff is very easy to use and a pleasure to work with since it's documented nicely. The cl-json lib doesn't work with SBCL 1.0.27 but a quick browsing through their mailing list shows that they're aware of the problem and it'll be fixed soon. So for now I stick to .24 of SBCL.
The basic Twitter search was up and running in no time. More time was spent getting the HTML and CSS right than writing the actual code to handle the json replies. While I'm praising Lisp tools, I'll add another one: wigflip.com by Zach Beane. The rounded corners I use for the tweet-boxes are made with the 'cornershop' part of the wigflip site. (thank you Zach!)
Here's a little preview of how it looks like now:

If this little project ever grows big enough to be meaningfull, I'll open up a Google Code page or something so people can help out. I'll be happy to share the source with anybody who asks, even if it was just to get some pointers on how to improve things.
I'm not giving up on Lisp. A language doesn't survive for 50 years if it sucks. I'm even starting to see now where other languages (like .NET) are getting their ideas from. Sure, the Lisp library collection is not like CPAN or Java, but the important ones are there, and I'm sure the ones that aren't there won't be hard to implement.
So yes, I'm sticking with Lisp!
So what does a programmer do when he can't get the features he wants? Right, he codes it himself! I'll call it 'TweetSheet' for now. (it's not the best of names, but atleast it sounds better than TwitterSh.. well you know)
Learning a new language always comes with lots and lots of practice and this will be a good exercise for my Lisp skills. I've reached a point where I don't even think about using another language for coding anything. (Except work-related stuff, where C# is usually the choice I'm urged to make.)
It's going to be a TweetDeck-inspired web application featuring a columned view. For this I'll be using the awesome Hunchentoot webserver and a couple of other tools Edi Weitz wrote: Drakma and CL-WHO. For the JSON stuff there's cl-json.
Not long ago I was thinking of writing a blog post to complain about the bad state of the Common Lisp libraries. I was even tempted to ditch CL and try Clojure. (Because of the Java libs available.)
Assembling my toolkit for writing this Twitter app, I must say I'm quite impressed with the libraries I found. Weitz' stuff is very easy to use and a pleasure to work with since it's documented nicely. The cl-json lib doesn't work with SBCL 1.0.27 but a quick browsing through their mailing list shows that they're aware of the problem and it'll be fixed soon. So for now I stick to .24 of SBCL.
The basic Twitter search was up and running in no time. More time was spent getting the HTML and CSS right than writing the actual code to handle the json replies. While I'm praising Lisp tools, I'll add another one: wigflip.com by Zach Beane. The rounded corners I use for the tweet-boxes are made with the 'cornershop' part of the wigflip site. (thank you Zach!)
Here's a little preview of how it looks like now:

If this little project ever grows big enough to be meaningfull, I'll open up a Google Code page or something so people can help out. I'll be happy to share the source with anybody who asks, even if it was just to get some pointers on how to improve things.
I'm not giving up on Lisp. A language doesn't survive for 50 years if it sucks. I'm even starting to see now where other languages (like .NET) are getting their ideas from. Sure, the Lisp library collection is not like CPAN or Java, but the important ones are there, and I'm sure the ones that aren't there won't be hard to implement.
So yes, I'm sticking with Lisp!
Monday, April 13, 2009
Conditions, restarts and great people
I've been studying conditions and restarts in lisp for a bit now. I've read the chapter in Practical Common Lisp about it but didn't quite get it right away.
So I asked around in #lisp on freenode for some help. I initially got other links (a tutorial and a paper by Pitman) with a lot of information. The first link assumes already some knowledge of the topic and the second one was such a large read that I was a bit discouraged. "Is this really so hard?", I thought to myself.
I went back to PCL and read the chapter again, this time making the examples in my editor as I went along. (I really should have done that from the start)
Not getting the example to work frustrated me, it sounded great on paper and it was well explained but I just couldn't get it to work.
So I ask on #lisp again, pasted some code to the pastebin and waited for a reaction. A few people initially reacted with 'oh you need restart-case'.
While entirely correct, I didn't get it because I was sure I tried that example and while the restart-case on itself worked, I removed it again when I went over the next examples. Then Peter Seibel (who also idles in the #lisp channel) saw that I was struggling and started giving me pointers on what to re-read in his book. After about half an hour of reviewing the code, I figured it out, fixed the bug and got it to work.
This is always a good starting point when I'm learning stuff. I follow examples and type in the code, see that it works and then figure out why it is working. Peter's examples in his book confused me a bit, the naming of the functions made me lose track of what was happening. (Don't get me wrong, I'm not blaming anybody but myself here) After several tries, I was pretty sure I got it down and knew how to use conditions with restarts.
A couple of hours later, I got a query on IRC from Paul Gresham who gave me a very simple and wonderful example:
Thanks to #lisp, Peter Seibel and Paul Gresham, I'm one step closer to 'lisp enlightenment' ;-)
I'm really appreciating the community for the help!
Who said people in #lisp weren't nice? Oh right that was me. Well I take it back!
So I asked around in #lisp on freenode for some help. I initially got other links (a tutorial and a paper by Pitman) with a lot of information. The first link assumes already some knowledge of the topic and the second one was such a large read that I was a bit discouraged. "Is this really so hard?", I thought to myself.
I went back to PCL and read the chapter again, this time making the examples in my editor as I went along. (I really should have done that from the start)
Not getting the example to work frustrated me, it sounded great on paper and it was well explained but I just couldn't get it to work.
So I ask on #lisp again, pasted some code to the pastebin and waited for a reaction. A few people initially reacted with 'oh you need restart-case'.
While entirely correct, I didn't get it because I was sure I tried that example and while the restart-case on itself worked, I removed it again when I went over the next examples. Then Peter Seibel (who also idles in the #lisp channel) saw that I was struggling and started giving me pointers on what to re-read in his book. After about half an hour of reviewing the code, I figured it out, fixed the bug and got it to work.
This is always a good starting point when I'm learning stuff. I follow examples and type in the code, see that it works and then figure out why it is working. Peter's examples in his book confused me a bit, the naming of the functions made me lose track of what was happening. (Don't get me wrong, I'm not blaming anybody but myself here) After several tries, I was pretty sure I got it down and knew how to use conditions with restarts.
A couple of hours later, I got a query on IRC from Paul Gresham who gave me a very simple and wonderful example:
This made me get it. It's very clear to me now how it works. I'm sure it will still take some time and effort to really grok this but now I'm confident I can do it.(declaim (optimize debug))
(defpackage :condition-fun (:use :cl))
(in-package :condition-fun)
;; This tutorial focuses on very simple restarts. Lisp can do a
;; lot more, but the constructs here are already incredibly
;; powerful.
;; This tutorial does not look at defining conditions as we
;; want to focus only on restarts.
;; Imagine this is your cool API. We have two implementations. The;; first is typical, nasty code that just sticks Nil in and;; essentially ignores the error. The second is much better, it
;; provides three restarts for our clients to use.
(defun nasty-fun (data)
"Oh bugger! what to do about div-by-zero. Screw it, just return Nil!"
(loop for d in data collect
(handler-case (/ (random 1000) d)
(division-by-zero () nil))))
(defun much-nicer-fun (data)
"We allow our parent to decide what to do about div by zero."
(loop for d in data collect
(restart-case (/ (random 1000) d)
(use-nil () nil)
(use-zero () 0)
(use-value (value) value))))
;; What this means is that the calling program can effect low level
;; errors inside our API. They can choose what to do about it, to
;; correct the error in a way meaningful to them and continue
;; processing. Don't get stuck here, work through the next steps
;; then you'll understand.
;; Imagine this is some client code using your cool API
(defvar *data* '(2 3 4 0 6 2 0 9))
;; ^ ^ Uh-oh!
(defun critical-fun-that-hates-nil (data)
"We're only hire professionals and expect them to return
us good stuff even if we send them garbage."
(loop for d in data collect
(* (random 1000) d)))
(defun important-programme1 ()
"If this dies the client loses US$1BN."
(critical-fun-that-hates-nil
(nasty-fun *data*)))
;; Ok let's give the option to manually recover. Experiment
;; with the different restarts at the prompt.
(defun important-programme2 ()
"The previous version would lose a lot of money each time
it's run. We need more control"
(critical-fun-that-hates-nil
(much-nicer-fun *data*)))
(defun important-programme3 ()
"Great! Now we have to employ someone to sit there
selecting the restart everytime, lets automate that
with a dynamic function."
(critical-fun-that-hates-nil
(handler-bind ((division-by-zero
#'(lambda (x) (invoke-restart 'use-zero))))
(much-nicer-fun *data*))))
(defun use-zero-please (x)
"Provide a function for the restart for readability purposes."
(declare (ignore x))
(invoke-restart 'use-zero))
(defun important-programme4 ()
"The dev's at the client only write VB code and
can't understand this lambda stuff, make clearer
so they can read our code"
(critical-fun-that-hates-nil
(handler-bind ((division-by-zero #'use-zero-please))
(much-nicer-fun *data*))))
(defun important-programme5 ()
"Wow, our client is happy, so happy, they now want to specify
a their own value as zero is causing them to lose money."
(critical-fun-that-hates-nil
(handler-bind ((division-by-zero #'(lambda (x)
(invoke-restart 'use-value 1))))
(much-nicer-fun *data*))))
;; Oh but it's not readable again. This time we need a function
;; that creates a function for our client. Yes, we're writing
;; code that writes code for them!
(defun use-value-please (value)
"Don't worry they won't know this actually returns a function,
it'll look ok to them!"
#'(lambda (x)
(declare (ignore x)) ;; because this is a simple tutorial!!
(invoke-restart 'use-value value)))
(defun important-programme6 ()
"Allow the value to be specified"
(critical-fun-that-hates-nil
(handler-bind ((division-by-zero (use-value-please 10)))
(much-nicer-fun *data*))))
Thanks to #lisp, Peter Seibel and Paul Gresham, I'm one step closer to 'lisp enlightenment' ;-)
I'm really appreciating the community for the help!
Who said people in #lisp weren't nice? Oh right that was me. Well I take it back!
Friday, April 3, 2009
Jumping on the bandwagon a little later than most people...
I'm not always as eager to join shiny new things on the internet. Problem with that is.. all the good nicknames or aliases are already used. The names I use most frequently are usually taken. It would have been good to be able to use the same alias as I use here, 'Gertm' or my old IRC nickname 'Cel'...
Creating my gravatar account, I picked 'G3rtm' .. not so bad.
Oh, well, that'll teach me to maybe try something new a little faster in the future.
Update: I quite like the 'G3rtm' alias afterall. I'm also using it for my twitter account now.
Creating my gravatar account, I picked 'G3rtm' .. not so bad.
Oh, well, that'll teach me to maybe try something new a little faster in the future.
Update: I quite like the 'G3rtm' alias afterall. I'm also using it for my twitter account now.
Subscribe to:
Posts (Atom)