DEV Community

Jose Tomas Gonzalez
Jose Tomas Gonzalez

Posted on

What little things make you happy while coding?

I must say refactoring code to make it look beautiful is my guilty pleasure

Latest comments (89)

Collapse
 
microbadiah profile image
GT Obadiah

echo "This post is in 3D format";
😂

Collapse
 
carlitosx profile image
Carlitos-X

Believe it or not ChillHop/LofiHipHop + Coffee = #BlissLife

Collapse
 
carlitosx profile image
Carlitos-X

Has nothing to do with coding but sure helps while building the PRETTY part of a website in CSS lol

Collapse
 
randelramirez profile image
Randel Ramirez

Seeing the application work and be built piece by piece. Being able to write code using design patterns and writing unit tests, and see good coverage.

Collapse
 
jeroka profile image
Esteban Rocha

I must say refactoring code to make it look beautiful is my guilty pleasure

+1 on this!

Collapse
 
antonrich profile image
Anton

The clicks I get when I understand what I discovered.

Collapse
 
slavius profile image
Slavius

Making my code read like a book?

Something like:

if (User.hasBirthdayToday()) {
  var banner = createBanner() {
    position = BannerPosition.Top,
    message = User.isOlderThan(18) ? getBeerBanner : getSodaBanner,
    backgroundColor = Color.NavyBlue,
    displayForSeconds = 15
  };
  banner.Show()
}

Instead of spaghetti code:

DateTime today = DateTime.Now;
bool userHasBirthdayToday = 
  User.DateOfBirth.Day == today.Day && User.DateOfBirth.Month == today.Month;

if (userHasBirthdayToday) {
  string messageType = "BIRTHDAY_SODA";
  if (today.Year - User.DateOfBirth.Year >= 18) {
    messageType = "BIRTHDAY_BEER";
  }
  string bannerMessage = Banners[messageType]?.getMessage();

  Banner b = new SiteBanner(BannerPosition.Top, bannerMessage, Color.NavyBlue, TimeSpan.Seconds(15));
  b.Show();
}
Collapse
 
malgosiastp profile image
Malgosia

I just love when I learn some trick or new feature or concept in some basic tutorials or article, and then one day working, I run into situation and realize that I can actually use it in my project (or it even solve some big issue) :)

Collapse
 
erebos-manannan profile image
Erebos Manannán

Getting my team to use new tools I built to make them more efficient. Be that classes that help accomplish some repetitive thing, better CLI tools, some sort of CI automation, or whatever.

Collapse
 
tobiassn profile image
Tobias SN • Edited

Getting an error. It makes me happy that I have this opportunity to learn about what I did wrong and improve. And then when I’ve fought through them all, it feels so good when it works.

Collapse
 
lukaszkuczynski profile image
lukaszkuczynski

what do you mean saying "Gering" ?

Collapse
 
tobiassn profile image
Tobias SN

Oh sorry I mean ‘Getting’.

Collapse
 
courier10pt profile image
Bob van Hoove

Finding a library like Polly. It provides a variety of resilience strategies in a composable way. Think of retry, fallback, circuit breaker etc. The documentation is excellent.

It made me happy because it allowed me to deliver a much better quality solution than I could have rolling my own, especially 'within scope' for the task at hand.