Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Stop writing utility classes. Utility classes are a sign that you are writing procedural code. You should avoid them. Instead, write a real object model. For example, an email is not a String... It's an Email. Gautier - 🤘

19,509 görüntüleme • 1 yıl önce •via X (Twitter)

11 Yorum

Christian Findlay profil fotoğrafı
Christian Findlay1 yıl önce

I don’t write utility classes I write utility functions 👌

PDF GPT profil fotoğrafı
PDF GPT1 yıl önce

Everyone is getting ahead with AI. You should be too. Summarize documents, craft emails, and generate custom content instantly with this powerful tool. It's like having ChatGPT tailored for your job. Try it for free.

Rody Davis profil fotoğrafı
Rody Davis1 yıl önce

Probably a good use of extension types for Email to implement String and also still provide validate methods.

Francesco Vallone profil fotoğrafı
Francesco Vallone1 yıl önce

In my opinion another approach is to use a validation library like Acanthis that will still remove the need for a utility class, while providing validation and parsing of the object. Everything is just a line of code string().email()

Cillian Myles profil fotoğrafı
Cillian Myles1 yıl önce

You didn’t give a concrete reason why your approach is better? Same validation everywhere? I don’t think that’s guaranteed any more than that a user imports the same util class everywhere. 🤔

Nnaemeka Sidney profil fotoğrafı
Nnaemeka Sidney1 yıl önce

.isEmail

Dany | Mobile & Game Dev 🍉 profil fotoğrafı
Dany | Mobile & Game Dev 🍉1 yıl önce

Ohhh I like this

Gautier 💙 profil fotoğrafı
Gautier 💙1 yıl önce

🤘🏻

AbdulAzeez profil fotoğrafı
AbdulAzeez1 yıl önce

Nice

jayson.kt profil fotoğrafı
jayson.kt1 yıl önce

it's not an email until after it's validated. it's a wannabe

Pangz (pangz.vrsc@) profil fotoğrafı
Pangz (pangz.vrsc@)1 yıl önce

It doesn't add any value modeling the email as a different class instead of just leaving it by default as a string. You're using unnecessary resources just to wrap a simple string to a class just to make it appear as an object. You only need to validate it and that's it.(just my 2 cents)

Benzer Videolar