5 Ways to Improve Your Code • Dave Farley • GOTO 2021

preview_player
Показать описание
We’re so pleased to announce that we’ve teamed up with Dave Farley, author of “Continuous Delivery” and frequent GOTO Conferences speaker, for a monthly video series featuring ideas about continuous delivery, DevOps, test-driven development, BDD, software engineering and software development in general.

Dave Farley - Continuous Delivery & DevOps Pioneer, Award-winning Author, Founder & Director of Continuous Delivery Ltd.

ABSTRACT
What can you do to improve your code? Readable code, clean code is easier to work with and easier to change. So how do you get better at coding, what are some tips for coding beginners, and for more experienced developers, that will result in better code? What are the programming and coding tips that you can adopt to make it easier to create better software faster?

Being a software developer is not just about being able to write code that a computer can understand, it is about organising ideas so that you, and others, can understand it too. Writing software is challenging, software is abstract, almost infinitely flexible and extremely fragile. All this means that the quality of our choices, the design of our code matters.

In this episode, Dave Farley shows five common, really bad, examples that we see in code all the time and offers his advice on how to fix them, and how to improve your software, and your coding. Software engineering is about the continuous delivery of valuable software into the hands of our users: writing good quality code is an important part of that discipline.

Some of the content in this episode was inspired by this blog post:

CD TRAINING COURSES
If you want to learn Continuous Delivery and DevOps skills, check out Dave Farley's courses

RECOMMENDED BOOKS
You can grab Dave Farley's new book 'Continuous Delivery Pipelines' here:

#GOTOxDaveFarley #Programming #ImproveCode #TDD #Refactoring #DaveFarley #GOTO #GOTOcon #ContinuousDelivery

DAVE'S LINKS

Looking for a unique learning experience?

SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily.
Рекомендации по теме
Комментарии
Автор

This is the abstract for who don't have time to watch the video:
* Use comments to describe why you made a decision and not explaining what code does
** to explain the code use meaningful names for classes, methods and variables
* Avoid long methods and break them to smaller functions
** Use IDEs extract method for faster and more reliable refactoring
** Keep related codes close to each other
** Look out for method reuse
* Avoid methods with too many parameters
* Avoid duplicate codes: Convert them to methods and reuse them
* Avoid large conditional blocks and also nested conditions: again convert them to methods

vakarami
Автор

If you use sonar qube all these rules are done by static checks so you'll eventually get trained to write better code

khalidhamid
Автор

Many years ago, jumps were very expensive compared to longer functions/methods. I remember those days and am glad they are gone.

BryonLape
Автор

I would add to the list "rename variables". It's a simple way to improve the code.It's very safety and easy to do and can add more expressivity.

VictorLopez-vlny
Автор

Really enjoyed this. Thanks. Always interesting to discuss coding. :)
Just a minor suggestion - maybe have a 'summary' right at the end, that recaps the 5 different points. Just to drill home the point, and aid retention.

whitters
Автор

I hate to say it, but that 623 lines are looking nice and readable. I have to support ~500 line methodes with 12 idents! Its like being in Egypt, pyramids everywhere.

Krauttrooper
Автор

While I completely agree with your point regarding comments in code, how would you go on about documenting contract behaviors? A well named method in an interface doesn't always express certain behaviors, I.e. always returns an empty collection rather than null.

JohnnyNilsson
Автор

B800, my old friend. haven't seen you in 20 years. Do you still show DOS?

Krauttrooper
Автор

The video should really be titled "5 Ways to Improve Your Code for Beginners". There's nothing that experienced developers wouldn't know here.

cypher
Автор

One class, one thing + one method, one thing = One class, one method 😃

madmanX