![]() In layman’s terms – a function is something which when fed some input data, produces an output. But what does that mean exactly? To answer this question we first need to understand what a function is. First of all, each function must be a pure function. But these functions must usually adhere to some strict rules. Functions, functions, and once again functionsĪs you may have already noticed, functional programming is all about functions. It runs on a Java virtual machine (JVM) which makes it compatible with all byte-code-related languages such as Java, Kotlin, etc. Scala has been around for nearly 17 years, gathers together a big community all around the world, and is also accompanied by lots of frameworks and libraries which simplify the development process even further. Its strong type system and conciseness make it one of the most pleasant languages to work with. Scala is a strongly typed programming language designed with functional principles in mind. In this article, I’m going to introduce the main concepts behind this paradigm using the Scala programming language (In fact this was the language chosen as the Ruby replacement by Twitter :)). There are lots of remedies for the problems stated above but fortunately, there is also a programming paradigm that simplifies this process a lot and it’s called functional programming. In their case, they needed to shift from using Ruby language because it lacked native thread support, which was a huge performance bottleneck. Another company that faced some issues, in this case, with a rapidly growing user base, was Twitter. This improved scalability and the stability of their platform. What they did was to refactor their entire application to separate microservices. ![]() As an example, Wix.com had a lot of stability issues due to its monolithic architecture. The solution here is to design and implement applications that are multi-threaded (utilizing all cores in the processor) and fully distributed. ![]() To keep pace with the rest of the world, companies need to adapt. Muli-threaded and fully distributed applications Unresponsive services will soon lose users, who will probably turn back to the competition, eventually possibly causing the entire business to shut down. Modern applications have to handle incoming requests at a rapid rate. For some time now, processors have already been shipped with more integrated cores rather than faster clock rates, which have a significant impact on application performance. Unfortunately, even these languages cannot escape the limitations which processor manufacturers are facing nowadays. The cause here is the off-the-chart popularity of “write once, run anywhere” – type languages. Nowadays, software engineers don’t need to get their hands dirty with most low-level programming concepts, such as direct memory management or handling different processor architectures. Let’s start with a few words on why I want to talk about functional programming in Scala (as an example).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |