Vincent Fleetwood
·
Mon, 01 Aug 2016 20:04:47 +0000
You could fill a book on programming styles. And some people do. The guidelines for coding in Java, my language of choice, are fairly fluid but there is usually a general consensus of opinion on most topics. One topic of...
Vincent Fleetwood
·
Mon, 25 Jul 2016 21:06:20 +0000
Using the Streams API means thinking of your Collections in a different way. We looked at mapping from one type to another in the last post here but in this tutorial I want to show how we take our Stream and only deal wi...
Vincent Fleetwood
·
Fri, 15 Jul 2016 21:30:05 +0000
The Streams API in Java 8 is a big change in how to use collections of objects in Java. The for-loops typically used through code is now replaced with various new patterns for iteration, transformation / mapping and filt...
Vincent Fleetwood
·
Sat, 28 May 2016 22:01:26 +0000
The instructions have changed a bit for starting with the Play! Framework for the first time so here I revisit how to get it working for the first time. Installing Play / Activator Go to the Scala Play site here: https:/...
Vincent Fleetwood
·
Thu, 26 May 2016 19:55:58 +0000
This is a different take on the Hello, World! example seen elsewhere. In it we will call a method to get this String and then print it. It should serve as an example of the terse methods we can write in Scala. Looking at...
Vincent Fleetwood
·
Wed, 25 May 2016 04:23:24 +0000
One of the big things that’s different in Scala is that defining variables is simpler. Just the name will do, Scala will work out what type of variable by what you put in it. Here are 3 examples. The first is a con...
Vincent Fleetwood
·
Tue, 24 May 2016 04:36:18 +0000
This is a basic way to iterate through a list in a style not too different from Java’s. It shows how for loops work in their simplest form. Output:
Vincent Fleetwood
·
Sat, 21 May 2016 08:16:10 +0000
This is how to get a sublist in Scala and very similar to the new Streams API in Java. The idea is you have a list and only want certain members of that list. In this example I only want values in it above a certain thre...
Vincent Fleetwood
·
Fri, 20 May 2016 23:31:56 +0000
This is another method of adding to a list in Scala. You don’t change the original list but create another list using the ::: operator. The only problem with this is that you are creating a new list with the single...
Vincent Fleetwood
·
Thu, 19 May 2016 19:09:05 +0000
This is an important part of the Scala learning curve – dealing with Collections. This is the quick and easy method for Java developers. The ‘Scala way’ is long winded and I will cover in another post....