• Learning for the Masses

    Humanity now has an unprecedented opportunity for learning. Not only do we have the classic ways of learning like attending a university or reading books, but now we have a new generation of online resources ranging from online video to sophisticated online tools enabling people around the world to learn nearly anything for little to no cost. With a time and motivation you likely could attain the equivalent to a college degree.

    In the last couple weeks I’ve had the pleasure of starting the Functional Programming in Scala course from Coursera. So far I’ve been very impressed with the quality of the course and enjoyed learning to think functionally.

    The course is setup so that each week the students watch recordings of the professor lecturing and then do homework. The homework is submitted via a terminal script and then automatically graded within about 10 minutes. Because of the automated nature of the grading, the class can have far more students than any normal college class. The last time the class was offered over 50,000 people signed up!

    The great thing about courses like this is that anyone can sign up, you don’t have to fork over thousands of dollars, and you can take the course from anyware – no need to sit in a classroom.

    Cousera is only one of many new online tools people can use to learn. edX, Khan Academy, MIT Open Courseware, DuoLingo, Codecademy, and JustinGuitar are just a few popular sites where you can learn a wide range of topics but many more are available (check out NoExcuseList!).

    When you start looking at these available resources you’ll quickly notice they take very different approaches to teaching. Some, like Coursera, attempt to replicate the traditional class format and have lectures to watch and due dates for assignments. Others take more of a “go at your own pace” approach where there are no due dates and you can do the work and learning on your own time. Both ways have pros an cons. If you lead a busy life and have very little free time then being able to work at your own pace might be the best. But for others, having a due date for assignments and having a sense of keeping up with the rest of the class may provide some incentive to stay caught up and meet the deadlines.

    Because these new ways of learning are still in their infancy, many challenges have not yet been met.

    One challenge being worked on is how to let students get credit for completing a course. Coursera gives students a certificate upon completion but it is hardly college credit. Many of these online courses are equivalent to what you’d get in at a fully accredited university yet once the course is completed, no college credit is given. One might argue since the course is free or cheap, it is an acceptable trade off. That said, for employers that want an employee to have a degree, a list of equivalent courses taken online is unlikely to be a good substitute. Coursera has begun to explore giving credit for some courses but there is still a long way to go.

    Another challenge is that because of the often massive class sizes, it is nearly impossible to get the same kind of tutoring or one-on-one time with the professor. This can be mitigated with other tools like forums where students can talk with other students and with the professors but it isn’t quite the same. There is a risk of students being left behind because they can’t get the help they need to work through a problem or get feedback.

    Student retention seems to also be a problem with some of these online resources. Due to the low cost and ease of signing up for a course we may simply be seeing people who would not normally sign up checking it out only to find it isn’t their cup of tea and abandon it. Another possibility is that some students may be getting stuck and not able to get the help they need. More investigation should be done to find out why many students don’t finish the online courses. Maybe a survey at the end of the course sent to the students that didn’t finish could be beneficial.

    One thing is certain though, despite any problems, it is an exciting time for those who want to learn!

  • Javascript and jQuery Tips

    I came across Paul Irish’s 10 Things I Learned From the jQuery Source screencast today and found it quite interesting. He delves into some of the inner workings of jQuery as well as a few nice tips for plain old Javascript. Rather than telling you myself, I’ll just let him do it. I’ve embedded the screencast below. In addition, I’ve embedded Irish’s presentation slides from his presentation “jQuery Anti-Patterns for Performance & Compression”. It also has a few good tips and some new jQuery functionality that I’m going to try out. If you have some time, take a look at both as they have some good info.

  • Effective Communication of Software Requirements

    What is the most effective way to get a customer to clearly explain the requirements for software? Time and again I fail to fully get the full set of requirements from my customers or get an incorrect interpretation. It isn’t that I don’t ask questions or that the customers don’t give me details, but rather it seems that the different perspectives on the requirements lead to many misunderstandings from both parties.

    I’m not trying to nail down every requirement up front - just attempting to get an accurate representation of the requirements I do ask for from the customer. It often seems that a each party understands a particular requirement differently which leads to confusion, frustration, and stalled projects.

    Perhaps using more detailed scenarios where the customer can give a step by step description of how they expect the software to work. Maybe having them give a more visual representation of the software using pictures and flow charts. Perhaps better questions. Maybe a combination of all the above. I wonder if certain methods work better with certain customers?

    Either way, there must be a better way to collect requirements.

  • Scala Named and Default Arguments: A Sticky Situation

    I love named and default arguments. I’ve been using them for years in ColdFusion and find them quite useful. It is a wonder more languages don’t support them. Scala 2.8 has both as new features. Here is an example of the usage.

    class Person(
      var firstName: String = "Dustin",
      var lastName: String = "Martin"
    )
    
    // Use named arguments
    val person = new Person(
      firstName = "John",
      lastName = "Doe"
    )
    
    // Or use the default arguments
    val person = new Person
    
    // Or mix and match the two - lastName uses the default of "Martin"
    val person = new Person(
      firstName = "John"
    )

    As you can see this is a very simple class with two properties. I’m very fond of these new features and both can serve to simplify your code.

    But not all is well when using named arguments. Lets say you have a class and start off using names arguments for the constructor.

    // Use named arguments
    val person = new Person(
      firstName = "John",
      lastName = "Doe"
    )

    No problems yet. But lets say you need to add a custom method for firstName to return “foo” instead of the actual firstName

    class Person(
      var firstName: String = "Dustin",
      var lastName: String = "Martin" ){
    
      def firstName = "foo"
    }
    
    val person = new Person(
      firstName ="John",
      lastName = "Doe"
    )

    As soon as you run this you find the compiler throwing an error. The problem is that variables and methods share the same namespace. In other words, methods and variables can’t share the same name. Consequently, if a custom method is needed, the variable – in this case firstName – must be renamed. This poses a problem if you have already started using named arguments.

    // The above would need to be...
    class Person(
      var _firstName: String = "Dustin",
      var lastName: String = "Martin"){
    
      def firstName = "foo"
    
    }
    
    val person = new Person(
      firstName = "John",
      lastName = "Doe"
    )

    But this still will not work either. The problem is that when the person object is instantiated, the argument firstName is referenced. It no longer exists though. Only _firstName exists. So to fix this we are stuck renaming firstName to _firstName every time a new person object is created. But that seems like a poor solution. We don’t want to have to change all of our code every time we need to update a class.

    So what is the solution to the problem? I’m not sure. Always prefixing variables with underscores or some other character? Not using named arguments? Something else? Right now I’m inclined to simply not use named arguments – at least not for constructor arguments. That way I can change firstName to _firstName and create my custom method without having to update my code. But it would certainly be nice if named arguments could be used in constructors without having to worry about this. Perhaps there is another solution that I’m not aware of. Seeing as how Scala is still a fairly new language, and version 2.8 hasn’t even been officially released, a lot of best practices have yet to be established. It will be interesting to see how the Scala community decides to handle this sticky situation.

  • Thoughts on Event Driven Programming

    What is Event Driven Programming? In the context of ColdFusion, the way I see it is as a way to loosely couple different components from each other by announcing when important moments happen (events) in an application and letting other components register interest and then receive notification via some kind of even manager. This way, components do not really know about each other, only about events that may happen in the system and only have the even manager as it’s dependency rather than any number of related components.

    Does that make sense?

    Just recently I began thinking about event driven programming in the context of ColdFusion. The idea is very appealing to me. Being able to have many of my components be loosely coupled and not having to worry about injecting as many dependencies seems quite nice. Not to mention being able to very easily add new features to an application without having to inject some new component into a bunch of existing components or having to mess with AOP seems lovely.

    The trick though is how to go about creating an event driven architecture (EDA) and then how far to take it in an application. Do you try to use EDA to completely decouple every component or just use it for auditing and similar cross cutting concerns. For instance, is it possible to decouple a DAO from a service so that a service merely announces an event and the DAO registered to listen for that event takes action, saving or querying? It seems that saving is one matter since it doesn’t typically involve any return value. But what about querying? Obviously the DAO would need to return results but how would that be accomplished?

    This leads to another question. What happens if an event fails? Or succeeds for that matter? Is it possible to notify the original component and should I? I have no idea. It seems that might be pretty tricky. Asynchronous events seem much easier to handle.

    The place I really see event driven architectures succeeding though is with things like sending emails, logging, auditing, etc. Crosscutting concerns that need access to many facets of an application. This poses the question though: what about AOP in matters like this? There seems to be some overlap in the two areas. But, as is always the case, it seems some times using an event driven method would be better and likewise, sometimes using an AOP method would be better. I’m curious to know what other uses there are that would be a good fit.

    As with any new thing, it is possible to go completely overboard and overuse it, but I’m leaning to a more subdued approach for the time being. Using events to drive things like auditing seems like good approach for now until I understand it more. I am however, excited to seem what new uses I can come up with.

    I’ve been taking a look at Sean Corfield’s Edmund framework and it is pretty interesting. I’m definitely going to investigate it further, work up some tests, and see how it goes.