Switching Themes Programmatically in Drupal 8

Sometimes we need to use different designs for separate pages or for separate menu items in a site. The most obvious way to perform this task is to set separate templates for each case in the current theme and customize CSS and JS for these pages. But there is another way, which is a less complex front-end solution. We can use a different theme. I used this solution for the first time in Drupal 5. My team worked on an informational resource about the state of Colorado, and each county had a different design. To resolve this discrepancy, we used the Taxonomy Theme module. Read more

Java’s Anonymous Inner Classes: Proceed With Caution

Java’s anonymous inner classes can be useful, but you must take care when using them. In particular: A memory leak will occur if an instance of an inner class survives longer than its containing outer class because the inner class maintains a reference to its outer class. This is not a merely academic concern, this comes up in Android development when we use inner classes to encapsulate and pass around some code, and instances of an outer class (Activities) can be constantly created and destroyed. Read more

Exploring South America

Speed and Function Works Hard, Plays Hard Recently we spent a month exploring South America. In that month, we visited Brazil (the north, the south, and the Amazon River), Peru (Lima and Cusco with Machu Picchu), Bolivia (La Paz, Santa Cruz, and Salar de Uyuni), and Paraguay (Asunción). We arrived in São Paulo, which is a municipality located in the Southeast Region of Brazil. Read more

Exploring the Balkans: Budva

I have always dreamed of a job that would allow me to travel. Many people around the world dream of the same thing, but most of them are swamped with work and the demands of everyday life. Eleven years ago, I was lucky to become a web technology specialist. Choosing this profession gave me hope, since many people in the industry are not bound to specific locations where they are expected to work. When I began working for Speed and Function, my dream finally came true. Last year, I stayed for a few months in Montenegro, a small country located in Southeastern Europe, in the western part of the Balkan Peninsula. Read more

Drupal for Front-End Developers

I’ll say it bluntly: Many Drupal projects look like a real mess from the front-end point of view. The reason is simple. Front-end developers know how it should look but don’t know how to change templates. Back-end developers know how to change templates but usually are not good with the front end. What do we get as a result? Read more

Communication is Almost Everything

I spend a lot of time walking around my apartment and thinking about various topics. One day, in the middle of my living room, I remembered my call with a client that was planned for the following day. The current sprint was almost done, everything was going well, and on this next call the team and I were going to discuss the scope of the next sprint. Everything was going to be great! Fast forward to the call… Read more

Why Agile?

Much has been written about the Agile methodology, and we are not here to say anything new.  Essentially, Agile marries the values of the business world with the values of the engineering world, and allows them to coexist happily and collaborate with minimal conflict. It allows software engineering shops to make their living, and it lets businesses get their products. Companies that either deliver or consume software engineering services and have not adopted Agile are destined to live in pain and drama. Read more

MVC vs. MVVM: Pros and Cons of Single-Page Applications

There’s been a ton of writing on the subject, so while I can’t say anything unique, I’d like to post this for a discussion, both internally and with our clients. Historically, we’ve been going with MVC most of the time, especially for MVPs, where time to market and low cost is of an essence.  However, MVVM presents a few advantages when you are building for years to come. I like MVVM better than MVC in a form of complete isolation of FE from BE: run a RESTful API server with whatever back end platform there is (Ruby on Rails, Node.js, Java, .NET or Django) and a completely separate JavaScript application (Backbone.js, AngularJS or React) running Read more

Why test automation and continuous integration?

Test automation is essentially taking existing test cases and making a computer do them instead of a human being. Test automation is usually part of continuous integration.  We would run Jenkins on a new instance in AWS. Every time an engineer commits new code, Jenkins runs all of our Cucumber test cases against it automatically, without the involvement of a single human being. This way, if any commit breaks anything anywhere in the system that’s covered by the automated tests, the error will become visible immediately and will be fixed before we even get close to a release date. The advantage of this approach is that you don’t have to wait to accumulate a bunch of features so that Read more

When being lazy is actually a good thing

“Practice not-doing and everything will fall into place.” – Lao Tzu Recently I encountered a small and funny problem that I’d like to share with you. Imagine there is a model Trivium (question: string) and a model TriviaAnswer (trivium:references, answer:string, is_correct:boolean). Essentially they represent a question with related answer options. There is also a word document containing data to be loaded. It looks something like this: Read more