Useful Code Is Ugly | Tsoding

preview_player
Показать описание
There is no such thing as Good Code.
From the "Backend WebAssembly (Part 2)" stream.

This channel is not affiliated in any way with the Tsoding Daily channel or any of the three owners of the main Tsoding channel.
Рекомендации по теме
Комментарии
Автор

My mum said I’m not pretty, so I better be talented…

alst
Автор

Yes and no. Real-world problems that you want to solve with code are, indeed, often quite messy. And that messiness will necessarily be reflected in the code that's written to solve that problem. However, "good" code is only as messy as it needs to be, and not messier. There's a thousand ways to write code that's even more messy than the original problem you're trying to solve, and that would be called bad code.

taylankammer
Автор

This is how an anime villain talks about ugly code.

yutoriotsu
Автор

Screams in GCC C++ Standard Template Library implementation.

aniketbisht
Автор

I did, and I wrote some.

You usually start clean, then things get real and code gets messy. This is a sign of incomplete design and/or wrong assumptions at the start of the project.

And then, things get unmanageable, so you have to rethink and redesign the code to match new expectations without breaking compatibility. And this is the hardest part - backward compatibility code that doesn't make your brain melt when you read it. But it's totally possible, and I am the living proof of this, doing it in the real organization every day of my life

itstoly
Автор

Depends on what you mean by useful and pretty. I tend to rewrite a lot of things just for it to be more readable. Call it bad practice but it gets important when you want to expand your workspace. The best is probably to refactor after successfully building, this way you get the job done and can rescale it in the future. Though I absolutely agree with the job part, it's mostly unnecessary to get things pretty when you have a deadline.

Also neural network's are not code they are big chunks of buffers that are being transformed over time.

ramsey
Автор

👏👏👏👏 learning to read code ! fuck yeah ! thank you for stating one of the most neglected and one of the most important skills for working with software.

redkotful
Автор

Valuable code, reliable code, useful code, fast code, that solve problems. Excelent recommendation. I am a Junior developer and it is true that thinking in write good code is more a problema than a solution and stuck the creativity and freedom of the developers.

briancardona
Автор

nginx code base looks like a piece of art to me and it definitely solves problems

unheilbar
Автор

"Learn to read bad code" This is such a good advice. Placing good and bad in abstract fields such as coding is misleading. What exactly is bad about it? It has too much logic, too cryptic names? Unreadable code is bad; but worse is non-functioning 1 thing per file type of code; or pretty code that has been hell-ed up with patterns, classes to appear simple but is very hard to get the big picture or debug. Code cannot be pretty or ugly, but design of the flow can be. Look at Zoran Horvat, although he is OOP zealot his ways of solving problems can be very helpful in understanding the core problem of "readability".

dczoekj
Автор

Useful clean code for me is when there are separate functions, the control flow is intuitive, and the naming/documentation is good enough that the domain can be simply understood.

giorgos-
Автор

It's like looking at the back of a freezer pretending to see something beautiful.

touce
Автор

If your primary concern is readability or to make it look pretty then the code is clearly going to suffer.

Jeremyak
Автор

Yes, biochemistry is also super messy but super useful. Have you seen the inner workings of a mitochondria for example

Автор

Debugging ugly code is easier than debugging good looking code that appears to be perfect while in realty is has a lot of bugs.

olafbaeyens
Автор

I think you have some very valid takes here. I completely agree :)

Codewrinkles
Автор

Me writing quicksort algorithm without any helper functions 💪

pchan
Автор

Reminds me of that life saving C macro that I made which looked fucking atrocious. But it worked and it did great.

nzeu
Автор

Говорят, чистый и полезный код всегда есть у сына маминой подруги😅

ЕвгенийКрасилов-оо
Автор

I do not write beautiful code. I write minimal and practical code that will be easy to replace or reuse

DEVDerr