1. You need to throw Exception on empty Optional
2. You need to test and inspect an exception
3. How to use assertion errors?
You shouldn’t use
ifPresentOrElse for exceptions. Here’s a bad example.
What are the snippet problems?
emptyAction can throw only
RuntimeException. As an example, it’s the
NullPointerException if the value or action isn’t present.
Runnable can throw unchecked exceptions.
Runnable isn’t designed to work for checked exceptions.
The use case of
emptyAction isn’t to throw exceptions. Throwing exceptions from
emptyActioncauses complex code.
The frontend is simple. Backend is the real deal. How hard it is to present the data?
I’ve worked on both. Angular and Spring Boot. Both have good sides and obstacles.
Here’s why the frontend is valuable as the backend.
You create a REST endpoint. Frontend calls that endpoint. Frontend presents the data. Simple stuff. Presentation is markup, fetching is a built-in feature (fetch API), and styling is a minor issue. We can conclude, frontend is simple.
No. Frontend worries about native markup. Frontend worries about accessibility. Frontend worries about user experience. The frontend is complex.
83% of software engineers want remote work options post-pandemic. ⁵
Remote work is here to stay. Hybrid or fully remote.
You need to change. Change your habits. Change your mindset. You need to prepare for the future.
Here’s how remote work changed your work, your behavior, and how to respond to changes.
Remote work creates a new working environment. Excluding freelancers, they work from anywhere. You don’t commute to the office. You don’t have random water cooler talks. You don’t need to work by the clock. Most developers like this situation.
What remote work removes? Connections. You’re now an avatar…
Learning Java is hard. Experience is the best teacher. Experience teaches you through mistakes.
I learned from my mistakes. You can learn from my mistakes.
Here’s what I learned the hard way, and you don’t have to.
Lambdas often exceed 4 lines of code. Doing more than supposed to. More responsibility — harder for your working memory. More lines —multiple-responsibility lambda.
Do you need to change the variable from lambda? You can’t do that. Why? If lambda could access callsite variables multi-threading issues can occur. You can’t change the callsite variables from within lambda.
Happy path in lambda works excellent…
Most recruiters don’t tell the truth.
They hide. They’re silent about important topics. They show disinterest in you.
Here’s why the recruiter’s behavior matters.
Recruiters believe we care about benefits. “We have a pool!”. “We have table tennis, which employees play all the time.” Juniors care. Experienced developers don’t care.
According to studies, this is what developers care about.
You rebase your branch onto main. You don’t want to force push. Why? You can break the remote. You erase other team member changes.
Here’s one example. Let’s have a feature branch and Alice and Bob are pushing work to that feature branch. Alice completes part of the feature, commits, and pushes to the remote. Bob finishes his work, before the push to…
Most juniors think this job is the best. The best I can get. The thing is you don’t know what’s out there yet. You should explore different options. You need to try more and settle for one thing. I started with Angular, and now working on Java microservices. You should switch jobs if you don’t feel like doing it.
Your job is challenging? Do you like the team? You don’t want to switch jobs? Great. Stay put. You should switch jobs if you don’t progress. You should switch jobs if you’re under pressure. …
Copilot is an enhanced autocomplete. Copilot doesn’t know the domain. You need to provide the seed, and the copilot will plant the seed. The gist — the developer is still essential.
Copilot doesn’t know the pros and cons. Developers understand the pros and cons of a certain solution. You can’t outsource these decisions to Copilot. We need a domain expert to weigh the solution. Copilot is a utility to convert our thoughts into code. Developers understand the whys, Copilot helps with the hows.
Copilot is specific in coding. Developers are generic in coding. Developers know how the solution can be…
You’re working on several tasks at once? You can’t choose a tech stack? Do you lose time on refactoring?
We all have these issues. You work on several tasks, quality suffers, and time flies by. You choose one library and find a better one tomorrow.
Here’s what you need to apply and reduce the time-wasters.
Work with one tech stack. This holds for experienced developers. New developers should try different tech, and see what they like…
Collectors a lot. We compress huge code blocks. We compress the logic. We use them to improve code quality.
We don’t know much about
Collectors. Apply them, the test passes, and we move on. That’s why we should explore this topic now.
Have a look at 3 advanced Collectors tips you should know.
Let’s look at this question first. …