Jan Varwig

  • Profile
  • Projects

Fizzbuzz in Haskell

February 4, 2013

Getting into the groove again.

Apparently this thing does not care to preserve whitespace. View raw for great justice.

Continue reading

Gabe Newell: Reflections of a Video Game Maker

February 3, 2013

Continue reading

How to do nested views in AngularJS (Hint: Don’t)

January 12, 2013

Starting to use AngularJS in November was an eye-opening experience. Angular does application architecture like would have done but with a level of polish and refinement that I could never have achieved.

That said there was an issue I encountered early that also comes up from time to time on the AngularJS mailing list, namely that of nested views. Angular has facilities to watch the location/history and control an ngView directive in response, but it only supports one ngView per app. How could you build a nicely structured application with that when you have nested levels of hierarchy?

It took my a while to realize that I was think in the wrong direction, coming from a Backbone project and doing years of Rails development.

Views are not what you use to structure your application!

In fact, views are more of a crutch, a shortcut, to create structures similar to traditional websites, only with angular as a driver. When developing a web application, the way to deal with complex interfaces is to use, in combination:

  1. Scope objects/variables that store your desired view state explicitly
  2. ngSwitch directives on this view state
  3. Directives to include custom templates/perform complex DOM manipulation behavior

Stop thinking of your application in terms of views that need to be loaded. That kind of thinking aligns better with imperative frameworks but doesn’t work well in angular.

Think instead of components that fulfill a particular purpose. Define the components as directives, passing objects into your components, manage view state explicitly using simple objects or single variables in your scope. Angular is declarative and data-driven at its heart. Therefore decisions over what to display belong in the directives really, either as part of your linking functions or as ng-switch directives in the templates. They should never be managed in a controller although that seems to be what many people instinctively try to do when getting started with angular.

Defining multiple views that are manipulated imperatively goes against the core concept of angular.

Those approaching angular with concepts from other JS frameworks will have a hard time realizing the full power of Angulars clean separation of concerns.

UPDATE: I’ve written a follow up to this Article here

Continue reading

To new shores

December 24, 2012

After almost five years, I quit 9elements at the end of October 2012. This wasn’t easy for me as I have been the company’s second full-time employee, knowing them from the beginning, and accompanied Sebastian, Eray and the rest of the team through good times and bad. Seeing an agency grow from a bunch of friends hacking in a tiny apartment to a company with more than a dozen employees within a short timeframe through creativity and craftsmanship was thrilling and I’m proud to have been a part of this. During this time, 9elements was never just an employer, they were dear friends and I’m glad they still are, even though I’m not working with them anymore.

Developing software there was my first actual full-time job after leaving university. I’ve never worked for anyone else (not counting several short internships during my school and university time) so after five years I felt the need to go out and make new experiences. Despite always wanting to, I never managed to leave the Ruhr area and go to Berlin. At every occasion, there was always something or other that held me here. After school, I decided to go to TU Dortmund to study with a classmate. During my studies, I was too busy to make the move and towards the end of my diploma, it was clear that I would join 9elements.

But now, in September, an opportunity presented itself to join Sascha, Paolo and Stephan at Thriventures, a startup working on a promising cloud based content-delivery solution, and move to Berlin. This was a tough move, pretty uncommon for me, as I’ve always been someone who likes safety and comfort, but now that the decision is made I’m excited and looking forward to use my knowledge and experience to develop a great product in a great team.

At Thriventures I do primarily frontend development. In the future I probably won’t be writing and talking about Rails anymore, but instead try to spread my love for AngularJS and my frustrations with Javascript ;)

For now, I’m working from home most of the time, waiting for my girlfriend to finish her bachelor thesis. In April we will finally move to Berlin.

Looking forward to meeting you there.

Continue reading

Why Coding is and is Not The New Literacy

July 7, 2012

Literacy is a direct method of communication. Coding is an indirect medium of communication. When a child learns to read and write, that iconography is directly applicable to all mediums of visual communication. The child can take a pencil and paper, a paintbrush, word processing software, or a stick and some sand and convey any information or idea that is within their powers to articulate. Their communicative ability is limited only be their language. They can also absorb information through equally diverse channels.

The ability to code offers no analogy in this regard. Coding is essentially the processing of information, such as mathematical representations of reality (units and volumes) or sensory-dependent data such as written language and images and sound.

The ability to code does not confer the ability to communicate directly, but rather to newly organise pre-existing modes of communication such as language, images and sound. While new hardware and software will ultimately offer potential to interact in new and exciting ways (video telephones, brainwave sensing, etc), the programming of these innovations are not the communication that these innovations offer. Your grandmother does not need to know how to code a thought-transfer device in order to kuse the thought-transfer device that coders will ultimately help develop.

Coding is not the new literacy because it will never be a requirement that every man, woman and child must know how to code in order to communicate fully. It is a function of the development of communication, not its application. As such, it is more true to compare coding to skills such as book-binding, or newspaper printing. It is sufficient for a relatively small proportion of the population to understand it in order for its benefits to accrue.

I understand the value of coding. It is good and necessary that coding will become more widespread and less alien to average people in the coming decades. But those who compare it to literacy do not understand the value of literacy.

– Pierce Gleeson

When people describe programming as “the new literacy” they don’t mean that programming fulfills similar cognitive purposes, but that programming replaces literacy in forming a new intellectual gap and in that regard, the observation is right.

Actually for this argument to work, we need to define the term “programming” a little better. The important bit is not to “be able to program a computer”, but instead to have an understanding of how algorithms process information and how the workings of our world is more and more shaped by machines and mathematical abstractions. Little, specialized parts that work together, adhering to strict rules to form new, more powerful capabilities.

If studying computer science has tought me one thing, it’s how to break down problems into parts, strip away unnecessary elements until its essence lays bare and a solution almost presents itself. This is the core qualification of computer science. Internalizing this way of thinking changes how you approach everything.

Almost anyone can read nowadays but not that many people have generic problem solving skills. Programming is at its heart formalized, applied structured problem solving, combined with a bit of syntactic knowledge about whatever language you happen to use. You don’t have to have a programming education to be able to program.

Being able to do something and actually doing it are different things, the important bit here is to be able to program. You almost automatically acquire this ability whenever you occupy yourself with structured thinking, in science or business.

In a society obsessed with information and efficiency there’s no denying that efficient problem solvers have an advantage as much as the literate few had over the illiterate in the past.

Continue reading
Prev Next

Impressum/Datenschutz

Powered by Jekyll with Type Theme