Styling without CSS
Posted on | December 22, 2009 | No Comments
Well, not quite. The idea is to get rid of static CSS files and have the styling in a JavaScript file, in the form of JSON. Defining the styles using JavaScript is quite powerful and flexible as well, especially when combined with a good selector engine like jQuery. JSON stylesheets explains the benefits of using JavaScript for styling. There are some downsides to that approach as well.
- It will not work when JavaScript is turned off. The fallback should be a CSS file that comes close to what the JSON stylesheet does. Maybe some tool can create the CSS file from the JSON stylesheet automatically.
- If you are using an editor like Dreamweaver, auto complete features do not work with CSS written as JSON objects. Again, there can be a tool that takes in CSS (which can be created easily with your favourite editor) and creates the JSON stylesheet which can be used to add additional logic or complexity.
Is it really necessary to push styles onto JavaScript? Imagine a photo blogging template that changes its theme depending on the photo being displayed (I believe such themes already exist). Such a theme can be easily implemented using JSON stylesheets. We just need more tools around this idea for us to start using it instead of plain old CSS.
Pursuing Computer Science as a major
Posted on | December 1, 2009 | 1 Comment
There’s a good thread in Hacker News that’s about pursuing Computer Science as a major. Interesting opinions about who should pursue CS and why.
I believe that pursuing a CS major would help even if you are not looking to be a programmer or a technologist. It helps you build good math and logic skills, which will be extremely useful in any field you choose to be. Just to be clear, being a CS major does not guarantee great coding skills.