Posts by Mario Casari
Java tip 💡: Don’t rely blindly on Garbage Collection; memory leaks are still possible.
#Java #SoftwareEngineering
Using AI in your work highlights its ability to assist with many tasks, but it remains far from replacing your role as a programmer. I enjoy using it because, honestly, at least 80% of a developer's job involves repetitive, alienating tasks suited for machines. #AI #Programming
Discover how the decentralized internet puts power back in users' hands—boosting privacy, cutting out middlemen, and redefining the digital future. #decentralizedinternet
If AI is intelligence, then intelligence must be highly overrated. #AI #Intelligence
Now I have to have one of these decanters.
🟩Example:
public class MainClass {
private HeavyClass heavyObj;
//instead of creating it in the constructor
public HeavyClass getHeavyObj() {
if (heavyObj == null) {
heavyObj = new HeavyClass();
}
return heavyObj;
}
}
#Java #Performance
Java Tip 💡: To improve your application's responsiveness, avoid initializing heavy objects that may never be used.
Consider Lazy-loading them at the appropriate time to rationalize memory usage and improve response time.
#Java #Performance
Collaborative code cities in VS Code boost comprehension and usability, with user feedback guiding next steps in software visualization research. #softwarevisualization
Claude Code just launched on the $20 Pro plan—finally accessible AI that refactors legacy code, writes tests, and beats Cursor in real-world dev tasks. #ai
For example:
public class Config {
...
public static String getConfigPath() {
return configPath;
}
}
The configuration path is shared globally, and changing it in one place could affect others.
#Java
Java Tip 💡: Try to avoid static variables unless they store truly global values.
• They hinder testing by making it harder to isolate classes due to shared state.
• They reduce code reusability.
#Java
A singular act of defiance that will never go out of style.
difficult to read text on glass in the Music app
Glassy Safari controls overlaid on a photographic website, also somewhat illegible
These ultra-translucent interfaces rarely work well as a system, because the transparency introduces way more problems than it solves. It’s form over function.
I’d bet that a lot of this liquid glass stuff will end up more like semi-opaque-frosted-glass in the end. But it looks cool as a demo!
Most of the world still runs on legacy code. Here’s how smart teams safely refactor, test, and modernize without breaking what already works. #softwaremodernization
Many layers and pillars of semi-opaque gas and dust overlay one another. These regions appear light blue and dark gray-blue. The first pillar starts at the bottom left and extends to the top right. There is one prominent red star, with tiny spikes at its tip. Lower on this pillar, there are several darker areas of dust that jut out, many with bright red stars that appear as small red dots at their ends. Below the top pillar are two slightly smaller pillars, both ending in dark gray-blue regions. The second pillar has a dark arch that looks like an upside-down L halfway down. The background of this scene is washed in shades of red. Toward the top center is a V shape. At its lowest point, the V is a brilliant red. There are only several dozen tiny bright white and blue stars in this overall scene. Larger stars appear redder and are embedded in the pillars.
The Pillars of Creation, seen here in mid-infrared by #NASAWebb, adds to decades of research about star formation by helping astronomers analyze the densest dusts and gases of the region, and improving the precision of their star-formation models: bit.ly/45ayCYi 🔭 🧪
Learn how Modulith architecture offers a balanced approach to building scalable apps—between the simplicity of monoliths and the flexibility of microservices. #microservices
Is it North Corea?
Sen Bernie Sanders (I-VA) just now on CNN:
"We have a President moving this country rapidly into authoritarianism. He's suing media who criticize him. He's going after law firms that have clients who were against him. He's suing universities who teach courses he doesn't like"
🧵2/2 If, for instance, we define a static list somewhere:
private static final List<byte[]> byteList = new ArrayList<>();
Some parts of the code may keep adding elements without removing them, eventually leading to memory exhaustion.
#Java #MemoryManagement
Java tip💡: Don’t rely on Garbage Collection blindly, memory leaks are still possible.
#Java #MemoryManagement
🧵1/2
@ParameterizedClass @ValueSource(strings = {"foo", "bar"}) class SomeTests { @Parameter String value; @Test void shouldNotBeNull() { assertNotNull(value); } @Test void lengthShouldBeThree() { assertEquals(3, value.length()); } }
✨ New blog post: "STF Milestone 4: Parameterized test classes"
JUnit 5.13 introduced parameterized test classes (in addition to methods). They are a powerful testing tool that has long been missing from JUnit Jupiter...
👉 marcphilipp.de/blog/2025/06...
It looks like a painting
The image features the Raspberry Nebula (LBN 867), located in the constellation of Orion. Imagine a vast cosmic cloud stretching into space, with a complex structure that resembles an onion due to its multiple layers. At its center shines a bright star, HD 34989, which emits an intense light, similar in brightness to the planet Uranus as seen from Earth, creating a bright focal point in the heart of the nebula. The nebula itself has a vivid red glow, like a scarlet bloom, due to the ionization of hydrogen gas glowing under the influence of the central star. Around HD 34989, a thin halo of blue-white light can be seen, a delicate reflection of starlight on interstellar dust, forming the reflection nebula vdB 38. This bluish halo contrasts with the dominant red, adding a cooler, more nuanced touch of color. The overall image is a mix of bright red hues and hints of pale blue, with the central star standing out like a bright beacon in a sea of cosmic clouds.
🧵
Here is a cosmic delight: LBN 867, dubbed the Raspberry Nebula although its overall structure is more like an onion!
In fact, this fascinating H II region, located in the constellation Orion, contains three different objects within its structure!
➡️ noirlab.edu/public/image...
🔭 🧪 #science
A quick comparison of two possible options for implementing microservices communication in a Spring Boot project. #Java #SpringBoot #Microservices
www.freecodecamp.org/news/best-ch...
In a later time you can think of optimizing it using StringBuilder:
StringBuilder sb = new StringBuilder();
sb.append("Hello ");
sb.append("there");
sb.append("!");
System.out.println(sb.toString());
A very trivial example could be:
String helloThere = "Hello " + "there" + "!";
System.out.println(helloThere);
The above line of code is clear and works as intended.
🧵2/3
Java tip💡: Avoid premature optimization. Write clean, working code first and focus on functional requirements. #Java #BestPractices
🧵1/3