Scala from Scratch: Understanding is the second in a series of two books that teach you the Scala programming language. Readers that have read Scala from Scratch: Exploration or have learned some Scala trhough other means will get a deeper understanding of the language features and underlying functional programming concepts that have been explored in the first book. You will also learn about important advanced language features that play a crucial role in many real-life Scala projects. While ...| danielwestheide.com
Scala from Scratch: Exploration is the first in a series of two books that teach you the Scala programming language. Readers that have some experience with an object-oriented or imperative language, like Java, Ruby, or Python, will get a comprehensive overview of what Scala brings to the table. The goal is to get you excited about Scala and give you a strong foundation for writing your first applications and continuing your journey. By the end of the book, you will have a good idea of what it...| danielwestheide.com
If you have visited my website before, you will notice that things look a bit different from what they used to now. This is because I finally took the time to get rid of Octopress, the static-site generator on which my website was based. In doing so, I took the opportunity to rewrite the HTML and CSS as well. If you're interested in why I put so many hours into replacing something that seemed just fine, read on.| danielwestheide.com
One popular way of testing in the Scala community is property-based testing — by generating random, often unexpected test data, it can uncover shortcomings in our implementations. In this talk, you will learn about a completely different approach, mutation testing: By mutating your code, it tests your tests and tells you a lot more about the quality of your tests than metrics like code coverage. We’re going to cover what mutation testing us, how you can use it in your Scala projects, how ...| danielwestheide.com
In this talk I want to challenge some of the fundamental assumptions of how we think and work. With all our sophisticated engineering, are we actually solving the right problems? Are we rushing towards technologically exciting solutions too quickly? How much of the complexity in our software is inherent in the problem domain, and how much of it is of our own making? We may have honorable intentions, but do our solutions come at an acceptable price? Maybe it’s time to slow down, think about ...| danielwestheide.com
Scala is one of the most popular alternative languages on the JVM. In this talk, we are going to look at what makes this language so interesting: A strong foundation in functional as well as object-oriented programming, combined with a powerful type system. We'll look at how these principles have shaped the language and how to put them to use in practice.| danielwestheide.com
For the past 15 months, I have been working on a new library on and off. So far, I have been mostly silent about it, because I didn't feel like it was ready for a wider audience to use – even though we had been using it successfully in production for a while. However, since I broke my silence as long ago as April this year, when I did a talk about it at this year's ScalarConf in Warsaw, a blog post is overdue in which I explain what this library does and why I set out to write it in the fir...| danielwestheide.com
Apache Spark has become the de-facto standard for writing big data processing pipelines. While the business logic of Spark applications is often at least as complex as what we have been dealing with in a pre-big data world, enabling developers to write comprehensive, fast unit test suites has not been a priority in the design of Spark. The main problem is that you cannot test your code without at least running a local SparkContext. These tests are not really unit tests, and they are too slow ...| danielwestheide.com
In 1999, Andrew Hunt and Dave Thomas, in their seminal book, demanded that programmers be pragmatic. Ten years later, Chad Fowler, in his excellent book on career development, asked programmers to be passionate. Even today, I still consider a lot of the advice in both of these books to be incredibly valuable, especially Fowler's book that helped me a lot, personally.| danielwestheide.com
Developers who are new to Scala often shy away from coming into contact with implicits, and by extension, understanding typeclasses. In big organizations that have been adopting Scala at scale, you sometimes even come across hard rules that put a ban on the use of implicits because that language feature is considered to be too advanced and not understood by a lot of developers. On the other hand, implicits and typeclasses are used heavily not only by a lot of the most important Scala framewor...| danielwestheide.com
When it comes to typeclasses and implicits – the mechanism used for implementing this pattern in Scala – there appears to be a big gulf: They are widely used not only in many popular Scala libraries, but also in the standard library. On the other hand, many Scala developers are not familiar with them or find them too daunting.| danielwestheide.com
Developers who are new to Scala often shy away from coming into contact with implicits, and by extension, understanding typeclasses. In big organizations that have been adopting Scala at scale, you sometimes even come across hard rules that put a ban on the use of implicits because that language feature is considered to be too advanced and not understood by a lot of developers. On the other hand, implicits and typeclasses are used heavily not only by a lot of the most important Scala framewor...| danielwestheide.com
Recently, I tweeted about an observation I have made a couple of times in various Scala projects:| danielwestheide.com
When the access patterns of a service are such that there are a lot more reads than writes, a common practice for scaling it horizontally is to have the service talk to a master database only for operations that result in state changes, while all read-only operations are performed against one or more read slaves. Those read replicas are only eventually consistent with the master.| danielwestheide.com
Providing a great web API means being a well-behaved citizen of the web, and hence, to play nicely with all the other citizens out there: Browsers, caches, proxies, crawlers and so on.| danielwestheide.com
Building applications that follow the REST architectural style can be quite cumbersome. Like most other web frameworks out there, the Play Framework does not support you a lot in building well-behaved web APIs. On the other hand, it makes implementing not-so-restful HTTP APIs super easy. As a consequence, developers choose the path of least resistance.| danielwestheide.com
Every developer hates build tools, and because of that, we tend to configure our build by copying snippets from the intarweb instead of trying to understand our build tool. This is no different or even more so the case with SBT, which is some ways is fundamentally different from other build tools.| danielwestheide.com
SBT has been the subject of quite a bit of controversy among Scala developers. It's different enough from other build tools that not everyone has the patience of really getting into it. As a natural consequence, they tend to either go back to the build tools they know or employ sbt in a way that is similar to what they are used to and doesn't require them to fully understand it.| danielwestheide.com
In this talk, I gave an introduction to the underlying concepts of the Event Sourcing, CQRS and Memory Image patterns and one might go about implementing them with the tools available in the Scala ecosystem, specifically Akka. In the second part, I presented the Eventsourced library, demonstrating how it makes it pretty easy to develop an event-sourced application with Akka.| danielwestheide.com
Event Sourcing, CQRS and Memory Image are architectural patterns that often go hand in hand, and they have a strong following in the .NET community. Unfortunately, solutions found there and in existing Java frameworks follow a very object-oriented approach. However, the very ideas behind these patterns, especially event sourcing, are a natural fit for a functional programmer's mindset.| danielwestheide.com
As I have already hinted at in the previous article, the Neophyte's Guide to Scala is coming to an end. Over the last five months, we have delved into numerous language and library features of Scala, hopefully deepening your understanding of those features and their underlying ideas and concepts.| danielwestheide.com
In the previous part of this series, I introduced you to the second cornerstone of Scala concurrency: The actor model, which complements the model based on composable futures backed by promises. You learnt how to define and create actors, how to send messages to them and how an actor processes these messages, possibly modifying its internal state as a result or asynchronously sending a response message to the sender.| danielwestheide.com
After several articles about how you can leverage the Scala type system to achieve a great amount of both flexibility and compile-time safety, we are now shifting back to a topic that we already tackled previously in this series: Scala's take on concurrency.| danielwestheide.com
In last week's article, I introduced you to the idea of type classes – a pattern that allows you to design your programs to be open for extension without giving up important information about concrete types. This week, I'm going to stick with Scala's type system and talk about one of its features that distinguishes it from most other mainstream programming languages: Scala's form of dependent types, in particular path-dependent types and dependent method types.| danielwestheide.com
After having discussed several functional programming techniques for keeping things DRY and flexible in the last two weeks, in particular function composition, partial function application, and currying, we are going to stick with the general notion of making your code as flexible as possible. | danielwestheide.com
Last week's article was all about avoiding code duplication, either by lifting existing functions to match your new requirements or by composing them. In this article, we are going to have a look at two other mechanisms the Scala language provides in order to enable you to reuse your functions: Partial application of functions and currying.| danielwestheide.com
In the previous articles, I discussed the composable nature of Scala's container types. As it turns out, being composable is a quality that you will not only find in Future, Try, and other container types, but also in functions, which are first class citizens in the Scala language. | danielwestheide.com
In the previous article in this series, I introduced you to the Future type, its underlying paradigm, and how to put it to use to write highly readable and composable asynchronously executing code. | danielwestheide.com
As an aspiring and enthusiastic Scala developer, you will likely have heard of Scala's approach at dealing with concurrency – or maybe that was even what attracted you in the first place. Said approach makes reasoning about concurrency and writing well-behaved concurrent programs a lot easier than the rather low-level concurrency APIs you are confronted with in most other languages.| danielwestheide.com
In the previous article, I discussed functional error handling using Try, which was introduced in Scala 2.10. I also mentioned the existence of another, somewhat similar type called Either, which is the subject of this article. You will learn how to use it, when to use it, and what its particular pitfalls are.| danielwestheide.com
From November 2012 to April 2013, I created and published a blog series called The Neophyte's Guide to Scala, targeted at aspiring Scala enthusiasts who have already made their first steps with the language and are looking for more detailed explanations.| danielwestheide.com
When just playing around with a new language, you might get away with simply ignoring the fact that something might go wrong. As soon you want to create anything serious, though, you can no longer run away from handling errors and exceptions in your code. The importance of how well a language supports you in doing so is often underestimated, for some reason or another. | danielwestheide.com
For the last couple of weeks, we have pressed ahead and covered a lot of ground concerning some rather advanced techniques, particularly ones related to pattern matching and extractors. Time to shift down a gear and look at one of the more fundamental idiosyncrasies of Scala: the Option type.| danielwestheide.com
In the previous part of this series, I gave an overview of the various ways in which patterns can be used in Scala, concluding with a brief mention of anonymous functions as another place in which patterns can be put to use. In this post, we are going to take a detailed look at the possibilities opened up by being able to define anonymous functions in this way.| danielwestheide.com
In the first two parts of this series, I spent quite some time explaining what's actually happening when you destructure an instance of a case class in a pattern, and how to write your own extractors, allowing you to destructure any types of objects in any way you desire.| danielwestheide.com
In the first part of this series, we learned how to implement our own extractors and how these extractors can be used for pattern matching. However, we only discussed extractors that allow you to destructure a given object into a fixed number of parameters. Yet, for certain kinds of data structures, Scala allows you to do pattern matching expecting an arbitrary number of extracted parameters. | danielwestheide.com
More than 50,000 people signed up for Martin Odersky's course "Functional Programming Principles in Scala" at Coursera. That's a huge number of developers for whom this might have been the first contact with Scala, functional programming, or both. | danielwestheide.com
For the past seven weeks, I have been participating in the online class "Functional Programming Principles in Scala" provided by Martin Odersky, the EPFL, and Coursera. This has not only reignited my more or less dormant passion for the Scala language, but has also been tremendously fun and instructive at the same time. Having just finished the final assignment, let me tell you why.| danielwestheide.com
Last Monday, at the August meetup of Bonn Agile, I did a talk about architectures based on the CQRS pattern. I presented various opportunities enabled by this pattern, specifically asymmetrical scaling, separating the models for reading and writing, eventual consistency, and event sourcing. I also put up some very crude demo code in Scala to show how one might implement a command handler and a write model handler, and how easy it is to build the current state of an aggregate from the events s...| danielwestheide.com
Many books have been published about the technical aspects of software development, and, granted, a lot has been written about how to successfully manage IT projects and about why and how to apply certain agile methodologies. Yet, you hardly find any literature dealing with the human factors of software development, neither does it play a significant role on any of the computer science curricula that I know of. | danielwestheide.com
Last weekend, I attended the Advance Hackathon 2012, which was hosted at the Coworking Space Gasmotorenfabrik in Cologne. Even though I had been intending to participate at such an event for a long time, this was indeed my first hackathon. | danielwestheide.com
I have been intending to start blogging again for a long time. Now I have finally managed to put this into practice. I am a maker of software, and my plan is to primarily blog about my experience as well as opinions on various aspects of the software development process. But from time to time, I will certainly put on the user hat and write about the intricacies of human computer interaction from that very different perspective.| danielwestheide.com
This blog post is a text version of a talk I gave at Lambda World Cádiz on October 25, 2018, for those who couldn't attend and don't like watching video recordings. Thanks a lot to Jan Stępień for encouraging me to publish a text version of my talk.| danielwestheide.com