Why I don’t use javascript frameworks

Destash wrought iron shelter theme frame
Creative Commons License photo credit: knitsteel

Last week Oskar asked me a valid question: why I don’t use javascript libraries (jQuery, Prototype, Mootools) and stick with coding in plain JS. I loved this question so much that I have decided to turn it into full blown article.

So I sat in my chair and started thinking. Why am I hand coding most of the javascripts that I produce, that are deployed on production machines? I did some work with jQuerry, I have used Prototype. Haven’t used Mootools as much as I’d like to but at least I know of its brilliance. So why I am not using js frameworks?

Here is why:

Flexibility - by not falling in love with a particular framework I am left with more flexibility when new projects come my way. Due to the nature of my work at Cognifide I often get involved at later project iterations when some javascript is already produced. Knowing the language more than a framework allows me to easily work in both jQuery and Prototype as well as in pure javascript projects.

Developer background - having a history of developing in pure C I must admit: I love to code. I love to produce hand made code. This is mainly why I also love to code in javascript. It is fantastic feeling that js frameworks partially take away from me.

Insight - by writing javascript on my own I know exactly what is behind methods I use. By writing code in a best possible way I also have a point of reference to what mentioned javascript frameworks have to offer.

Accessibility - keeping relatively low size of a page that user need to download we create faster response times enhancing accessibility. And why should I include additional files and kilobytes of code when I need only two maybe three things.

Using right tool for the job - let me stress that I have nothing against popular frameworks and I love to use them whenever needed but the thing is that you don’t always need a whole piece of javascript magic when the site you are making needs to be low on javascript with just a sprinkle of dynamic javascript functionality.

So this is it. Hopefully you can relate to my reasons, maybe even add few of your own. Or do you believe that all this is just lame and every self respecting front end developer should use a framework of his choice?

Either way I am really hoping for some feedback here. What do you say?

Posted at 7pm on 7/30/08 | 9 comments | Filed Under: JavaScript | read on

Why new Punisher movie will kick ass

New Punisher: War Zone movie is coming our way in December 2008 and recently a trailer went live. And may I tell you this stuff is good.

All this got me thinking about reasons why new Punisher movie will kick ass and this turned out into a quick list for you.

And here it is:

  • Lead actor actually knows what he is doing. Check out this interview with Ray Stevenson and get this: he has actually read all the comics portraying both punisher and the bad guys just to get the big picture.  
  • This film will be hardcore. Check out this alternative Punisher: War Zone trailer (longer, more brutal) version and see for yourself.
  • Jigsaw. That is it. One of the best villains in the comic book world. Ray describes it best in the interview above.

That’s it. Only thing left to do is to watch the trailer. Enjoy.

 

Posted at 8pm on 7/28/08 | 1 comment | Filed Under: Pop culture | read on

7 things to do while not blogging

How often do you post?

I used to blog five times a week but recently I lowered my posting frequency to around 3. Why? Well it is a topic for a whole new blog post but generally I haven’t had time to deliver top quality posts and since top notch quality is my thing I decided to post less.

What I have gained by doing this? Well, a bit more free time that can be spent on writing better content. I have also gained perspective. What sort of a perspective? When blogging five days a week, process of writing and publishing was taking up around 90% of my time set for blogging. Now I can do all sorts of blog maintenance and still have some time to spare.

And here is the juicy part: What you should do while not blogging?

  • Social network - after my article on making site’s prototypes was made popular on digg.com two things happened: I got tons of traffic and I started appreciate digg community having the inside of what are the benefits of getting dugg. Since then I spent more time networking on social sites (StumbleUpon is next on the list) to promote my content and let me tell you I see enormous results  from doing it.
  • Visit other bloggers - another thing with having more time is that I can finally go past my RSS reader and actually go the sites I read every day and comment on the posts that have caught my attention. Increase in traffic on my site as a result of this strategy is yet to be seen but seeing this in action on Kacper’s site keeps me in optimistic.
  • Catch up with mail - similar thing to the above. Besides commenting on sites I plan to launch direct campaign to promote myself to specific bloggers wishing for some link-love.
  • Tinker with your blog - add a little changes to your blog. Maybe another widget? Maybe work on how your posts are displayed? For me top priorities are “Me2.0” page where you will be able to find me on various social networks and “Best Posts” page where I will hand pick my best content for you to see.
  • Redesign your blog - this is a big one. Think if maybe it is a good time to redesign your blog? Add a little spark? Rebrand yourself? I know that GregWolejko.com needs new design and as soon as I will finish my secret project I am working on right now, my focus will be completely directed to making GregWolejko.com shine.
  • Plan - time to set up milestones. No goal is a real goal until it is measurable. It is time to set up a milestone goals for me and focus on reaching them. In my case this will be connected to getting more RSS subscribers and getting more other blogs linking back to me. But that’s only the beginning.
  • Have fun - this will be easy. Have fun. Relax. Get some time to rest and recharge your blogging batteries.

As you can see by getting more spare time I also got more focus points. One can argue if this is a god thing but I know it is. Hopefully soon both you and me will see benefits of my new blogging strategy.

I also hope that my list here helped you a little with setting your own blogging goals…

…or maybe you have other ideas? Something that I’ve missed here? Care to share? I am definitely interested in your opinion.

Posted at 7pm on 7/24/08 | 27 comments | Filed Under: Blogging | read on

Adding Events in JavaScript

Every once in a while I have to do a little bit of javascripting in a project that is too small to use some dedicated libraries like jQuery, Prototype or MooTools but is big enough that requires me to add custom even handlers there.

As fun as it may be you need to be careful when doing it as there are some possible pitfalls. What are those? Well, there are few:

  • no easy way to test if element has an event assigned
  • risk of overwriting handlers
  • different browsers means different ways to actually get the job done (here is looking at you IE)

This is why it is always helpful to have this following piece of code for unobtrusive and cross browser adding and removing events. Code was originally written few years ago by the one and only John Resig but it is still awesomely cool and easy to use.

So without further hesitation, here are two important methods: addEvent and removeEvent.

addEvent (obj, type, fn)

Parameters:

  • obj - element that event will be registered to
  • type - type of the event
  • fn - function that will be launched upon the event

Code:
function addEvent(obj, type, fn){
if (obj.attachEvent) {
obj['e' + type + fn] = fn;
obj[type + fn] = function(){
obj['e' + type + fn](window.event);
}
obj.attachEvent(’on’ + type, obj[type + fn]);
}
else
obj.addEventListener(type, fn, false);
}

removeEvent (obj, type, fn)

Parameters:

  • obj - element that event will be registered to
  • type - type of the event
  • fn - function that will be launched upon the event

Code:

function removeEvent(obj, type, fn){
if (obj.detachEvent) {
obj.detachEvent(’on’ + type, obj[type + fn]);
obj[type + fn] = null;
}
else
obj.removeEventListener(type, fn, false);
}

Usage:

addEvent(document.getElementById('my_elem'),'click',foo);

And that is pretty much it. Just copy and paste it to your project and have fun with it.

Posted at 8pm on 7/22/08 | 3 comments | Filed Under: JavaScript | read on

Lifestreaming

Lifestreaming is a quite an interesting concept. It is loosely connected to the whole web3.0 slash semantic web thing as it is all about aggregating information and data that one publishes on different social sites in one place (application) for others to be able to view your complete online activity.

With all those interesting social sites that pretty much are a part of our lives the idea seems quite cool. I mean I would love the be able to group all my photos from flickr.com, my music from last.fm, twitts from twitter, posts from GregWolejko.com and maybe then I would even start using stuff like brightkite.com or use more frequently web apps like scrnshots.com or flickchart.com.

So why I haven’t been doing this? Or better yet, how can one do this right now?

Well there is one major player right now: FriendFeed and I don’t use it. Why? Hard to say. Basically it is not pretty and it is in fact a whole another social-y site you need to register to.

I was happily living in a world where I won’t be able to actually do a lifestreaming but then all has changed. Enter Sweetcron. A work in progres application (piece of opensource code) by Yongfook that will solve all my problems right there.

Sweetcron will be installable on your own servers (so it will for example be under gregwolejko.com domain) but will aggregate web activity from all over Teh Internet. Sounds pretty sweet. Only problem is that it is not out yet.

Only thing that you can do right now with Sweetcron is sign up for the newsletter to be notified when the product will be launched or see it as a live preview on Youngfook’s site.

Sweetcron is to be 100% free and fully customisable two things I am a sucker for. This will make stuff so much easier as it will be possible to seamlessly integrate it with your current web setup.

While I resisted the whole idea of a lifestreaming in the past now it seems that I will love Sweetcron. It seems that it will fulfill all my aggregating needs. Hopefully it will live up to the hype.

And what about you? Are you on board with the whole lifestreaming concept? Are you doing it? What do you use? Care to share?

Posted at 8am on 7/21/08 | 5 comments | Filed Under: Web stuff | read on

About

Hi, I’m Greg. I make websites. I also make web a better place. One page at a time.

I’m a 25 year old web developer/designer based in lovely Poznan, Poland. By day I’m preaching and evangelizing web standards at Cognifide and by night I turn into pop-culture soaked photography, music and movie lover.

Categories