The Blog

JDK9 REPL JShell – this is some exciting stuff!

A couple of years ago I worked in a project with a Python backend. As I had only used python as a script language before I soon grew to really love the powerful interactive console that let me explore and learn the language (and which saved me a few hours of debugging every week). The interactive console is the thing I miss most when I’m in my Java codebase, but fear not, with JDK9 we as Java developers will also gain the benefit of a REPL!

repl

If you have 3 minutes over, take a quick look as I scratch on the surface of JShell

JDK9 is out in early access so check it out!

Over n out
@olbpetersson

Continue Reading

Refactoring Legacy – A Google Guice Story

One word that sends shivers down most developers spines is ‘Legacy’. There are many different kinds of legacy-systems and obstacles that they impose. Legacy exists on a scale; on one end there are systems that you don’t want to touch because no matter what you do, they will most likely implode. On the other end there are systems that only have been mistreated code-wise or architecturally but actually have some kind of potential and can be refactored iteratively and improved upon. Some legacy-systems could be at their end of life while other will continue to live for a long time.

Not so long ago, i was a part of a team that got a legacy application assigned to us. This legacy-system was probably somewhere down the middle on the ‘legacy-scale’ and there were no plans to replace it. The perfect victim for some refactoring and improvements! Not only for the sake of the system but for the sake of the developers that are going maintain the application and introduce new features.

[…]

Continue Reading

Välkommen till Javaforum 26:e april

Mer information och anmälan till mötet. The meeting is sponsored by contribe 17:00 Registrering & mingel 17:30 Välkommen Tomas Trolltoft & Rikard Thulin, Squeed 17:31 Mine you own software We all strive to create better software and this presentation will focus on how to identify weak spots in the code to refactor and even predict the future. By mining software repositories

Continue Reading

Streams

In his talk at JFokus titled “Java Streams: Beyond the Basics“, Simon Ritter introduces us to streams which were added in JDK 8. It was a good introductory talk, aimed at those with little experience in the functional programming paradigm. To start with, let’s take an example of old pre-Java 8 style code as well […]

Continue Reading

Why, why, why, why? Measure.

Why? According to me this is the number one question that you will continously have to answer when working with software. My experience is that people are very often really good at answering this question...one time at the start of their project! Then it gets lost in translation. In bigger projects, the people who answered the first why might not even still be in the project. So we need to keep "whying" as we go through the project.

So when should we ask "why"? Well...always. Whenever we introduce something new, this new thing will (hopefully) bring benefits as well as some quirks. That will always be the case, just in the same way as the thing that you are currently having or doing is having it's own benefits and quirks. Therefore, whenever you are doing improvements in any area, we've established that the first thing we should do is to ask why. The second thing we should ask is "how do we measure this?".

If you are changing your process, your tooling or even refactoring

Continue Reading

Observing Reddit with Angular 2

While a large portion of JFokus was aimed towards Java development, some JavaScript did find it’s way there. One of those JavaScript lectures that I went to was given by Gerard Sans and the topic was asynchronous data streams Angular 2, which at the time had just entered beta. Rather than providing you with a recount of what Gerard said I figured that I could provide you with a slightly more hands on demonstration of asynchronous streams in Angular 2 by looking at a small application that searches /r/pics for a given phrase. The application is a slightly rewritten version of what can be found here https://www.youtube.com/watch?v=JPuqluYYa-o, with some changes made in order for it to work with the current version of the beta. The

Continue Reading

Designing for Performance

Do you think about how you should write your code to make it perform well? Do you think about good performance as in making compiler hacks in your code and optimized algorithms? In his awesome talk named "Designing for Performance" at JFokus 2016, Martin Thompson argues that if you follow clean code principles, chances are you already are designing for performance. While getting the fastest code possible still might require careful min-maxing, bit shuffling and hacks, you get a long way towards decent performance just by having clean code, and a good model of your problem. A lot of it comes down to understanding the big picture of the problem you want to solve. A very common trap is making local optimizations when the best solution might have been to make another design. You have probably heard the term "Premature optimization is the root of all evil" . This is actually very accurate in describing the most common pitfalls that cause developers to make bad performing

Continue Reading

Squeed – lending Oracle a hand

As enforced by Swedish Law (Jante) I'm hereby adding a disclaimer that this post may contain bragging elements

During the past week we were 15 Squeeders who travelled to Stockholm to attend JFokus (expect a cascade of blog entries to appear here in the near future). Leaving JFokus on wednesday, inspired by all the great speeches, on the train home I began to fiddle a bit with Java 8 and CDI. The idea was to use the Supplier-interface to trigger Observer-methods where each of these methods could implement their own business-logic. I quickly came up with this example: https://gist.github.com/olbpetersson/305276d7c4fec847a413

However, I was unable to keep going on my endeavor. For some reason, typed Suppliers, e.g. Supplier< String > weren't triggered when I fired those events. After a lot of debugging I gave up and realized that this was way above my head. So of course the natural reaction

Continue Reading

JEE7 application servers – recommended read

Ever heard something in the lines of "xx application server is too much overhead"? Well, how much is too much? Antonio Goncalvez has made a nice summary of the different Java EE7 servlet-options at his blog. If you are interested in what your applications are running on, check it out!

Continue Reading

NDC London 2016 Fredag

DSC_1201 Sista dagen på NDC London började på ett liknade sätt som
Continue Reading
Newer Entires

Besök squeed.com

Subscribe