689 karma · joined February 26, 2009
Not true.
(def $ js/jQuery)
(.append ($ "body") "hello world")
The reasons you'd use Dommy over jQuery are outlined in the original post.I worried at first that my lack of a degree would make it hard for me to find a job in the Bay Area, but the market is incredible right now. If you're good enough, it doesn't matter if you have a degree. I managed to find a great job with people I have fun working with. Sometimes I forget I'm getting paid for it.
Reader, your mileage may vary. College is great, but it's not for everyone. I got a lot out of my three years (especially studying abroad -- if you can afford it, do it), but I knew I was ready for something else. The other path turned out great for me.
The stateless way would be to return an entirely new Swift_Message instance with each setX method. In languages that aren't built with immutability in mind, like PHP and Java, you end up instantiating and throwing away a lot of objects. Sometimes it doesn't matter, but when it does you use a mutable Builder to create the immutable instances.
It can be worth it, though. I used state machines for a client-side UI in ClojureScript a few months ago. It forced me to think hard about the structure and flow of the app. But after that, my state was in an explicit, contained area. If I had been using something like Backbone, the state would have been hidden among the various model objects. I felt like I had a much better mental model of how the program worked after the initial design process. Keeping state in control reduces complexity. [1]
Another benefit was that the state machine library I used allowed me to audit the trail of states as they happened. When a user toggled a checkbox to trigger an event, I could look in the JS console and see the moment the checkbox was triggered. If something wasn't working, I could often debug it by seeing if the states and transitions happened in the right order. I wouldn't be able to do this with a traditional MVC framework.
There's one very important thing that nobody has mentioned yet: state machines look ugly in your code. When they get big, they are difficult to follow. I started out using a state machine library that was just too simple. Once the interactions became complex, I was getting lost in my code. I looked for a clearer, more succinct way of modeling state machines, and eventually I came to Harel statecharts. [2]
Statecharts are a way to model state machines without explicitly writing out a ton of redundant states. The number of states becomes a problem when you actually try to model an application with a basic non-deterministic FSM. If you're interested in using state machines in your web application, you need to read the linked paper. The example of modeling a digital watch with statecharts makes it easier to see how you could use them in a web app.
I believe statecharts are to MVC as Clojure is to every mutable state language out there. It feels weird at first, but once you get used to it, it's much simpler. It's just not necessarily easier. [3] If you want to try them out, there's a good library called Stativus for writing statecharts in JavaScript: https://github.com/etgryphon/stativus/
[1] See "Out of the Tarpit" for why state and complexity are closely related: https://dl.dropbox.com/u/249607/all/Out%20of%20the%20Tarpit.... (The original link is down, so I made a mirror.)
[2] The original article on statecharts: http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Stat...
[3] More about the idea that simpler things are not necessarily easier: http://www.infoq.com/presentations/Simple-Made-Easy
The site reports that in the US, IE6 has 0.6% market share — relatively nothing. But look over at China: 22.4% of its 500 million Internet users still browse with IE6. Moving forward benefits the Internet as a whole, but the Chinese market is one instance where backward compatibility is important.
In some languages, like Java, you're stuck in the OO style of programming because its syntax and features make anything else too cumbersome. Clojure actually works the other way around: though the most common style is functional, it's easy to work in terms of objects. It might not look the same as Java OO, but that's for the better.
Here's a good book about switching between programming styles within a single program: http://www.amazon.com/Concepts-Techniques-Models-Computer-Pr...
If ClojureScript were ported to the JVM, maybe it would replace the current Clojure compiler as the official implementation. Clojure-in-Clojure would be further along, and implementations across host platforms would share a larger portion of code.
> I never spoke out 'against' TDD. What I have said is, life is short and there are only a finite number of hours in a day. So, we have to make choices about how we spend our time. If we spend it writing tests, that is time we are not spending doing something else. Each of us needs to assess how best to spend our time in order to maximize our results, both in quantity and quality. If people think that spending fifty percent of their time writing tests maximizes their results—okay for them. I’m sure that’s not true for me—I’d rather spend that time thinking about my problem. I’m certain that, for me, this produces better solutions, with fewer defects, than any other use of my time. A bad design with a complete test suite is still a bad design. (http://www.codequarterly.com/2011/rich-hickey/)
Another question to ask is does this help others understand the problem? You often don't write tests for yourself, but for other people, including the later you that has popped the problem off the mental stack long ago. Writing tests might lose you time right now, but the net gain of time saved by others may make up for it. Let me emphasize the word "may", because you might make the problem clearer by writing documentation in English rather than code. So the only conclusion is that it depends, it depends...
Any of Brian Eno's ambient stuff
The Field - From Here We Go Sublime
The Field - Looping State of Mind
Luomo - Vocalcity
Boards of Canada - Music Has the Right to Children
Boards of Canada - Geogaddi
Pantha Du Prince - Black Noise
Burial - Untrue- Faster.
- Includes a most recently used list.
- Creates files with <c-y>.
- Automatically :cds to the project directory using Git or a dotfile.
However, there were a couple problems I had to fix myself:
- Doesn't follow symlinks, though it did in the older versions. This should be a config variable.
- Breaks on filenames that have spaces.
Those issues aside, this is great. Thanks!
Some of my favorites:
http://doylepartners.com/project/hypertext/index.html
http://doylepartners.com/project/david_byrne/index.html
http://doylepartners.com/project/thinking_fingers/index.html
My programming career started with Webmonkey's PHP tutorial[1], when it was first published some years ago. It doesn't talk about floating point operations or binary representations. Instead, you first learn how to print "I am the CHICKEN MAN" in your browser. Shortly after, you're taught to use forms, and by then you've created something that takes input and processes it.
You type your stuff in, click the button, and it shows up in the browser. The code you wrote -- this strange language that seems like magic -- clearly works. You've made the machine do something. Just to make sure, you type something else in, click the button, and there it is. That's what inspired me to become a programmer. The ones and zeros came later.
[1] http://www.webmonkey.com/2010/02/php_tutorial_for_beginners/ (I don't recommend this tutorial to anyone learning to program. It was useful when it was written, but it's not up to date, and some of the examples are broken. In 2011, there are lots of good beginner books.)
Are there any good existing resources for learning these things?