info@CodeCraftersDesign.com
  • RSS
  • RSS
CodeCraftersDesign.com
  • Home
  • Blog
  • WordPress
  • Programming Tips
Select Page
How do I write lock-free non-blocking code and why should I care?

How do I write lock-free non-blocking code and why should I care?

by kornel@CodeCraftersDesign.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...
Why we synchronize in Java and Scala: locks, volatiles, and atomics

Why we synchronize in Java and Scala: locks, volatiles, and atomics

by kornel@CodeCraftersDesign.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...
JavaBeans are dangerous: Immutables work better for concurrency

JavaBeans are dangerous: Immutables work better for concurrency

by kornel@CodeCraftersDesign.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....
JavaBeans style getters and setters will ruin your Scala code

JavaBeans style getters and setters will ruin your Scala code

by kornel@CodeCraftersDesign.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....

Fast non-blocking code with idempotent streams

by kornel@CodeCraftersDesign.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?...

IntelliJ sbt import error: java.lang.VerifyError: Uninitialized object exists on backward branch 487

by kornel@CodeCraftersDesign.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...

Scala: Is a for comprehension a loop? If not, is it any better than a loop?

by kornel@CodeCraftersDesign.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...

Writing a logging directive for Akka HTTP

by kornel@CodeCraftersDesign.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....

Scala and Java content encryption using symmetric cipher

by kornel@CodeCraftersDesign.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...

Scala and First Principles Thinking

by kornel@CodeCraftersDesign.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...
« Older Entries
Next Entries »

Narrow Search

Archives

  • November 2024
  • March 2024
  • February 2024
  • November 2023
  • May 2023
  • November 2021
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • August 2019
  • July 2019
  • May 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • RSS

Designed by Code Crafters Design