Refactoring Is Not Just Clickbait - Kevlin Henney - NDC London 2023

  Рет қаралды 35,328

NDC Conferences

NDC Conferences

Жыл бұрын

For many people, refactoring is a simple code transformation they click on in a context menu or via a keyboard shortcut. They can extract, inline, replace, move, rename, etc. at will. The widespread availability of automated refactoring should have made oversized classes and long-winded functions a thing of the past. But it hasn't.
Having a tool is only part of the solution: knowing what to do with it and how to use it well is what makes the bigger difference. In this talk, we'll revisit what refactoring is (and isn't), examine what practical and social obstacles refactoring faces, explore the idea that refactoring should be considered a design process and not just a clean-up click, and that most interesting refactorings are not necessarily automated.
Check out our new channel:
NDC Clips:
‪@ndcclips‬
Check out more of our featured speakers and talks at
ndcconferences.com/
ndclondon.com/

Пікірлер: 43
@strayobject
@strayobject 9 ай бұрын
K. Henney is one of the very few speakers in the tech industry, whose talks one can be certain will be worth the time spent listening to.
@evyatarshafran5017
@evyatarshafran5017 Жыл бұрын
Love this talk! Kevlin always makes these topics fun and interesting :)
@UserDirk
@UserDirk Жыл бұрын
Great talk that focusses on the true essence and origins of the Refactoring word.
@jeroenneve5807
@jeroenneve5807 8 ай бұрын
"don't name things negatively" should be "name things positively."
@barneylaurance1865
@barneylaurance1865 Жыл бұрын
I always think of refactoring as relates to "factors of production" in industry, rather than mathematical factors. The factors are the pieces that go into a product, refactoring in a sense changes the pieces of a software product without changing the product as a whole.
@nonchip
@nonchip 7 ай бұрын
it helps to remember what "refactoring" actually means: re-doing which factors go into the solution. not renaming, lots of people forget that.
@logiciananimal
@logiciananimal Жыл бұрын
The "don't name negatively" is (more or less) in Aristotle in his discussions of classification. Hence Kevlin's advice has a very old pedigree. Also, functional requirements are often features, hence things, where as many of the "non-functional requirements" are properties (e.g., security, accessibility). Hence they are *metaphysically different*, and in particular, inseparable from the features they apply to.
@andrewporter1868
@andrewporter1868 Жыл бұрын
But the world has abandoned Aristotle for errors from the likes of Kant, Nietzsche, et al., and that's why our industry is now miserable while everyone pretends that everything is just fine. Our industry right now (among other aspects of society) is literally the This Is Fine meme personified. There's a reason why you can easily find hundreds of talks and conferences about "No, this is how you program!" and not, "No, this is how you do !", and there's a reason why there are hundreds of programming languages, most of the new ones trying to solve other languages, while the older ones fail to properly solve software engineering, so the cycle of new programming tools is perpetuated because no one wants to address CSE. They're all trying to fix C, and then simultaneously account for the technical debt that should have never been incurred with regard to programming _discipline_ in the first place, hence why things like "Clean Code" (among other things) take off because people are frantically grasping for something solid (pun not intended) to guide them and make their code good all the time since by no fault of their own, they don't understand how their code gets bad in the first place, especially when everything is reduced to subjectivism!
@ethanwasme4307
@ethanwasme4307 7 ай бұрын
yap yap yap what's your body count
@philadams9254
@philadams9254 11 ай бұрын
He's been giving the same old talk for years, but in a different way and repackaged up with different titles. You could say he's constantly refactoring it.
@edgeeffect
@edgeeffect 11 ай бұрын
Nice too see a speaker practice what they preach.
@x--.
@x--. 9 ай бұрын
This speaks to my heart. So often I've had other devs go on about this or that when my natural inclination is toward his descriptions here. Carefully understanding your problems and clarifying as you go.
@Soliber
@Soliber 10 ай бұрын
"Architecture is for developers to live in". I like that 😄
@CottidaeSEA
@CottidaeSEA 9 ай бұрын
Refactoring can be as simple as renaming the conditions of an if-statement. If I see a complex if-statement, I'll almost always give it a local variable at the very least. It makes life easier for the next person looking at the code.
@d7ffab979
@d7ffab979 8 ай бұрын
I just pull it out as a method and give it a very explicit name.
@CottidaeSEA
@CottidaeSEA 8 ай бұрын
@@d7ffab979 If it's used in multiple places I do that too. Otherwise a local variable will be good enough.
@kudorgyozo
@kudorgyozo 8 ай бұрын
I would like to live in a make believe fantasy world where code is clean and understandable, and where you sleep 8 hours/day every time.
@MrTetedacier
@MrTetedacier Жыл бұрын
I will follow your advice on playlist. I'm kind of locked on "know your ennemy"'s songs lately 😊
@not_ever
@not_ever Жыл бұрын
He got me with the first IDE refactoring tweet 🙀
@joebowbeer
@joebowbeer 6 ай бұрын
03:28 technical debt 05:50 technical neglect
@barneylaurance1865
@barneylaurance1865 Жыл бұрын
I think I don't quite like Fowler's definition of refactoring - I would delete the part about making it easier to understand and cheaper to modify, and say that a refactoring is simply any change made to the internal structure of software that does not change its observable behaviour. Then refactoring can be done for any reason, good or bad, and we don't have to know someone's motives to be able to tell whether what they are doing is refactoring or not.
@msclrhd
@msclrhd Жыл бұрын
I would change it "toward some stated goal" rather than remove it. That way you are codifying that refactoring is not just performing an operation and then its inverse, that you have some idea (even if loosely defined) of where you are going/why you are refactoring the code. With the trader example, that is "so I can better understand the logic at the point at which it is used, so I don't have to repeatedly add the same comment". It may also be something like "so I don' have unnecessary code" (like in the time regex example), or it may be "so I can lay the foundation to implement some new task/feature I'm working on".
@barneylaurance1865
@barneylaurance1865 Жыл бұрын
@@msclrhd So what would you call someone making changes to internal structure without stating a goal?
@msclrhd
@msclrhd Жыл бұрын
@@barneylaurance1865 Maybe "toward some goal or outcome" is better. That is, you don't have to explicitly state the goal, just know the general direction to travel in. This is to in some way to codify the idea that refactoring isn't about repeatedly applying rename, extract, etc. refactorings, but applying them to achieve some goal (either implicitly or explicitly stated). Otherwise, your refactorings are aimless. Even though you are applying refactoring techniques (the noun), I wouldn't call that refactoring (the verb).
@barneylaurance1865
@barneylaurance1865 Жыл бұрын
@@msclrhd what would you call it then? I'd just call it aimless refactoring. I might say "don't refactor aimlessly".
@msclrhd
@msclrhd Жыл бұрын
@@barneylaurance1865 That's a good name for that. I'd use that too.
@StuCoates
@StuCoates 8 ай бұрын
The regex at 1:03:38 doesn't consider leap seconds, which could be quite interesting... occasionally ;-)
@anotherplatypus
@anotherplatypus 7 ай бұрын
Wtf?... this guy's first few minutes is so funny so far...
@szirsp
@szirsp 9 ай бұрын
55:58 Because this is written in python I'm going to assume that it will run on a high performance CPU and not on a microcontroller. So this refactor might be appropriate, but still I would like to see some performance testing on it and not just "it does what we expect" unit tests. Because the original had a lot of branches there is a chance it performed poorly in today's highly pipelined architecture (though they have good branch prediction and speculative execution). Also because it is python performance probably doesn't matter and even if it wasn't it wouldn't. But please don't refactor code like this on 8 bit or even 32 bit micro controllers that don't have hardware multiplier or divider ! The original code design (written in C) would run perfectly fine on an 8 bit AVR, or a cortex M0 ARM, while the rewritten one will be slower and bigger. (And it might also be harder to understand.) And if you think this is premature optimization then you might be right but also don't be surprised how a modern text editor runs slower on current hardware than old ones did on much slower machines.
@tomatoslav
@tomatoslav 22 күн бұрын
i need to write this comment down because i won't be able to focus on either this video or my work until i do ... the result of refactoring is often briefer, simpler code ... but it also often happens that new pathways are revealed for code execution that improve the performance of the code, and in some cases even open possibilities for new (QoL) features to be added
@zwatotem
@zwatotem Жыл бұрын
24:24 Morshu, is it you?
@LettersAndNumbers300
@LettersAndNumbers300 11 ай бұрын
Love this guy’s insights but I wish he would condense his talks better.
@markevans7226
@markevans7226 11 ай бұрын
This guy questioned the term "Technical Debt", questioning the word "Technical" and completely ignored "Debt". The word "Debt" has far more reaching impact. How about using the word "Health" instead?
@shashank.c
@shashank.c Күн бұрын
Debt is something we have to pay back. In that context, it is more appropriate.
@adodge2
@adodge2 11 ай бұрын
repetition legitimizes
@FalcoGer
@FalcoGer 11 ай бұрын
debt is bad. would you rather have debt or not? If you could, would you prefer to pay the house now and be done with it, or would you rather have your structured repayment for the next 50 years? Clearly debt is worse than the alternatives. Debt might be necessary to get your house, but it's not a good thing. You simply made the call that the house is worth more to you than the negatives of being in debt.
@x--.
@x--. 9 ай бұрын
I think you missed his point and the point of debt, in general. Debt is _not_ bad if the utility gained from your expenditure is greater than the cost of the debt. If I get a car loan to enable me to goto school or a job, arguably that's good debt. If it's a choice between owning a house *now* or owning a house in 50 years after I saved up enough then the _loan repayments_ are arguably "not a good thing" but they are in service to me having a house now, instead of in 50 years. Put in moralistic terms, if you save my life and I say, "I am in your debt." I owe you my life, for me, I'd much rather owe you that huge debt of gratitude than be dead. In these ways, we find utility in debt. It's at the heart of ideas around reciprocity and I don't think it can be painted as always bad.
@shashank.c
@shashank.c Күн бұрын
Debt is not bad, it is a liability. You take a debt to do something quickly (right now) instead of waiting. It will turn bad if you do not manage your debt. This is same with financial as well as tech debt.
@robertmayer538
@robertmayer538 Жыл бұрын
Stopped watching after the Pascal rant: claims Pascal is a badly designed langugage, tries to support claim by presenting an improved algorithm that could be coded in Pascal just fine lmao
@edgeeffect
@edgeeffect 11 ай бұрын
I still had to keep watching because I'm a massive KH fan boy.... doesn't mean I didn't get very cross indeed about what he said about Pascal though.
@edgeeffect
@edgeeffect 11 ай бұрын
It's funny... I was looking at some old Pascal this morning and was thinking "oh look, in that module, a closure, and some STRONG typing.... doesn't it look like TypeScript?" .... no lambdas or monads though.
@x--.
@x--. 9 ай бұрын
Hardly a rant, more of an aside. Let's not get our keyboards in a jumble.
Refactoring Is Not Just Clickbait - Kevlin Henney - NDC Oslo 2022
1:03:44
Technical Neglect - Kevlin Henney - NDC London 2024
1:07:18
NDC Conferences
Рет қаралды 17 М.
Чай будешь? #чайбудешь
00:14
ПАРОДИИ НА ИЗВЕСТНЫЕ ТРЕКИ
Рет қаралды 2,9 МЛН
ПООСТЕРЕГИСЬ🙊🙊🙊
00:39
Chapitosiki
Рет қаралды 66 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
ASMR I phone bling bag/ асмр айфон бокс. Милка 🍫🍫
1:48
МОЛОЧНАЯ МИЛКА
Рет қаралды 293
Kevlin Henney - The Case for Technical Excellence
46:06
Agile meets Architecture
Рет қаралды 7 М.
Talk Six Impossible Things by Kevlin Henney
1:04:54
Kotlin by JetBrains
Рет қаралды 14 М.
Refactoring to Immutability - Kevlin Henney
1:03:22
NDC Conferences
Рет қаралды 92 М.
Decremental Development (Kevlin Henney)
1:03:06
DevTernity Conference
Рет қаралды 4,4 М.
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 15 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 12 МЛН
China 🇨🇳 Phone 📱 Charger
0:42
Edit Zone 1.8M views
Рет қаралды 382 М.
Apple watch hidden camera
0:34
_vector_
Рет қаралды 61 МЛН