Skip to content

Slim and Angularjs compatibility issue

Hey,

I was trying to use these two together and my issue was to use the first angularjs declaration:

html ng-app

Slim was then doing something weird related to “en” locale. To make it work, do:

html ng-app=''

That shall do it.

mjs: a javascript nested function dsl to generate html

Hi there!

It has been a long time since I don’t blog. I’m in Dallas working in a project for ThoughtWorks, which means I’m away from Brazil, friends and girlfriend. That gives me time to hack around. Lately, following my interest in node.js and an idea that another TWer, Paul Hammant has been promoting for some years, I’ve started working in a javascript dsl to generate html. It would be possible to run that in the server-side: generating html and sending it to the client; in the client-side: sending ‘only’ javascript to the client; and most probably in a hybrid fashion: escaping the js code that you want to run in the client-side and running everything else in the server-side.

What I’ve done is in my github account, along with a simple js testing framework that I’ve made to warm up (it gives you hamcrest-like assertion, with ‘assertThat’ and matchers). So far, it is possible to write code like this:

require('./src/mjs-core');

console.log(html(
    head(
        title('Something')
    ),
    body(
        div({id: 'content'}, 
            h1('A title')
        )
    )
));

will output:

<html><head><title>Something</title></head><body><div id='content'><h1>A title</h1></div></body></html>

If you have tidy installed (sudo apt-get install tidy) you can run it through the run script, and get an output like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
<head>
  <meta name="generator" content="HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">

  <title>Something</title>
</head>

<body>
  <div id='content'>
    <h1>A title</h1>
  </div>
</body>
</html>

So I hope you can take a look at that and help me with that stuff! I’m looking for a way to integrate it into a node.js web framework, like expressjs, and also a way to pass some lines of code instead a tag to another tag in a more elegant way. Now you can do that trough an anonymous function, but it’d have to return a string or a function that returns a string, so I’m thinking in a way to make it more flexible. There is an example of that in the ‘example.js’ file in the repository. It also needs a better name – mjs stands for markup javascript, but I don’t like it.

Cheers!

Duda.

TWU week 3: the tech side

Hello!

So, here in India things are going fast! There are two ThoughtWorks offices here in Bangalore: B-1, inside the Diamond District (the amazing apartment complex where we TWUer’s are staying, A on map), and B-2 (B on map).

So, right now, TWU days starts at 8:15 AM, when we have a bus to take us from B-1 to B-2. At B-2, day starts with an Indian breakfast with masala omelet, some bread and my indian favorite, sambar, that for me is the ‘taste of India’. And after breakfast, we must work…

The day starts with a maybe-to-long stand up meeting. We stand up to keep it short, and then everyone has the chance to talk about what he/she did in the previous day, and what he/she is planning to do in the current day. This is when you can ask for help if you’re struggling at some specific problem. But if you forget about it, you are able to ask for help anytime during the workday, you just have to communicate. We work in ‘dinner tables’ (no cubicles at all!), and everybody has its personal laptop, courtesy of ThoughtWorks, so you can move around. The codebase is owned by the entire team, using svn. We also have a Continuous Integration server that give us a baby laugh when the automatic build is successful or a baby annoying cry if it is broken. This keeps everyone updated when it comes to the app status, and if something goes wrong, everybody knows right away.

Right now, we are developing a kind of social network to keep track of ThoughtWorks story, seen through TW employees’s eyes. We’re using the Spring MVC Java framework, a huge hard-to-understand ugly thing, full of java annotations, where you have to code an elephant to get a mouse. For a guy that loves Ruby, it can be a little bit painful… but OK, I’ll survive. It was our first week in the project, so it has been more learning, configuring and suffering then adding value to our app.

Things that I’ve learned this week:
Evolutionary Databases: how to keep your database evolving during the project. In waterfall projects, people spend way too much time to design the entire database. In agile, we start the database with the first migration, that contains all it had to contain at that moment. When I need to modify the database, all I have to do is to create another migration. Migrations should run automatically with your build script. Each migration must provide a way to get the database back to the state of the previous migration. This way, you can chose where you want your db to be.
Hibernate and Spring: Those guys can work together to give you what you need in a Java MVC app. Spring gives you the controllers to map your urls to the business logic, and the business logic uses Hibernate as an awful way to abstract the database. I still don’t like it. We don’t have consistency between Spring versions, we’re mixing concepts from 2.5 and 3.0. This, for me, is BIG technical debt. But is hard to choose: version 2.5 is xml based; every configuration goes in xml files. 3.0 is annotation based, which can make your codebase really ugly. I do like the annotations the most: at least you keep everything in the same place.

However, when I think about it, it seems to me that Java, Spring and Hibernate are not the answer to a social network project. They are too heavy and clunky! What should we use? I’d go with Django, and in ThoughtWorks we could had it in Ruby on Rails. Right now I know why are we using that clunky thing: we’re in a training program, and Java is a common language between the attendees of our program. However, I really want my next project (first real project) to be in RoR. I just love the Ruby way! But this is subject to another two hours trying to write something interesting. 🙂

Duda.

ThoughtWorks, TWU and India: first impressions

It has been two weeks since I’ve joined ThoughtWorks in the Brazilian office. I’ve spent one day in the office, in a “New Hire Orientation” regime. It was really nice to get to know some of my new colleagues and to get the fell of the ThoughtWorks way. But I had something bigger coming: I had to get on an aircraft in the 15 June to arrive at Bangalore, India, at 17 June. Yes, TWU was starting that very moment. Or it should be…

Well, if you know me, you also know that I can always do something stupid. Yes, I’ve missed my first flight. 🙂

Anyway, I went from Porto Alegre to São Paulo, then to London and finally to Bangalore. At the time that I arrived at Bangalore’s airport, I got the feeling that the air in Bangalore had a different smell.

India is completely different from Brazil, there is no way to compare. This was something that I was expecting, so I was open-minded from the very beginning. How can you get the best of a completely new place if you don’t open your mind?

Then I’ve gotten to know my new colleagues. People from US, UK, India, Australia and I, the only crazy geek Brazilian in the house. And then TWU finally started. Oh men, I’ve waited so much for this moment, and the same feeling was clearly on the face of my peers.

Since then it has been (hard work + fun). ThoughtWorks is a great company: everybody is friendly, everybody is extremely competent and everybody loves free food. ThoughtWorks has values, is agile and get the job done. And we, TWU attendees, are learning by failing (the best way to learn!) how do we do that.

What about India? It is colorful, mysterious and has great (really spicy) food. What about our TWU trainers? They are clever, prepared and friendly. What about the TWU attendee? We are all different, but we know that. And our diversity is also our way to overcame the situations that we are facing. Can’t wait to start our project simulation.

You can find photos of my trip @ http://picasaweb.google.com/dudassdornelles . I’m trying to constantly update that.

Cheers!

Duda.

Hi there!

Hi everyone!

This is my starting post at this blog. I’ll introduce myself:

My name is Robson Dornelles, aka Duda, I’m 23 years old brazilian guy. This year I have acquired my degree in Computer Science and started the journey to get a Master of Science degree. However, that journey wasn’t making me happy, so I’ve started to look at new possibilities. And then I’ve found ThoughtWorks.

What happened is that I’m a new hire from ThoughtWorks Brazil, and I’m also the first ThoughtWorker form the brazilian office to go the the ThoughtWorks University (TWU), in Bangalore, India. TWU is an imersion course with 6 weeks duration, where I believe we are going to learn a lot, in an enviroment where we’ll be challanged and reviewed. So its gonna be FUN! I’m very glad of this opportunity that ThoughtWorks gave to me.

So thats my history in this moment of my life. My trip to India starts next week and the TWU starts at 18 june. And I’ll be sharing my experiencies in this blog. 🙂

So thats it! Cheers!

Duda.