by kornel@synkre.com | Jul 25, 2019 | Programming Tips
What are the benefits of lock free non-blocking code? Traditional Java programming uses mutex locks to give mutually exclusive access to resources. How can immutables and snapshots be used to write code without these locks. What libraries exist that provide algorithms...
by kornel@synkre.com | Jul 25, 2019 | Programming Tips
The Java Virtual Machine (JDK) has a number of techniques to allow us to work safely with data in multi-treaded applications: We can declare a variable volatile, we can synchronize, explicitly define and use a lock from java.util.concurrent.locks, or use one of the...
by kornel@synkre.com | Jul 19, 2019 | Programming Tips
JavaBeans were created by Sun Microsystems in the 1990s to address a couple of shortcomings of the Java language. They wanted a way to make fields either read-only or read-and-write. They also wanted to make Java code better readable by design tools, such as NetBeans....
by kornel@synkre.com | Jul 18, 2019 | Uncategorized
Using Java beans will destroy your functional code. I keep coming across code that implements setters and getters in Scala code. There are multiple problems with this when it comes to functional programming. Scala code should use case classes, not mutable java beans....
by kornel@synkre.com | Jul 16, 2019 | Uncategorized
In the past couple of years, there’s been a trend to code with streams. Ever wondered why everything is turning into a stream? What are their advantages? What should you do if you wanted use streams? What libraries are out there and which ones are the good ones?...
by kornel@synkre.com | Jul 11, 2019 | Programming Tips
When importing sbt projects you may see the following not very informative error message: Error while importing sbt project:java.lang.VerifyError: Uninitialized object exists on backward branch 487Exception...
by kornel@synkre.com | May 17, 2019 | Uncategorized
When we write Scala code that needs to be repeated we often put it into a for comprehension. Many folks who code Scala call this is loop. for( i <- 1 until 5){ println(i) } But that is not 100% accurate. A for comprehension does not have any mutable loop variables...
by kornel@synkre.com | Feb 24, 2019 | Programming Tips
When using a traditional web server, we have access logs and request logs already defined for us. Most well known web server packages generates these logs so that we can track what is going on in a production environment. This is a little different with Akka HTTP....
by kornel@synkre.com | Feb 10, 2019 | Programming Tips
What happens when our site security breaks down and despite our best efforts our servers get compromised. Our database gets exposed, our password files get exposed, etc. Hopefully, at the very least most of us would take the precaution to encrypt our passwords before...
by kornel@synkre.com | Feb 3, 2019 | Programming Tips
“Scala is a creative language”. Many of us who love this tool often give this response when asked why we like using it. I’ve been hearing it from people for years, from colleagues at work, from presenters at Scala days, and from friends, etc. I have...