Embracing Connections at Druid and DrupalCamp 2023
17.05.2023
Sabina Halkic

Embracing Connections at Druid and DrupalCamp 2023

It has been over a year now since I started working together with Druid. Little did I know that this partnership would take me on a trip from my hometown of Ljubljana to the vibrant city of Helsinki, where I met my colleagues from Druid in person for the first time and attended the highly anticipated DrupalCamp Finland 2023. The experience was nothing short of transformative, allowing me to deepen relationships, expand my professional network, and immerse myself in the vibrant world of Drupal.

Feeling the Druid Spirit

Meeting colleagues from Druid for the first time face-to-face was an exciting experience. While we have been working together for quite some time, it was a unique experience to finally meet each other in person. We had built a strong professional relationship, but meeting in person helped to build a more personal connection that goes beyond just work. My Finnish colleagues were all friendly, accommodating and hospitable. They all made me feel very welcome.

Druid’s laid-back spirit was embodied at the office. The working environment was nice and I loved seeing the physical space that houses all the Druids. The office “no shoe” policy was awesome and there was also a cosy room filled with soft cushions, designed to provide a relaxing environment for employees to unwind and destress.

Finnish Cultural Experience

After work, my colleagues took me on a tour of the city centre. We did some sightseeing and we visited some of the top tourist attractions. My favourite was the Ferris wheel where one of the cabins was a sauna. That stood out and I remembered that I was told how much Finnish people love to go to the sauna.

I also had the pleasure of sampling some of the local cuisine, such as munkki and tippaleipä. Munkki’s sweet and fluffy texture was a true delight, while tippaleipä, though its appearance resembled a tangle of threads, surprised me by being also tasty.

DrupalCamp 2023 – A Meeting of Minds

The next day, I attended Drupal Camp Finland, which was an incredible opportunity to learn more about Drupal and meet fellow Drupalists. The event was packed with interesting presentations, and I gained new valuable insights into the field.

I also participated in the after-party – where there was of course a sauna. We were talking about the differences between Finnish and Swedish and I made some comparisons from Slovenia. My colleagues also told me how it is to live in Finland, the different cities and dialects. 

After the first after-party, we had a second after-party where we went to have some drinks. I saw some busy Helsinki nightlife and truly enjoyed myself. 

Until We Meet Again

In this age of digital communication, where virtual interactions have become the norm, there’s something uniquely special about meeting colleagues face-to-face and connecting with like-minded individuals. Thus, I am grateful for this experience. 

Finland, its culture as well as its people were unique and fascinating. I left with a greater appreciation for the country. I gained a lot of knowledge from Drupal Camp Finland, and I was able to experience a new culture and meet my colleagues. I hope to visit again soon and experience more of what Finland has to offer.

Author

Sabina Halkic

Back end developer
08.12.2022
Laurie Lim Sam

How to succeed in your internship and turn it into a full-time position?

In my last post, I shared some personal insight on how to land your first internship. In this post I want to share my 3 best tips on turning that internship into a full-time position. At the time of writing, I am celebrating my first year anniversary as a full-time Druid.

Doing an internship is a sure way of getting a foot in the door. It’s the perfect opportunity to make a lasting impression and to showcase your skills. While you’re doing an internship to gain experience, many companies offer internships to try out and recruit new full-time employees. After a successful internship, you may be presented with a full-time position. On this note, here are my 3 best tips for a successful internship.

Showcase your soft skills

While you’re developing your technical skills, your soft skills will be what makes you stand out. During your internship, the company may assess how well you fit in with the team as well as your ability to learn and grow within the company. To be a good team member and employee, being a good communicator is essential.

Being a good communicator means you are able to promote your ideas, request help, and receive criticism. A good communicator can share their ideas clearly, effectively, and respectfully. They can ask for feedback and ensure that they are meeting expectations. They are also good listeners, which allows them to build relationships and ensure understanding with colleagues and customers. They are easy to work with which helps the whole team move like a well-oiled machine.

Ask good questions

As an intern, you’re expected to ask questions, you’re there to learn after all. However not all questions are created equal. In a software development team, the person who will be answering your questions is likely to be a fellow developer with their own list of tasks. To make use of their time effectively and get the most help, it’s important to be specific and to have a plan of action.

For example, when reaching out for support, you could say “I am trying to do x, I tried a,b,&c. I think the solution has to do with y but I can’t seem to get it. Do you have any ideas or some time to talk about it?” This shows you’ve tried already to solve the issue, as well as shows where your head is at. Even if the plan of action is wrong, the person you are asking has something to go off of.

Be proactive

Being proactive is the most important aspect of a successful internship. Do not just go through the motions, speak up about what you want to be involved in. If you find interesting directions, especially that would help the company and your development as an intern, propose them as your work. This will encourage you to take responsibility for ensuring your work is completed successfully and ask for help in that light.

If you see that you’re about to be done with all that has been assigned to you, try to ask for more projects before you have nothing to do. If you do run out of work and your supervisor isn’t quickly responding with more, come up with something productive or educational to do. At the end of the day, it’s your responsibility to make the most out of your internship.

That’s it, that was the 3 best tips I have for a successful internship. A successful internship makes you an ideal candidate for a full time position. Just one last thing, make sure the company knows you’re interested in a full time position. Even if there’s no available position at the time of your internship, the company will likely keep you in mind once a position opens up.

Author

Laurie Lim Sam

Full Stack Developer
21.09.2022
Laurie Lim Sam

How to land your first internship? – Laurie’s story

This week I was a panellist for a webinar organised by Katapult Mauritius on “How to land your first internship”. Katapult is an amazing Edtech startup in Mauritius where I am originally from. The company helps children learn to code and develop problem solving skills. I’m happy to also share my experience with everyone reading this blog.

Last year, I was an intern at Druid. I applied for a summer internship after the first semester of Helsinki Business College’s full stack development program. I moved to Finland at the end of the year 2020 to study and become a software developer. 

My goals for the internship were to:

  1. learn the process of professional software development
  2. find out if working as a developer was suitable for me
  3. get an edge on finding a position for the compulsory internship I needed to graduate

Having a clear set of goals helped me shape my application and subsequently, my internship experience. I was able to focus on what was important to me.

So how did I actually find my internship?

The first thing I did was to go to LinkedIn; not to search for job postings but to look at my network. Through my school connections, I looked at where my alumni had done their internships and where they were hired after graduation. The reasoning behind it was that the companies who hired them knew about my school and program, and showed interest in hiring junior developers.

Two of my seniors were doing their internships at Druid Oy at that time. This was a company I was familiar with as I had come across it in 2019. Druid was one of the main partners for the full stack development program that year. I went to the company’s LinkedIn page and saw that some employees were fellow alumni. All this signalled to me that the company was open to hiring interns and fresh graduates. I reached out to them via the company’s career page and got an interview.

How to pitch yourself?

When it comes to software development, having a solid portfolio is going to make you stand out. The projects you do in school and in your free time showcase your skills. I highly recommend taking those school projects or tutorials a step further and add your own personal touch. For front-end developers, it can be implementing a nice design you find online. For back-end developers it can be adding some additional functionality. Either way, make sure that the code is readily available in a public repository and that you have at least documented it in README.

Next, consider the transferable skills you developed in other fields or through extra curricular activities. Churning out code is just a fraction of being a developer. Working as a developer means you will be working in a team, and you will have to regularly communicate with stakeholders, such as other developers, project managers and either internal or external customers. Teamwork and communication are soft skills that are not exclusive to software development or even work. You can polish your soft skills in many areas of your life and use them to your advantage when presenting yourself.

What is the mindset for success that helped me, when I was looking for an internship? 

Pasi, our operations lead at Druid, told me recently: “Skills can be taught, attitude is the key”. This sentence was echoed throughout the webinar in various ways. Arinze, who interned at Meta, spoke about being teachable. Amos, a technical recruiter at Microsoft, emphasised the importance of having a “growth mindset”. To me, it all boils down to being curious. If you are applying for an internship, it’s clear that you don’t know everything. It’s normal and perfectly okay to say “I don’t know:” However you should not stop at “I don’t know.” Instead you should say “I don’t know, but I will find out” or “I don’t know, but I will try” . 

The internet is a vast ocean of information. Any problem you come across is rarely unique and if you’re curious enough to search for solutions, you will find them. This blog post, for example, is just one of many results you get when searching for tips on how to get an internship. Then it’s up to you to implement those solutions. Some will work and others won’t but it’s part of being curious and wanting to find out what works.

On a final note, whenever you don’t know something, you can always open your preferred search engine and start typing “How to…”. I do it all the time, alongside “[term I am unfamiliar with] meaning”.

Author

Laurie Lim Sam

Full Stack Developer
09.09.2022

Druid at Assembly – Thoughts from a young enthusiast

Assembly Summer 2022 was held at Messukeskus, Helsinki, in the beginning of August. Assembly has been around quite a while: this time also marked the event’s 30th anniversary, so they were going to make it BIG. And they did deliver. For the first time ever, Druid attended Assembly as an event partner, which as an enthusiastic demo guy, I was naturally thrilled about.

What is Assembly, and why were we there?

Assembly is Finland’s largest computer and gaming festival – Assembly Summer 22 had 18,000 visitors for example. So why would a tech company like Druid, that doesn’t develop games but web, participate in a gaming event of this magnitude? 

It’s simple: Assembly is not all about gaming, but about tech in general. Since the dawn of the event, tech enthusiasts and programmers have been the core group of visitors. In fact, Assembly started out as a rather small demoscene event. And while the event is nowadays more gaming-focused and has grown to its current size (approx. 30 000 visitors every year), they haven’t forgotten their demo roots. They ran some great demo competitions this year.

Personally, I’ve always been a demo guy, ever since my first Assembly. I love seeing all the things that a person can do with just a computer, file and a compiler. It’s even more amazing in the 1k and 4k compos (demo competitions), where the executable file has the size of aforementioned numbers. I’ve been going to Assembly for five years now, never missing a democompo. It was really cool to enjoy one of the highlights of my year and get paid for it!

Let’s also admit that the fact that many of us Druids are into gaming might have impacted our decision to participate. We saw this as a great opportunity to meet like-minded people and get our name out there as a potential place to work.

How was the event?

The event itself was a carnival of gaming, computers and the subculture around them. I’m glad that we were able to bring a touch of Druid’s vibe to that atmosphere. Our stand had a popcorn machine and an arcade booth – both were real hits! I counted that over 400 people came to get popcorn from us, many of them after searching the whole venue for the source of the popcorn smell, and were delighted when they finally found us. Many others came to play, chat – and to sleep on our bean bags and sofas while the stand was closed…we hope you slept well!

We also had Scratch workshops held by two of our amazing druids Marika and Laurie. In the workshop, people got a chance to try and make their own graphic demos, no coding experience needed! We had people participate with zero coding experience all the way to people who do it for a living. There were even two people who thought they were attending a Sketch workshop, but stayed with us nevertheless and were happily coding away in the workshop! We got some good feedback about the workshop, and were happy that the people attending it enjoyed it as much as Marika and Laurie did planning and executing it.

Here are two examples of what the participants did in the Scratch workshops. Both pictures are generated with code. In the first picture you can also see some of the code blocs and the Scratch UI.

Ending notes

Overall, it was really nice to have people come to meet us at Assembly. Our company name and visuals made people curious about who the mysterious druids are and what they do. It was a chance for us to meet people both in and beyond the web development world. Thank you everyone who visited our booth and thank you for all the good discussions! It was a pleasure!

Author

17.02.2022
Marko Korhonen

Technically speaking: Retro 2021

What did the year 2021 look like at Druid, from a technical point of view? What is to be expected this year? It’s time for a brief recap! I’ll go through where we are in terms of tech and tools, and share some of our plans and ideas for the future. Naturally, we always choose technologies according to each customer’s needs – technology is a good servant but a bad master. But it’s also important to keep our tech stack consistent and manageable. Proven and reliable open source solutions is the path of our choice.

Frontend: more and more modern JavaScript

Since we do web development, we use JavaScript – modern or vanilla – in all of our projects. The use of modern JavaScript frameworks has been increasing significantly during the past few years. Currently, we have +10 customer projects with modern frameworks. React and Vue.js are the most common ones, and we also use Next.js (React based) in one project and a Stencil based Design System for a customer who already uses it in 3+ projects. The solutions vary from full Headless solutions to embedded “widget” kind of components.

In addition, we use a modern JavaScript stack for theme and JS building (e.g. Webpack) in most of our Drupal and Symfony projects. In some of our new projects we are experimenting on Tailwind CSS, a utility-first CSS framework.

Backend: mostly Drupal…and something else?

Drupal still maintains its solid position as our go-to CMS solution. Last year we were busy with upgrades from Drupal 8 to Drupal 9, as version 8 reached its end-of-life in November 2021. Almost all of our Drupal 8 projects have now been upgraded.

This year, it’s time to say goodbye to Drupal 7. The end-of-life has been a long time coming, and it’s finally happening in November 2022*. We’ll be having at least four major upgrade projects to re-create Drupal 7 sites with Drupal 9 this year. Upgrading from Drupal 7 is a much more laborious effort than from Drupal 8, because the technological changes between versions 7 and 8 were substantial.

*Edit 24 Feb 2022: Drupal 7’s end-of-life has again been extended by one year to November 2023.

When Drupal 7 is gone, there won’t be major upgrades anymore. Drupal’s product development has shifted to a more modern continuous development process where new features and improvements will be released in a faster cycle, with less upgrade effort. Drupal 10 will be just another version of the same codebase as Drupal 8 and 9. I’d say we could just drop the number and call it “Drupal”.


In addition to Drupal, we have done multiple Symfony projects. They are mostly apps or tools where there is no need for a CMS: time reservations, digital signing, data enrichment, questionnaires, launching sites and APIs. Did you know that also Drupal is just another “app” created with Symfony? On the JS side we are interested in test driving NestJS which seems quite similar to Symfony in terminology and logic. Synergy!

Anything else on the horizon for us? Well, we are planning to test some JavaScript headless CMS solutions to see how they compare with Drupal feature-wise. Serverless is on the table when delivering these apps. I think Serverless is like using a taxi to get from point A to point B instead of owning the car and filling the tank by yourself.

Hosting

Our hosting comes in many forms of Kubernetes. It’s good to not put all the eggs in the same basket so we have sites and apps running in a few Managed Hosting services. But we also have sites on customer’s own environments, e.g. Azure, Google Cloud Platform and OpenShift, and still some sites and apps that are running on customer’s virtual servers.

Tooling and DX

To control all this, one needs tools. And boy, do we have them.

Last year PHP got versions 8 and 8.1 which both improved the language and the performance yet again. Also Composer (the package manager for PHP) got V2 which is way faster. These two combined are actually saving the environment on their part as the energy impact will be smaller!

We have many in-house tools here at Druid. We have aimed for consistent tooling across our projects regardless of whether we use Drupal, Symfony, WordPress, Node8-16, Docker, host, and so on. We run our local development on Docker containers with Stonehenge. We use Make based tools to command our local projects in a common way.

For GDPR-compliant data handling in projects, we created a GDPR dumper solution (which is worth another blog post). For custom environments which our customers might have, like Azure or plain virtual servers, we have our own Druid flavoured Docker images where we run Drupal or PHP apps. As to CI/CD, we are quite omnivorous: mostly Github Actions with Gitlab CI, Azure Pipelines and Jenkins as toppings.

/r/random

New Remote Development tools are something I’m interested in testing this year. It seems there are solutions coming from left and right: Github Codespaces, Jetbrains and Gitpod, to mention a few. With these solutions, the projects are running in the cloud and your IDE is just a window to that. No more running projects on your old war horse laptop!

We are also doing some interesting product development that has something to do with launching sites in high volume. More about that later on – stay tuned!

New experiments

We always keep our eyes open at Druid and like to test new, interesting tools and technologies. Twitter is my source of shiny new tech to experiment on. Below are some new ones, and some that have been trending for a few years already, that we are testing or would like to test. What do you think of these? Any other must try tech that you can recommend? Let me know – you can find me on Twitter!

Do you also have an interest in some of these technologies? And some experience too?

We are looking for new Druids to build a better web with us. Maybe you could be one of them?

Author

Marko Korhonen

Platform Engineering Lead
21.12.2021

Druid is officially a Great Place to Work

This autumn we decided to conduct the Great Place to Work employee survey to see how we have succeeded in building our culture and what our employee experience is like. 

According to the survey, 92% of our people think that overall, Druid is a great place to work. With overall excellent results in the survey, we were granted a Great Place to Work CertificationTM for the upcoming year. We are proud of the results, especially as a GPTW first-timer! 

But even more importantly, we really appreciate what we learned about ourselves from the survey, since our goal is to be an even better workplace in the future. This is something that every Druid can have an impact on.

Our biggest strengths as a workplace 

According to the survey, our top five strongest areas are Integrity, Justice, Collaboration, Leadership Behaviour, and Caring. But what exactly do the words mean? Let’s look at the brief explanations for what these areas measure.

  • Integrity refers to leadership commitment to high principled standards and the ability to take actions based on these standards. 
  • Justice is about management promoting inclusive behaviour and avoiding discrimination.
  • Collaboration measures the management’s willingness to engage employees in collective efforts.
  • Leadership behaviour measures people’s experience with leaders’ behaviour and how it resonates with the company’s strategy and values.
  • Caring measures how managers show an interest in people’s wellbeing, how safe and healthy the work environment is and how our benefits support people’s wellbeing outside of the workplace.

Furthermore, our strongest individual statements in the survey had to do with people feeling safe at the workplace, being treated fairly regardless of their race, and management being honest and ethical in its business practices. Also, people feel they can easily take time off from work when they think it’s necessary. 

Management or shared responsibilities?

What is interesting, and perhaps confusing, about our results is that as a flat, self-directed organization we have very little management in the traditional sense. Yet the areas in which we excel are related to management and leadership. So how should we interpret the results? 

Yes, of course we have a CEO, but mainly just for legal reasons. We have a CTO who jumps in to help with sales or maintenance whenever needed. We also have project managers who look after the day-to-day activities and project work progress. But leadership and management stretch beyond these permanent roles: a significant amount of our work is done in swarms, sort of contextual hierarchies. Swarm members carry a shared responsibility for reaching the swarm’s goal. Anyone can join or leave a swarm at any point. 

Swarms are part of our efforts to steer ourselves towards a self-managing Teal organization. We are all responsible for developing our operations and building the best possible workplace for us – it’s not “management’s” job, it’s up to all of us. We believe that this is reflected in the survey results: management and leadership are distributed throughout our organization.

Everyone can make a difference

When Druid was founded in 2012, the five founders had an ambitious principle. They wanted to create the best possible workplace for software developers. The best, of course, means different things to different people, but nevertheless, their purpose was clear: developers first. When developers are happy, everyone wins. The founding principle remains the same still today.

Druid is equal to us Druids, no more and no less. We develop this company together – everyone is welcome to participate and influence. If someone wants to change, improve or develop something, they are allowed to take initiative and action either by setting up a swarm around that topic or by making a decision after seeking advice from others.

We also have room for improvement of course. Thanks to the GPTW survey, we recognize our weak points more clearly and know where to focus next. But all in all, it’s reassuring to receive validation that we are on the right path in building a culture and ways of working that are just right for us.

Want to find out more about this great place to work? 

Great Place to Work CertificationTM is a trustworthy and globally valued recognition for excellent employee experience, a high-trust culture, and commitment to building a great workplace.

The Certification is granted by a third party, Great Place to Work®. Our employee experience has been researched with a Trust IndexTM employee survey, and therefore the Certification is based on genuine experiences of our employees.

Author

03.12.2021

Better well-being at work through collaboration

How are we doing at Druid? That was what I was wondering in the summer of 2020, just after the borders of the Uusimaa region had been re-opened and the first signs of the new normal could be glimpsed in the horizon. Remote work had altered the social aspects of working life. As the company’s occupational health and safety representative, I begun to reflect on my own and my colleagues’ health and well-being.

After the pandemic overturned our customary habits and routines, the significance of resilience has been magnified when it comes to our well-being. I wondered if we had enough mental capacity to utilize our resources and maintain our well-being in a new kind of working environment. Our occupational health services are comprehensive, but how could we, as a company, work better to support and advance our well-being?

In our occupational safety and health committee’s meeting we decided to carry out a well-being survey and get to the bottom of the issue. Two weeks later I received an email with a link to the results. Slightly nervous, I opened the link, and the result popped up: “satisfactory”. It was a far cry from the results I was expecting. Just a little while ago we were chatting happily in the break room and shooting the breeze on the sofa on quiet days. And now, just six months later, our well-being and motivation was merely satisfactory. This would not do.

Change: more transparency, less bottlenecks

The occupational safety and health committee dug into the results of the survey, looking into both our strengths and our sore points. Remote working had given rise to issues such as lack of transparency, the difficulty of planning the workday and the challenges in following those plans. Was it any wonder, since face-to-face conversations and spontaneous interaction had all but vanished? Quick questions to our neighbours had morphed into Slack messages, meetings at the office into Google Meet calendar invites. No more chatting on the sofa.

We discussed and went through the results, and started breaking down the issues by building hypotheses. We decided to first tackle those issues that, at least on paper, seemed to be the easiest to crack, and we encouraged everyone to take part. Because the transparency we so value did not actualize in a way we were hoping, we examined ways to create such transparency on an organizational level that would make us all feel equal, and would let everyone know where we currently stand and where we are heading. Another issue that was raised was the difficulty of working without getting distracted ¬– there was too much responsibility, constant interruptions and strain placed on certain people. As a solution to this we developed our processes in such a way that would eliminate bottlenecks in the workflow.

In the end, many of the solutions we implemented were concrete and simple. For example, in Slack we started to avoid private messages and instead use the common discussion channels for each topic as much as possible. This led to less bottlenecks, and increased both transparency and shared responsibility. We also expanded the agenda of our Friday meetings, so that we would get a more comprehensive picture of the weeks’ events from all sides, for example covering our projects, sales and recruitment.

New ways of working: shared responsibility and leadership

At the same time while we were contemplating the challenges of well-being, we were also planning the move to a new management model. Even though this change was not sparked by the occupational health survey, the reasons were familiar: the wish to share responsibility and to add transparency. So the shift to a self-managing Teal organization was perfectly in line with our well-being improvements.

Due to our new organizational model, we have very little traditional management. While our CEO, and an occasional wilderness guide, Mikko is still officially the boss, to a large extent we manage ourselves while working on our individual assignments. Our maintenance and small-scale development teams toil away within their areas of responsibility, and our project teams correspondingly work on their own implementation projects.

Well, doesn’t this lead to silos? I guess in theory that could happen. However, we run and develop this company together: we form transparently acting teams (which we call swarms) for different purposes, and anybody can join in. You can also leave the team if you feel you have already enough on your plate. The teams exist as long as they are necessary.

We don’t need individual managers to lead when we encourage everyone to join, and share both the responsibilities and the fruits of our labour together. Everything runs smoothly when the direction and the big picture is clear to everyone. The most important thing to understand is that developing our culture and our operation is a shared responsibility. This is still something we are working on, and it is just a fact that some people have more capacity to contribute in the advancement of common causes than others.

Good vibe, excellent employee experience

Six months later, after the first corrective actions, we sent out the occupational health survey again. This time the average result was “good” ¬– not yet excellent, but good. All the results had taken a positive turn, and clear improvement could be seen in our previous sore points. We were on the right track. All of us in the occupational safety and health committee were happy for the improvements and about the fact that so many were ready to take part in the development of our ways of working.

In the fall of 2021 we decided to examine our vibes from another angle and took part in the Great Place to Work employee survey, which measures the employee experience. Overall, the GPTW results were excellent. 92% of our employees thought that, overall, Druid is a really good workplace, and we were awarded with the Great Place to Work Certification as a recognition of excellent employee experience and a high-trust culture. This is an achievement we can be proud of!

According to the survey our employees especially value our work place culture for its integrity and justice, engagement and encouragement for co-operation ¬– and, as it so happens, our caring attitude that prioritizes well-being. There is strength in collaboration. It is an absolute joy to see that we have managed to build a culture that really fits us. Naturally, this work is ongoing. We have already set our sights on another occupational well-being survey, and our aim is to reach an even better result. There probably is no such thing as perfection in this world, but we’re not in the habit of settling for “good”.

And a bit about recovery

Even though we’ve now lived under a pandemic for quite a long time, or maybe because of it, our resources are being tested from time to time. That’s why it’s necessary to remind oneself, one’s colleagues and one’s employer, that occasionally it’s good to charge up your reserves a bit. If there’s a quiet moment at work, put up your feet and have a cuppa. Let your thoughts wander and give your brain a rest. If, on the other hand, there’s a bit too much excitement going on, don’t push yourself too far. Bring up the issue and arrange a bit of free time for yourself. A healthy employee is a good employee, and a good employee is the foundation for every company’s operation.

Would you like to know more about working at Druid?

Author

17.11.2021

My experience coming from C++ to JavaScript

Having been with C++ for a long time, I’d become comfortable with it. I’d use it both as a scripting language and for building complex desktop applications. Adding Qt gave me powerful tools for creating user interfaces; and I had access to OpenCL for accelerated computing, OpenGL for real-time graphics, OpenCV for image processing, etc. For my needs, this ecosystem worked very well for a long time.

But over time, pressure mounted for me to expand into the web development sphere. So I started learning JavaScript.

In this post, I’ll go over some of the experiences I had coming from C++ to JavaScript, including some of the things that went well and some that didn’t. I’ll try to give a few pointers to people who’re planning to do the same, and hopefully some perspectives to JavaScript developers who might be interested in C++.

First impressions

I had some prior familiarity with HTML and CSS from using them to style Qt components and from dabbling in simple web pages, but I’d never done anything with JavaScript. By this time the language was a couple decades old; the specification was up to about ES9.

JavaScript’s syntax is very similar to C++, to the point that the differences feel dialectal. You get your familiar statements like if, for, and switch; you define functions much the same way (just with dynamic typing); and especially if you’ve written C++ in a procedural style, your program flow may be very similar.

But although the syntactic similarity can ease the transitioning from one language to the other, it’s in some ways a hinderance: things can appear familiar but end up working in an unexpected way, quickly landing you in one of the pitfalls of JavaScript.

The initial pitfalls

There were three notable pitfalls I got to experience when getting started with JavaScript:

  1. Behavior of array indices
  2. Deep vs. shallow copies
  3. The ‘this’ keyword

They all had to do with what on the syntactic level looked like familiar concepts from C++ but in practice turned out to work quite differently.

Behavior of array indices

On the surface, indexing arrays works the same way in C++ and JavaScript: given an array array, you can access its elements with array[0...n]. And this indeed holds true if you only use (positive) integers for the array index. But as soon as you do something like array[x / 2], you’ll run into divergent behavior.

In C++, the result of x / 2 – where x is an integer – is an integer. When you write array[3 / 2], you’ll be getting array[1], and you’re probably very used to it being this way.

In JavaScript, different rules apply. First, the language has no integers, only floating-point numbers. Second, array indices are converted into strings. That means 3 / 2 produces the floating-point value 1.5, which means array[3 / 2] gives you array["1.5"], which in turn will equal undefined in the likely case that the array has no element with the key “1.5”.

For example, in C++:

const std::array array = {10, 11, 12};
// array[1] == 11
// array[3 / 2] == array[1] == 11

In JavaScript:

const array = [10, 11, 12];
// array[1] === array["1"] === 11
// array[3 / 2] === array["1.5"] === undefined (oops)

This isn’t a big problem at the end of the day because you can coax the index value into an integer (e.g. array[Math.floor(3 / 2)] === array["1"]). However, unlike a C++ compiler, a JavaScript engine probably won’t warn you about using a floating-point value as an array index, so until you notice it manually, you’ll get a silent NaN propagating in your program from what at first glance looks to be well-behaved code.

Read more about arrays in JavaScript here.

Deep vs. shallow copies

In C++, I had gotten used to being able to deeply copy plain structs with direct assignment:

struct pod_structure
{
    int array[3];
};

pod_structure object = {10, 11, 12};

// This copies by value, i.e. makes a deep copy.
pod_structure objectCopy = object;

// Since the copy is deep, modifying it doesn't modify the original.
objectCopy.array[0] = 99;
// object.array[0] == 10
// objectCopy.array[0] == 99

This didn’t translate well to JavaScript, where objects are copied by reference:

function data_structure(array) {
    return {
        array: [...array]
    }
};

const object = data_structure([10, 11, 12]);

// This copies by reference, i.e. makes a shallow copy.
const objectCopy = object;

// The copy is shallow, so modifying it modifies the original.
objectCopy.array[0] = 99;
// object.array[0] === 99
// objectCopy.array[0] === 99

I remember being somewhat stunned when I first ported a piece of C++ code to JavaScript and saw that making a deep copy of a plain data structure was actually a bit of a rabbit’s hole. Direct assignment typically but not always copies by reference (JavaScript makes no syntactic distinction between data and reference, so you’ll need to know the spec), certain methods like Object.assign() create copies that are partially deep and partially shallow, and semi-official deep-copying kludges like objectCopy = JSON.parse(JSON.stringify(object)) also have their pitfalls (e.g. JSON.stringify() will silently omit JSON-incompatible data).

One way to get around this issue – a way I ended up favoring – is to use immutable objects, so that you don’t need to care whether a copy is a reference. If you want to modify an object, you create a new immutable object with those modifications, and references to the original object remain as they were. The downside is that this isn’t fully straightforward to accomplish either – you could use the standard Object.freeze() method to make an object immutable, but since it doesn’t freeze nested objects, you’d have to go an extra mile to ensure true immutability down the whole property tree.

(As of late 2021, although the landscape of deep copying in JavaScript remains somewhat messy, support for a standard structuredClone() method has begun to land in browsers.)

The ‘this’ keyword

C++ and JavaScript both provide a this keyword, and in both languages it represents a reference to a particular context. But the mechanics of it can differ in painful ways.

In C++, this evaluates to a pointer that refers to an instance of the class (or struct) in which it’s used:

struct object
{
    object* self()
    {
        return this;
    }
};

object instance;
// instance.self() == &instance == 0x...

// Can't use 'this' outside of a class context.
std::cout << this;
// Compiler: ^~~~ error: invalid use of 'this' in non-member function

In JavaScript, this refers to an execution context and has a much broader domain both functionally and in what values it can represent:

function say_this() {
    console.log(this);
}

const object = {
    initial_this: this,
    say_this: function(){console.log(this)},
    say_this_arrow: ()=>console.log(this)
};

console.log(this);
// "Window {...}"

console.log(object.initial_this);
// "Window {...}"

object.say_this();
// "{initial_this: Window, say_this: f, ...}"

object.say_this_arrow();
// "Window {...}"

say_this();
// "undefined" (in strict mode) or "Window {...}"

new say_this();
// "say_this {}"

say_this.call(document.head);
// "<head>...</head>"

The this of C++ is semantically telling you, “this instance of the class”. The this of JavaScript likewise appears to say, “this context that I’m in”, but means to say, “this branch of execution”, which in turn depends on factors that aren’t visible in the local semantic context. So if you use this inside an object in JavaScript, you might expect it to refer to the object itself, but in reality it may refer to (a) the object, (b) nothing, or (c) anything, depending on how the object is being accessed. For this reason, especially if you’re used to how it works in C++, it’s very easy to mess up this in JavaScript.

I’d recommend ignoring what you know about C++ in this regard and even to avoid using JavaScript’s this altogether until you’re sure you understand what it would do – and why so – in the particular situation you’d use it in. Otherwise it’s too easy to be creating fragile, hard to understand code.

Read more about JavaScript’s this keyword here.

Time to refactor?

After a while of building things with JavaScript, I’d become settled into certain patterns, some of which I later felt best to move away from and some that I chose to keep. Among those patterns have been:

  1. C++-isms
  2. Compensating for the lack of static typing
  3. Easing into the messy package ecosystem

C++-isms

One of the things I most often have found myself refactoring in my early JavaScript code are its in-code interfaces. Often they’ve had a contextually unpleasant C++ tinge to them; they’ve felt clunky or out of place in JavaScript.

For example, since C++ doesn’t allow named function arguments, you only declare paremeter names in the function signature and then call the function without re-declaring the names:

int sum(const std::vector<int> &numbers = {}, const int initialValue = 0)
{
    // ...
}

sum({1, 2, 3}, 5);

I’d port code like that to JavaScript almost verbatim:

function sum(numbers = [], initialValue = 0) {
    // ...
}

sum([1, 2, 3], 5);

The result isn’t outright bad, but in neither case does the call to sum() tell the reader what the arguments mean. The person could assume that the list of values provides the numbers to be summed, and maybe by convention that 5 is the sum’s initial value. But they’d need to look up the function signature to be sure.

By finagling with JavaScript’s syntax (in this case, object destructuring) you can have named arguments:

function sum({numbers = [], initialValue = 0} = {}) {
    // ...
}

sum({numbers: [1, 2, 3], initialValue: 5});

I think the call to sum() now looks and feels more like JavaScript. Even if you disagree or prefer the C++-like way, you’ll probably agree that the C++-style call is more obscure about intent. Besides being more explicit, the destructured version is more flexible to call: you can re-arrange the arguments, and default value initialization doesn’t require a certain argument order either.

Compensating for the lack of static typing

I’d been in the habit of using assertions in C++ to ensure – among other things – the validity of arguments passed to functions. Since JavaScript doesn’t support static typing like C++ does, my asserting extended naturally to checking arguments’ types as well. Something like this:

function func(arg) {
    console.assert(typeof arg == "number", "'arg' must be of type 'number'");
}

Sometimes I’d feel I was being overly pedantic writing type checks in a language made to be dynamically typed. Not to mention each assertion took up more lines of code, required more time to write, and needed to be maintained when the intended type of an argument was changed. Maybe it was an anti-pattern?

Well, I’ve so far decided not to refactor away assertions from my JavaScript code. In fact, I still keep adding them to new code. Consider the following:

function func(arg) {
    console.assert(typeof arg == "number", "'arg' must be of type 'number'");
}

const array = [1, 2, 3];

func(array[1]);
// Runs OK (arg === 2, which is fine)

func(array[1 / 2]);
// Assertion failure (arg === undefined, the array has no key "0.5")

func("1");
// Assertion failure (arg is not a number by strict comparison)

The second call to func() makes the mistake of assuming that integer division in JavaScript results in an integer. The assertion immediately catches the mistake.

The third call to func() is OK in the sense that the function could probably implicitly cast the string into a number and then execute correctly. But still, the function expects a number, so its receiving a string indicates that some other part of the codebase is misbehaving (maybe it’s passing along a stringified number directly from a network response). In my opinion it’s probably better for the long-term reliability of the application that you’re alerted to this.

That said, these assertions are just a roundabout way of shoehorning in a kind of static typing. A more elegant way might be to use TypeScript, which provides an additional syntax layer over JavaScript that includes native-like static types. With TypeScript, we could leave out the manual type assertions and let the TypeScript compiler handle type checking:

// The argument is now of a TypeScript-specific 'number' type.
function func(arg: number) {}

const array = [1, 2, 3];

func(array[1]);
// No errors from TypeScript (the call is OK)

func(array[1 / 2]);
// No errors from TypeScript (but the index bug goes undetected)

func("1");
// TypeScript error: Argument of type 'string' is not assignable to parameter of type 'number'

I’ve used TypeScript for only a short while, but so far my impressions of it are mixed. Introducing static typing can increase the reliability and readability of your code, and TypeScript’s interface system may get you to think about and define your in-code interfaces more clearly. On the other hand, its type system doesn’t always feel solidly integrated with JavaScript, and from what I’ve seen it can add considerable complexity and/or compatibility issues to your build process.

Easing into the messy package ecosystem

Among the biggest elephants in the room has to be JavaScript’s sprawling package ecosystem.

As a C++ developer, I was used to working at low level, carefully managing the dependencies of my applications and often introducing no dependencies at all besides the standard library. By contrast, JavaScript is a high-level language where a typical project may depend on hundreds or thousands of external packages, and whose developer base seems more accepting of abstracting away the lower-level details behind those external dependencies.

When learning React, it’s typically recommended to use the create-react-app project bootstrapper. It sets up a React development environment in an automated way, saving you the trouble of manually doing the boilerplate. The downside is that it also makes your development environment dependent on over 1,500 extra packages.

When I started learning React (I was still fairly new to JavaScript overall), I thought the amount dependencies introduced by create-react-app was absolutely nuts. Why would a hello-world app need hundreds of miscellaneous dependencies? I chose to go against the grain of every React tutorial and learn it without packages or package managers:

<div id="react-container"></div>
<script src="react.development.js"></script>
<script src="react-dom.development.js"></script>
<script>
    const container = document.getElementById("react-container");
    const component = React.createElement("span", {}, "Hello world");
    ReactDOM.render(component, container);
</script>

In this vein, there are no extra packages required, and I didn’t even need to install a package manager. I could build full React apps this way, and they’d be lighter-weight and potentially more secure (or not). But I’d also be missing out on quality-of-life improvements like…

// Creating a nested element with plain React.
divWithChild =
    React.createElement("div", {},
        React.createElement("span", {className: "label"}, "Hello world")
    );

// Creating the same element with JSX syntax (dependent on a transpiler).
divWithChild = (
    <div>
        <span className="label">
            Hello world
        </span>
    </div>
);

…not to mention I’d perpetually be working uphill and against the grain, because create-react-app and the like make things much easier, and most fellow JavaScript developers will be of that opinion.

I think easing into the apparent craziness of the JavaScript package ecosystem was the hardest part about transitioning from C++ to JavaScript. It meant no longer understanding certain aspects of my programs at lower levels. On the other hand, I wasn’t supposed to be working at low level with a high-level language to begin with, and I could be more productive by accepting that.

Future outlook

In my opinion, having first learnt C++ can give you an edge in becoming proficient in JavaScript. C++ offers a lot of freedom but requires a lot of responsibility; it motivates you to try to write well-behaving code because the alternative is a compromised application (or worse). If the motivation to build reliable code carries into JavaScript, it can elevate your work above some of the quirks of the language that might otherwise negatively affect the quality of your work – or at least you might get bitten by those quirks less often.

But experience of C++ can also be major baggage. You might be used to having lower-level control over your programs – for instance, insisting that dependencies be kept to a minimum. In the higher-level JavaScript this may become an anti-pattern that holds you back from being as effective of a developer as you could be.

I personally still use both languages. C++ gives me high performance, syntactic power, and few restrictions. JavaScript gives me first-class networking, a huge platform to distribute on, and a powerful GUI system in the triad of HTML5/CSS3/JavaScript; it can be an expressive, creative language and I often have fun using it.

08.11.2021

Druid offsite week 2021 – together, at last

For a few years now, we have been organizing an annual offsite week in some nice place. This year we chose a cottage (or rather a villa) in Pyhtää that we rented for a week in October. The idea is simple: we get together to work and hang out, without a set agenda. Participation is voluntary of course, but a vast majority of us jump at the opportunity every year.

At Druid we have always been flexible about remote work, allowing people a lot of freedom in terms of where and when they work. Even so, the pandemic has definitely changed things. After a long period of remote working, getting together this year felt perhaps more important than ever.

Finally under the same roof – time for a photo shoot

The joys of joint remote working

We were of course delighted to see each other face to face after a long time. Some of us had never met their colleagues outside of the computer screen so there were many joyful first encounters at the cottage.

Spending a week – or even a day, as people stayed as long as they wanted – with each other in an unusual environment was refreshing in many ways. A change of scenery is always good for the mind, especially in these times when many of us have spent more time at home than we can handle. Not to mention great company. We get to know each other better when there’s time to talk about all sorts of things, not just work.

As for work, simply being in the same room makes it special. Pair programming, solving problems, holding meetings, discussing random ideas – we all know too well by now that interacting through a computer screen isn’t the same thing as being physically in the same place. Being surrounded by co-workers felt like a rare, soul nourishing treat. As Robert put it: “During the week, I had more social interactions than the whole year.”

What about fun and games? Sauna was warming up every evening, along with the hot tub. We played pool, teams against each other. Some of us headed for a nature trail in a swamp nearby. And Simo demonstrated his fire breathing skills! (We were too amazed to remember to record it unfortunately.)

Maintaining the sense of togetherness

For some of us, it was hard to avoid a drop in mood when returning to normal routines after the cottage week, whereas for others, such a socially intensive week was too much in the first place. That just goes to show how different our needs are when it comes to social interaction and ways of working.

Nowadays most of us prefer to work more or less regularly from home, and we don’t seem to be returning to the office to the same extent as before the pandemic – at least not yet. On the other hand, some of us work at the office almost every day. We also have several people who have joined our ranks during the past two years who are permanently working remotely outside the Helsinki area.

There is no one-size-fits-all solution. For us, letting everyone choose how and where they want to work is the only way, even though it means more effort is required to maintain a sense of togetherness. Open communication and an inclusive way of working that encourages people to participate are important. So is sticking to certain routines, such as company-wide weekly meetings.

We also aim to arrange face to face gatherings every now and then. A good way to alleviate the post-cottage week blues is to start planning the next gathering: one month to go for the Christmas party! And while October in Finland can be wonderful, hopefully next year we’ll get to enjoy a slightly warmer weather during our offsite week, wherever we’ll go.

Author

01.11.2021

Working at Druid, according to Druids

In the spring of 2021, we asked our people how they feel about working at Druid, what they value in work, and how they see themselves and their co-workers. Here comes a summary of the answers. Hopefully this will give you an idea of what it’s like to work with us.

Most of the Druids, over 70%, work with software development, the rest with something else such as sales or project management. So in general we can say that Druid is a very developer-oriented company packed with deep knowledge of software development. People really enjoy problem solving and finding solutions.

How is work and management at Druid?

We have a lot of long-term employees a low turnover. Why is that? What makes people stay? Not surprisingly, the answer lies in our culture. Freedom and flexibility, a relaxed atmosphere with nice and helpful co-workers, interesting projects and opportunities – for us, these are the ingredients that make up an attractive workplace. This may sound clichéd, since so many companies are advocating these things nowadays, but our greatest strength is our culture, which actively nurtures these values.

Quite logically, our people consider company culture to be the most important factor at work, along with flexible working hours. Other important factors for us are professional development, the possibility to work remotely, our team and colleagues, and the impact of our work – doing work that matters.

Druid is a self-organized company and we are exploring the Teal philosophy. In practice this means that we have a high level of autonomy and we are accountable for coordinating work with each other. Decisions affecting the whole company are made in swarms that anyone can join or set up. Currently we have over 10 active swarms ranging from tech to strategy, from billing to recruitment. Outside the swarms, any individual can make a decision to fix an issue or complete a task by first seeking advice from others.

What are we Druids like?

We describe ourselves and our co-workers as relaxed and easy-going, skilled and talented people who are passionate about what they do. It also seems that we have two types of people at Druid: those who want to focus purely on coding and don’t want to be disturbed, and those who want to be involved in developing the company and really value Teal and what it represents. And both are totally ok.

Druids have a wide range of hobbies and personal interests. The most popular free time activities seem to be making and listening to music, gaming and coding as well as spending time with family and friends. And the list goes on. We have people who are into art, baking, cars, carpentry, climbing, cooking, fishing, hiking, gym and sports in general, Japanese culture and martial arts, motorcycling, movies, travelling, reading, sailing, walking and yoga.

When we go deep into what really matters in life, our people value honesty and integrity, freedom, fairness, equality, and family. These are the values that unite all of us Druids as human beings.

Edit: Our CTO Marko would like to add that ice hockey belongs to our hobby list as well 😀

If you feel that you can relate to these thoughts and could see yourself working with us, don’t hesitate to get in touch. We are always interested in getting to know new colleagues!

Author