HNHacker News
TopNewBestAskShowJobs

kjbekkelund

1,229 karma · joined November 8, 2009

http://kimjoar.net

[ my public key: https://keybase.io/kimjoar; my proof: https://keybase.io/kimjoar/sigs/ZRNY6aDyocRJ_ZtHQDb8bz6vPk1weeOnVBbc7s5Mhmg ]

submissionscomments
kjbekkelund··on Step by step from jQuery to Backbone
Because I think it's cleaner having it as the third argument on events instead of having a large list of stuff in _.bindAll in initialize (and additionally, I've found it simpler to explain it to others, but I don't know why). I think it's just one of those subjective choices.
kjbekkelund··on Step by step from jQuery to Backbone
Great point. I'll take a look at it and maybe make some changes. :)
kjbekkelund··on Step by step from jQuery to Backbone
Thanks! And great question. Of course, in real-time environments you need to be really sure which events trigger when. However, on a normal single-page app the add event will only be triggered when you have make a request to the server, and you won't do that mid-typing, only when you're finished typing.

Edit: But, of course, as Robin_Message mentions, it's not always as clear cut as I stated, and there might be some issues with my solution.

kjbekkelund··on Step by step from jQuery to Backbone
You can read it here: https://github.com/kjbekkelund/writings/blob/master/publishe...

Our Wordpress bullshit is failing hard.

kjbekkelund··on Step by step from jQuery to Backbone
Which Github link? This one: https://github.com/kjbekkelund/writings/blob/master/publishe... ?
kjbekkelund··on Step by step from jQuery to Backbone
Author here. The blog appears to be down, check it out on Github instead: https://github.com/kjbekkelund/writings/blob/master/publishe...
kjbekkelund··on Rich Hickey: Simple Made Easy
Basically, it gave me a new vocabulary for thinking about the decisions I make every day when coding. It opened my eyes about things to look for, to focus on, to change, and so on. With regards to decisions, I also love Dan North's Decisions, Decions from NDC recently: https://vimeo.com/43536417

It's mainly the basic philosophy that Hickey focuses on that changed a lot for me, not any of the specific examples. After watching Hickey I've read great books such as Pragmatic Programmer, Passionate Programmer, Coders at Work, and other books that have helped me, as a recent university graduate, build my "coding philosophy". Hickey was just a very inspiring "first step" in changing how I look at code.

kjbekkelund··on Rich Hickey: Simple Made Easy
I'm also opposed to reposting, but I mention this talk to people all the time and nearly none have seen it. Those who have, however, all agree that it is an amazing (and eye-opening) talk. I just saw it again today for the first time in half a year and realized how much it has actually changed how I develop software.
kjbekkelund··on Single page apps in depth (new free book)
There is a single page version: http://singlepageappbook.com/single-page.html
kjbekkelund··on Mixins in Backbone.js
We came up with this when we saw that several of our components did too much and we had to much copy&paste going on, so we haven't actually created many from the ground up. But the one we created using TDD from the ground up has proven to be very reusable. So I guess my answer is both, but in the beginning I believe it's primarily the latter.
kjbekkelund··on A view’s responsibility — a lesson on JavaScript and the DOM
Thanks. Are there still more entity character encodings left? I had a fight with Wordpress and it took some time to get everything working properly.
kjbekkelund··on A view’s responsibility — a lesson on JavaScript and the DOM
Absolutely. To focus the blog post I didn't go any further, but I plan (at some point) to write a blog post going deeper into how (I think) views should work.
kjbekkelund··on A view’s responsibility — a lesson on JavaScript and the DOM
I know, the point is just showing that the abstractions themselves are quite simple. I've used Backbone on several projects myself. Maybe I'll add a note at the end.

Edit: Added! Thanks. I should absolutely have added that before posting it.

kjbekkelund··on A view’s responsibility — a lesson on JavaScript and the DOM
The blog appears to be down. You can also read it at https://github.com/kjbekkelund/writings/blob/master/publishe... (I'm the author)

Edit: The blog appears to be up again! Hopefully it'll stay up this time ;)

kjbekkelund··on Integration testing Backbone.js
I don't know if you have used Backbone.js, but these tests ensure that models, collection, views, templates, events and our business logic work properly together. It was difficult to show all that in a few small examples.
kjbekkelund··on Integration testing Backbone.js
Okey, so let's just say that I'm testing in a way I haven't seen mentioned by anyone with regards to Backbone.js. The point is the execution, not the naming.

Btw, if anyone has been talking about / doing similar testing of Backbone.js, I would love to share some insights and ideas.

kjbekkelund··on Integration testing Backbone.js
But does it matter if they are somewhat like unit tests or somewhat like integration tests? Isn't this just nitpicking on the definition of an integration tests? According to Wikipedia: "Integration testing [...] is the phase in software testing in which individual software modules are combined and tested as a group." That's what we are doing here. We are testing that the entire _client-side_ application works as expected.

And yes, I totally agree with you regarding the confidence we can have when we mock out our server-side application. But in the context we were working it would be a world of pain to have proper acceptance tests going through the entire stack. They would also take much, much longer time than about a second (we are not in a regular database type application using Rails and all that, this is an enterprise project with many, many years of legacy code in it and an ESB and whatnot).

The purpose of these tests for us is first of all to be able to deliver functionality fast and with high confidence, which they, beyond a doubt, has helped us with.

kjbekkelund··on Integration testing Backbone.js
Another aspect related to this point is that we have a slow backend system and we wanted our JavaScript tests to be blazingly fast, also the integration tests. I hate waiting for tests. Now I can run ours all the time because they don't use any time at all (well, okey, they take a second ...).
kjbekkelund··on Integration testing Backbone.js
Why write your tests in something else than JavaScript when it's a JavaScript app? We already wrote a lot of unit tests in JavaScript, and our integration tests grew gradually from them, so we didn't feel we needed to add another layer of abstraction on top of regular JS.
kjbekkelund··on Integration testing Backbone.js
If you look at the examples I'm not testing that collection.length is some length, I'm checking that the actual output of my application is correct. For example, in the last example I'm checking that my application handles errors properly.

In our app we have nearly no business logic at all, and we have tested our REST endpoints thoroughly, so we felt we didn't get nearly any value out of unit tests (we wrote about a hundred of them before we changed our primary focus). So, what these tests actually test is that all events are triggered properly, that what I expect to see is actually what's in the view, and so on.

Yeah, this also means that _some_ tests are close to Backbone.js functionality only, but most are far from it when the application grows in complexity. We have a lot of custom events, both the regular Backbone model and collection events and also a lot of global events.

So no, I actually don't agree that we are missing out on the importance of unit tests. We have fully test-driven a large application over 6 months and found a way that works great for us, and that allows us to be flexible and deliver functionality fast, at the same time as we have confidence in not breaking functionality.

kjbekkelund··on Best HTML5/CSS3 Presentation Frameworks
I think most of these are too heavy for my use. I've been helping out on a simplistic slideshow tool using Markdown, which might interest some of you: https://github.com/gnab/remark

Example presentation: http://gnab.github.com/remark/

kjbekkelund··on YouTube Founders Acquire Delicious From Yahoo
I went from being an avid Delicious user to using Pinboard instead. I'm really looking forward to seeing what happens now, and hopefully there are so cool stuff coming that I'll go back to being a fanboy again. This is (hopefully) amazing news!
kjbekkelund··on Programmer salary in mainland Europe?
It's interesting to see the salary in different countries. I'm starting in a junior developer position in Norway with a salary of €56k/year ($82k/year). However, we have reasonably heavy taxes and cost of living. Another important aspect is that our currency is crazy strong right now. Just 10 months back it would have been about $65k/year.
kjbekkelund··on Dropbox Hits 25 Millions Users, 200 Million Files Per Day
That's what I've done. And it's amazing having access to all the files from my iPad, iPhone and generally, for those few times I need it, from everywhere through the website. It's made my life a little simpler, that's for sure.
kjbekkelund··on Ask HN: Writing a master thesis about freemium, need some ideas
I wrote more about doing my master thesis on freemium at http://kimjoar.net/why-i-want-to-write-a-master-thesis-about...
kjbekkelund··on Ask HN: Writing a master thesis about freemium, need some ideas
I'm studying entrepreneurship at a Norwegian university (http://www.ntnu.edu/).

I will probably write up some blog posts along the way and post them to HN!

kjbekkelund··on A DSL in 5 Languages: Ruby, Python, PHP, C#, Java
What about doing it like this in Ruby:

    collection = Braintree::Transaction.search do
      order_id /^a2d/
      customer_website /\.com$/
      billing_first_name "John"
      status :authorized, :settled
      amount 10..20
    end
    
    collection.each do
      puts id
    end
It might be more difficult not having the specific methods (in, starts_with_ ends_with, and so on), but I think it's quite readable. If we don't want the regexps, we could go for a MySQL style '%.com' and 'a2d%' or something similar.
kjbekkelund··on Ask HN: Summer Reading Recommendations?
My favourite books read lately are Here Comes Everybody by Clay Shirky and Perrotta's Metaprogramming Ruby. If you haven't read Free by Chris Anderson, it's also highly recommended. It's just an article, but Anarconomy by the Copenhagen Institute for Futures Studies was a very interesting read (http://www.cifs.dk/doc/medlemsrapporter/MR0309UK.pdf).

If you are willing to check out an audiobook, World War Z is truly an amazing book. Absolutely the best audiobook I have heard so far.

Enjoy your weeks off!

kjbekkelund··on Why the Mythbusters won't do RFID (2008)
I wrote an article about the security of passive RFID tags at school about a year ago: http://kimjoar.net/security-passive-rfid-tags.html. There you might find some interesting stuff regarding your question. RFID is very cool, but there are still a lot of (unsolved) security problems with them, especially the passive tags.
kjbekkelund··on Postcard from Halden
You should've seen the minus points coming — committing a crime never increases your karma. ;)
← PreviousPage 2 of 3Next →