Friday, July 11, 2014

Case for Code Reviews

I have been doing code reviews for about six months at 3CInteractive.  Since I'm so new at it, it's hard for me blog about "best practices" or even do a presentation on code reviews.  Therefore, I decided to have an open space meetup at our Miami JVM Group.  The open space will be around "effective code review process".  I'm hoping to learn about the following: Who is using it?  Who are not using it and why?  Who thinks they're not useful and why?  What have they learned?  What were some of their challenges?  This post is based on my experience and some of my lessons learned while working with internal and offshore teams.

Benefits of Code Reviews


  • You write better code when you know it will be reviewed.
  • A second (or third, or fourth) set of eyes will help spot defects.  This is very similar to pair programming, but it works even better if you're working with an offshore team.  It's also a great way of learning new APIs.  For example, someone could tell me that my code can be easily done using the Guava library, or that the code is actually an "aggregator" Enterprise Implementation Pattern, and I should probably look at Camel.
  • More than one person understand your code (cross-pollination or avoid silos).  Having more than one person look at your code helps spread the knowledge and context of the problem or solution.
  • Reducing the learning curve for new developers.  I believe that even junior developers should be part of the code review process.  It's a great way for them to learn about the code base and they become more productive.

What To Look For


  • Bad design.  Highlight issues such as SQL injection, look out for lack of design patterns, or anti-patterns.  Things like separations of concern, encapsulation, and apply certain basic OOD principles - DRY, encapsulates what varies, open-close principle, etc.
  • Performance hazard.  For example, memory leaks.
  • Lack of clarity - the application should work and the code should be readable.  For example, a class named "SomethingServiceImpl" with no documentation on the class will be highlighted and will prompt a change request to the developer.  Also, a big nested if statement that is not quiet clear will prompt a change request. 
  • Not consistent or not according to standards.  Having a set of standards makes code reviews a lot simpler.  It also sets a norms for the team.  For example, not using Domain-Drive Development standards, consolidating APIs (Guava vs Jakarta Commons), having a handful of languages, and having a code style rules.

What Not To Look For


  • Premature optimization.  Don't try to optimize all of it at once.  As my buddy Tyler mentions, "make it work, then make it better".
  • Skills and expertise gaps.  In our company, we allow all developer to do code reviews, including junior developers.  These developers gain a lot of knowledge about doing code reviews.
  • Personal style.  If the CTO goes over and says, "I wouldn't do it like that" it bring noise to the process.

Quality and Dissemination of Knowledge 

My team is responsible for improving code quality, lower defects in code, improve communication about code content, and teaching and mentoring of junior developers.  Code reviews has helped us on shorter development cycles, more customer satisfaction, and more maintainable code.  But most important, it has help us spread the knowledge and norms.  As per the book 97 Things Every Software Architect Should Know,
Chances are your biggest problem isn't technical
Most projects are built by people, and those people are the foundation for success and failure.  So, it pays to think about what it takes to help make those people successful.

Tuesday, March 25, 2014

Find Type of Vagrant VM is Running

I am really enjoying Vagrant.  It's one of those tools that are indispensable.  However, today I wanted to install a CentOS VM in my application and I didn't remember the version name that I was using in my other VMs.  To find out, the only thing that you have to do is to check a previous VM.  Here's an example:
vim ~/vagrant_boxes/kafka/Vagrantfile
You will be able to see the version inside the file:

Friday, March 21, 2014

Strata 2014 - Newbie Perspective

Marc Andreessen noticed that software is eating the world.  I see the same thing with Big Data.  Big Data is shaping the world around us.  It has been used on presidential elections, weather reports, consumer analysis/sentiment, fraud check, etc.   Strata conference is the epicenter of new technologies, use cases, and new innovations related to Big Data.  I've been meaning to go there for quite some time.  Previously, I purchased the videos from O'Reilly because I couldn't make it.  Thanks to my current company, 3C (they're pretty awesome), I was able to go along with five of my coworkers.  It's the place where you can meet the experts, the main committers, and ask them questions.  If your eyes get dilated when you talk of Hadoop, or you get exited when you need to solve a problem that has to do with a huge amount of data including the famous "three V's" (volume, velocity, and variety), then this conference is for you.  This is a quick summary of my experience of the conference.

The conference revolved around four clusters:

  1. How quickly can you get the data into your system (ingest)
  2. How fast can you show the results
  3. It's all about presentation (charts)
  4. Big Data doesn't mean Hadoop


How Quickly Can You Get Data


The presentation that left me mesmerized was Spark!  I can't wait to use it.  It is a very compelling product and it's now backed up by Cloudera.  With Spark you can do the following:
  • Get a compute engine for Hadoop data - no need to reinvent the wheel
  • Speed up! A 100% faster MapReduce engine
  • Sophisticated: it runs all the sophisticated algorithms.  Get access to a library of sophisticated algorithms
  • A a big community behind it; the most popular Big Data open source (followed by Hadoop)
  • Learning from the big guys - Yahoo!, Conviva, and Cloudera are using it
Not to mention that it comes integrated with a analytic suite (Shark), a large-scale graph processing (Bagel), and real-time analysis (Spark Streaming).  This is nice because rather than doing Hive, Hadoop, and Mahout, and Storm, I only have to learn one programming paradigm.

How Fast Can You Show The Results


Twitter explains how they monitor millions (+5,700 tweets per second) of Time Series.  The presentation was superb.  I found out that the stack that they're using, named "Observability", is composed on: Finnagle, Cassandra, and query language and execution engines based on Scala.  Although is a work in progress the stack is about three years old.  I hope that they open-sourced it stack so I can get more context on how they monitor a large distributed system.  

Another very interesting product was Google's Big Query.  This was one of those presentations in which we (my team and I) stumbled upon by accident.  The presentation showed how to use Google's toolkit: Freebase, Maps, and BigQuery to do analytics.

It's All About Context, Results, or Charts


Another company that impressed me was Trifacta.  With their tool you can clean data, see the model (graph) and recursively do it again in case you see patterns or not.  The tool is targeted to data scientists, data wranglers, and data analysts.  It's a great tool to mine data data, but most important, you can clean the data and show the results with relative ease.

IPython: This rekindled my interest in Python.  IPythons notebooks are great for data scientists.  You can get code, text, and graphics all in one page, so it's the perfect tool to show quick results.  It's not that Python wasn't a popular language for data scientists.  NumPy library provides a solid MATLAB-like matrix data structure, with efficient matrix and vector operations.  It also provides other great APIs like SciPy and Pandas.

Big Data != Hadoop


Two topics that opened my eyes were Mesos and YARN.  Mesos, what Twitter uses to manage its clusters, is similar to YARN (Yet Another Resource Negotiator).  The Hadoop 2.0, or YARN, it's becoming more of an environment and operating system; not just a MapReduce.  With YARN, the JobTracker is gone.  The ResourceManager is what does the job of the JobTracker.  The ResourceManager (RM) is a scheduler - it allocates resources based on a pluggable scheduling algorithm. RM manages and monitors all the applications, so it strictly limits to arbitrating available resources.

One of our favorite (me and two of my buddies), was Netflix Data Platform by Kurt Brown.  A different and a great presentation.  Rather than going on the technology side, they explained how the culture is intertwined with their technology stack or decisions.  For example, they talked about the reason for using "the cloud".  Obvious reasons like: it's cheaper, much flexible (growth, a better place to do tests/spikes), and having multi data center is definitely a plus.  Also, Amazon and RackSpace have great services such as SQL, EMR, and S3.  But the main reason is "focus".  They are focused on getting movies and increasing their audience rather than to focus on the "plumbing".  They expressed their commitment to "open-source software" (OSS).  They mentioned the great talent that they can get and how they can "manage their own destiny" by following these principles and using these tools.

Netflix explained their philosophy and how it's the "soul" of their decision (technical and business).  For example, they keep keyboards, mice, and other peripherals in vending machines (they are free), so that everyone knows to "act in Netflix best interest".  Furthermore, every decision or project needs to answer a basic question: "what value are you adding?".  They apply the rule "accept that things will break".  Because of this, they build safety nets around their systems.  Again, it was a very nice and interesting presentation.

I really enjoyed the conference.  I also just purchased the videos.  Which I highly recommend!!  During the next few months, I'm going to try to learn some of these tools and present them at the Miami JVM Meetup.  Hopefully I can get to see you there, or better yet, hope to see you at Strata 2015.  If you're going to either one of these events, let's meet up and share a beer...or two and discuss Big Data.  I promise that my eyes will get dilated.



Monday, March 17, 2014

El Dilema de Ser Buen Samaritano o Come Mierda

Siempre me a gustado ayudar a la gente, pero hay veces me pongo a pensar…soy "buen samaritano" o un "come mierda"?  Desde pequeño me gusto salir y hablar.  Mi mamá siempre me dijo que hablo “hasta por los codos”.  Lo que he notado es que ahora, muchas personas me suelen hablar y pedirme por cosas.  Algunas personas se acercan a mi para venderme algo, y otras para ayudarlas.  La verdad es que muchas personas dicen que yo soy un muchacho “agradable”, otras personas dicen que soy “simpatico” (me gusta), yo a veces pienso que tengo cara de "come mierda”.  Por ejemplo, es común que cuando voy a un mall, siempre las personas que tienen una tienda en un kiosco, siempre me llaman, “señor, le limpio el reloj?" o "Joven, tengo esto en especial.”  Siempre termino en decir, “no gracias" con mi sonrisa y sigo adelante, para que…para encontrarme con otros dos muchacho/as que me van a preguntar lo mismo.  Esto es muy común para mi.  Mi esposa siempre me dice que vea abajo para que no me persigan, pero hasta eso!  La otra ves, caminando en un estacionamiento con mi familia, una señora me paro en plena calle y me llamo.  Luego me dijo, “me puedes hacer un favor, se me desamarro mi zapato, me lo amarras?”  Y que es lo que hice?  Pues lo amarre…como buen come mierda.  Para consolarme, la señora era una anciana obesa.  Pero aun así, de todas las personas, tuve que ser yo?  Mi ultima escena de “buen samaritano” fue la otra ves que fui a desayunar con mi familia.  Apenas salí de el carro, un señor me vio y me dijo que su carro lo encerro con las llaves dentro de el vehículo.  Yo se, medio bruto el personaje, pero también yo soy super despistado - lo entiendo.  “Me puedes llevar a casa para agarrar mis llaves de repuesto?  Vivo bien cerca.”  Mi esposa solo me vio, me dio un sonrisa, y me dijo que mientras iba a agarrar la mesa con los niños.

La verdad muchas veces me pongo a pensar, “voy a ponerme así, todo cabrón y mandar al diablo a esa gente”.  Pero no es como soy yo.  Como dije, me encanta hablar!  Cuando hice mi ultima “labor” de buen samaritano, le pregunte a el señor (algo mayor) que cuantas personas le había preguntado.  El me respondió fui el primero, “tienes la pinta de ser amable”.  Yo pensé, "mas bien, cara de come mierda.”

Después de tanto tiempo así, viéndolo en retrospectiva, no solamente me da mucho agrado ayudar, pero también me ha ido muy bien con mis pequeñas labores.  Como dije, se siente bien ayudar a la gente.  Ademas, creo que da un buen ejemplo a mis dos hijos (tengo uno de doce y otra de 3 que cree que tiene trece).  Y más aun cuando lo haces sin pensarlo mucho o pedir algo en cambio.  Aunque nunca he pedido nada, siempre termino notando cosas bonitas.  Como cuando el señor que dejo las llaves en el carro pago mi desayuno, en el caso de el año pasado alguien me compro un par de zapatos de $120, solamente porque tenia cara de buena gente.  Al parecer, a los de cara de come mierda, tiene mucha suerte.

Un abrazo!
Marcelo

Thursday, March 6, 2014

Disruptive Possibilities: How Big Data Changes Everything

I was looking forward to this book because of the title. I was under the impression that I was going to find concrete examples on how Big Data has affected and disrupted some industries. Best of all, I thought that I was going to read what industries will be impacted and how.  The book showed some examples at the end, but in my opinion, it leaves something very important: speed and sophistication. 

I just came back from Strata 2014, which is why I was looking forward to this book, and when I heard Matei Zaharia's keynote, it was all I needed to know about the current disruption of big data. Nowadays, big data storage is becoming commoditized, so the best value added is speed (how quick you can get the answer of your problem) and sophistication (run the best algorithms on the data). The book doesn't mentioned this but it might be because of its age - things are moving super quick on Big Data.

Some of the things that the book does well:
  • Introduces some history about the Big Data problem
  • How it affected some of the silos technologies like RDBS
  • How they solve the scalability issue
If you are a manager or someone that has no understanding of the world of Big Data, then I would recommended.  However, if you are a developer, data scientist, or data wrangler, then this book will be too basic.  The one thing that I highly recommend, if you are interested in this subject, is to attend (or at least purchase the videos) of Strata.

You can get the book here.

Happy reading,
Marcelo

Thursday, December 26, 2013

My best decision of 2013

I started working at 3CInteractive (3Ci) as of March 29th, this is perhaps the best place that I’ve ever worked at.  This is a brief post of why this was my best decision of the year.  I didn’t want to write this post until the honeymoon period was over (usually after 4 months).  There were three factors that helped me make the decision (and why I continue loving) to work at 3Ci: 
  • Culture: I wanted to work for a company who looked at IT as an innovation engine rather than a cost center.
  • Team: I wanted to work with awesome engineers (very motivated, smart, and with a lot of experience).  Also, I wanted to be the dumbestperson in the room.
  • Tackle big harry audacious goals: To be part of a company whose products revolve around big problems that would (without a doubt) have an impact to the bottom line.

I was introduced to 3Ci in 2007 when I was trying to sell a startup that I was working for by the name of Up-Mobile.  The startup wasn’t doing well in the US market, so I was handed the task of selling our customer based to another company.  During that time, I met with 3Ci’s senior management and some of their architects.  Their company was doing some similar things as our startup, unlike us though, they were able to evolve quick and found a potential market with top tier companies and a compelling product.  Many of 3Ci programmers were very involved in open source projects.  For good or bad, I was attached to Up-Mobile and I wasn’t ready to make a move.  Nevertheless, 3Ci left a great impression.  Later down the line, I became the organizer of the Miami Java User Group (MJUG) and Miami JVM Meetup.  3Ci was more than helpful to provide a venue, food, and beverage with no strings attached.  There was a big turnaround of 3Ci employees when I did presentations.  It turned out that they also do a lot of presentations on things that they are doing.  Also, they are committed to open source projects while keeping away from the golden hammer anti pattern - if you have a hammer, everything looks like a nail.  They had the motto of using the best tool for the problem.


Culture

When a lot of people think about the culture of a company, they think about the things that they can see and touch.  When you enter 3Ci, you’ll see the graffiti on the walls, the cool paintings, the guitars, motorcycles, and the free food.  But this is a byproduct of culture.  At 3Ci we have three rules that are unbendable:
  • Build a sustainable company in the emerging market for enterprise mobile services
  • Create a great culture that focuses on the personal and professional development of our team
  • Do important work for quality clients

I came from a couple of small companies or startups (with less than 20 people).  When you work for a small company, you not only know everyone’s name, but you know what everyone is doing and why.  Although 3Ci has more than 100 people, and many of them are distributed, everyone on the team understands what the goals are because of these three rules.  The culture is what promotes the exceptional people working there, the proactive and ownership of tasks, breed result-focused, and the team.  3Ci's culture have created a set of values based on this culture:

We are not in the business for the business alone but for a higher purpose - to make lives better, to solve important problems, and to enjoy what we do. Our Data Scientist, Oliver, once said, “Don’t live a life to do a great work.  Live a great life, and then the great work will follow”.

3Ci strives to be one of the best places you will ever work.
Time and time again, you see that we become either the best place in South Florida to work or America’s most promising company.

We’re in it together
There is a sense of, “let me know if I can help” within 3Ci.  It’s also okay to fail as long as you learn from your mistakes.  The head of our data team, Gabe, once said to me, “Do not do things when you are frustrated or under pressure.  Rather do them when you're calm.  You don’t want to make things worse by doing yet another mistake”.  He is also the first one that holds my feet to the fire when something goes wrong.  The same goes with Alex, my boss and head of the Software Engineering.  It’s not a “don’t let it happen again”.  It’s more like, “We really messed up.  Why did it happen? What’s the root-cause of the problem.  Can we make sure that this doesn’t happen again through some process? Can we automate this issue?"

We’re champions of change
We need to change quickly and adapt.  Anyone with some experience knows this, but the one that are constantly thinking are those entrepreneurs that work at startups.  I learned early on my career that the life a technology company is composed of three: you either go big, stay small, or be eaten.  This was mentioned by Mike FitzGibbon (Fitz), president and cofounder, at the company's "All Hands Call", we need to be customer-centric and be able to quickly and effectively execute goals.


Team

One of the main engineers at 3Ci during 2007 was Alejandro (Alex), and I met him on an open source project (Kannel).  I checked some of his code, and I really like what he was doing.  But the best things about him was his curiosity.  He was a system administrator at 3Ci, yet he was learning Java at that time and committing to Kannel.  I was also a good friend with the one of the main committers and founder of Kannel, Stipe Tolj.  Stipe was also working for 3Ci as a consultant and knew Alex personally.  He told me about some of the things that the company was doing, and I was intrigued to say the least.  After a couple of e-mails, Alex and I pretty much hit it off.  At that time he was working in Europe, then he was promoted and moved to 3Ci (Boca Raton, FL).  The moment that I found out, I immediately sent him my resume.  During my interview, I met a couple of guys: Mauricio and Carlos (Carlitos).  Two of their best architects.  This is another way of knowing how good the company, they had a good technical interview process.  The interview was hard but I did well, so I was hired.  I’ve never looked back.  I highly enjoy it, and it’s the reason of why I make the 1.5 hour commute on Tuesday and Thursday from Kendall to Boca Raton.

One of my favorite quotes is "Hire the most amazing people you can. Communicate goals.  Turn them loose.  Profit."  - Sam Schillance, Box.  One of my rules of working at a job is to be surrounded by great engineers, then see how much they complain about my code.  This is by far why I love this company.  Again, It’s not the graffiti, nor the free food (which is delicious), nor the fact that I work remotely from Miami.  It’s the engineers that I work with.  When I started, I met a few great engineers.  People from my team are former Googlers, people who worked at Bloomberg, current Apache committers, and entrepreneurs.  Just a great set of interesting people who love to code and yet find a way to find a life after work - teachers, band players, great parents, rock climbers, etc.  For the past nine months, I’ve learn more than any other company in my professional career, both personally and technically.  Don’t get me wrong, it’s a very competitive company!  The bar is raised high the moment you are hired, and the expectations are tremendous, but the safety net of the team is why I have a smile on my face every time I come to work.  For example, there are five people that I always turn to in case I have any questions: Gabe, Alex, Tyler, Oliver, and Rob.  In my view, these guys composed the core of the technology of 3Ci.  They have a tons of experience, are highly innovated, smart, charismatic, and a great set of guys.  Together, I call them my G.A.T.O.R team and it’s such a pleasure working with them.


My final interview was with one of the founders and COO, Mark Smith.  One of his questions was, “What do you want to do in the future?”.  I told him that I wanted to eventually start my own company, learn Machine Learning,  and keep running MJUG and Miami JVM Meetup.  He said, “Awesome, we’ll help you”.  Done!  After that, I was asking “Where do I sign?"  Mark and Alex are by far the best leaders that I ever had.  They know when to help the team, and when to get out of their way.  If you worked for more than 10 years, then you’ll know that it’s hard to find a good company, even harder to find a good leader that could be a mentor.


Big Hairy Audacious Goals



Another huge incentive for me was to be able to tackle what James Collins calls, “Big Hairy Audacious Goals”.  Although I can’t say anything about the goals for the company, trust me, they are as big as they are interesting.  This is what motivates me.  The fact that I work with an awesome team tackling some really big problems, help set the path of pushing the envelop as much as we can.  Because of this, we look at other technologies and think outside the norm.  I believe that there is a challenge-to-great-developers matrix
.  In my experience, great engineers gravitate to hard challenges.  This is where I want to be.  I don’t want to work on another CRUD application (been there, done that, got the t-shirt!)  I believe that the best combination of retention of great engineers is to have great challenges for them to solve, have a great culture, and provide the best atmosphere for them.

I’ve always want to work for a company like 3Ci and I’m glad to be part of it.  It’s hard to find companies such as these in South Florida.  3Ci is committed to hire the best.  They are also very much focused on the culture.  The best way that I can describe its culture is using this quote, “When you combine a culture of discipline with an ethic of entrepreneurship, you get the magical alchemy of great performance" - Jim Collins, Good to Great.  I once read that you should choose a profession that you enjoy and that serves as many people as possible.  Focusing on serving others - not on building wealth.  Serve well and money will follow.  I’m glad that this year I was able to scratch that one from my “to-do” list.

Tuesday, June 4, 2013

Functional Thinking Video Review

I view new programming languages like president candidates, I don't trust them.  They believe that by being in office (projects), everything will be better.  When functional programming started its hype I watched from afar.  This was until I was working for a stock trading firm with lots of financial algorithms and lots of multithreaded application.  Before this gig, my languages of choice have been pure Java and Groovy. The world of Scala, Clojure, Haskell, and Erlang was just a bunch of noise. I was skeptical about this presentation, but I am a fan of Neal Ford so I decided to give it a shot.  Overall, I was very pleased with the content mainly because it did not focused on syntax, it focused on context! "Functional" is more a way of thinking than a tool set. For anyone to understand functional programming you need to understand the concepts, and Neal achieved this in his presentation.

 Neal points out the major advantages of using functional programming:

  1. Language Evolution: all major languages are adding functional features. 
  2. Results over steps: create optimized applications to solve a problem rather than using frameworks
  3. Immutability: the freedom of not worrying about the state of the objects - "failure atomicity" 
Then, he elaborates a bit more on the subject matter. For example:

  • First-class/higher-order functions 
  • Pure Functions 
  • Recursion 
  • Strict Evaluation 
If you want to see more, check out the videos here or check this video for introduction.