How Senior Programmers ACTUALLY Write Code

Thriving Technologist
24 Jun 202213:37

Summary

TLDRThe video script emphasizes the importance of writing high-quality code for professional growth and efficient teamwork. It outlines habits such as completing work fully, adhering to coding standards, documenting coding patterns, and avoiding micromanagement through proper estimation. It also stresses the value of incremental refactoring and the necessity of including time for documentation to ensure code longevity and maintain a professional standard.

Takeaways

  • πŸ”’ Writing good code is crucial for being perceived as a senior programmer, as it allows other developers to easily understand and appreciate your work.
  • πŸ›  Good code writing practices reduce the time spent supporting and explaining code to others, thus increasing efficiency and productivity.
  • πŸ”„ Writing high-quality code decreases the likelihood of your code being rewritten by others, which can be frustrating and a waste of time.
  • 🏁 Completing work before moving on is essential to avoid building up technical debt and to maintain professionalism.
  • πŸ“ Enforcing coding standards through tools or plugins helps maintain consistency in code formatting, making it easier for team members to work together.
  • πŸ“ Documenting coding patterns and decisions is vital for team collaboration and for maintaining a high standard of code quality.
  • πŸ” Reviewing and getting feedback on new coding patterns before fully implementing them can prevent potential issues and gain team support.
  • 🚫 Avoid creating separate tasks for refactoring, as this can lead to management pulling out these tasks, potentially harming the project.
  • πŸ”„ Incremental refactoring, spread across multiple features, is a valuable skill that helps in maintaining code quality without large, disruptive changes.
  • ⏰ Estimating work should include extra time for unexpected design meetings and documentation, ensuring that commitments can be met without compromising code quality.
  • πŸ—£οΈ Communication with the development team about refactoring needs and plans is key to spreading the effort and preventing management from making uninformed decisions.

Q & A

  • Why might a developer feel micromanaged when adding a new user story for a document?

    -A developer might feel micromanaged because they have to report back to a project manager or scrum master for approval, which can be seen as an interruption to their workflow and an unnecessary oversight on tasks that should be within their autonomy.

  • What is the importance of writing good code according to the script?

    -Writing good code is important for several reasons: it allows other developers to understand the codebase easily, reduces the time spent on supporting and explaining the code to others, and decreases the likelihood of someone rewriting your code due to misunderstanding or preference.

  • How does writing good code affect a developer's perception among their peers?

    -Writing good code can elevate a developer's status from a junior to a senior programmer, as it demonstrates an understanding of best practices, consideration for others who will work with the code, and a professional approach to software development.

  • What is the first habit suggested for writing code like a senior programmer?

    -The first habit suggested is to complete your work before moving on, avoiding the accumulation of technical debt and ensuring that the code is finished to a standard that can be presented to others.

  • Why is it beneficial to enforce coding standards?

    -Enforcing coding standards ensures consistency across the codebase, making it easier for developers to understand each other's code and reducing the cognitive load when switching between different parts of the project.

  • What is the role of documentation in maintaining coding patterns?

    -Documentation serves to communicate agreed-upon coding patterns to the team, providing a reference point for consistency and understanding, and ensuring that new team members can quickly get up to speed with the project's standards.

  • Why should a developer avoid creating a separate task for refactoring?

    -Creating a separate task for refactoring can lead to management potentially removing it to meet deadlines or other priorities, undermining the quality of the code. Instead, developers should integrate refactoring efforts incrementally within new feature development.

  • What is the advantage of incremental refactoring over a complete overhaul?

    -Incremental refactoring allows for a more manageable approach to improving the codebase, spreading the effort across the team and reducing the risk of introducing new bugs or issues that can come with a complete overhaul.

  • How should a developer handle unexpected design meetings or the need for additional documentation?

    -A developer should account for such uncertainties by adding extra time to their estimates for work, ensuring that they can meet their commitments without compromising on the quality of the code or the thoroughness of the documentation.

  • What is the significance of self-discipline in the context of writing code like a senior programmer?

    -Self-discipline is crucial for maintaining personal and professional integrity in code development. It involves taking pride in one's work, ensuring thoroughness, and completing tasks to a high standard before moving on to new tasks.

  • How can a developer demonstrate maturity and professionalism in their coding practices?

    -A developer can demonstrate maturity and professionalism by rejecting the notion that code should be self-documenting, instead taking the time to document patterns and decisions made during the project, and actively seeking feedback and collaboration with the team.

Outlines

00:00

πŸ“š The Importance of Writing Good Code

The speaker emphasizes the significance of writing clear, understandable code for several reasons. Firstly, it allows other developers to easily comprehend the codebase, which can prevent the urge to rewrite it entirely. Secondly, well-written code reduces the time spent on supporting and explaining it to others. Thirdly, it minimizes the chances of code being rewritten unnecessarily, which is often a waste of time in software projects. The speaker suggests that adopting good coding habits, such as completing work before moving on and taking pride in one's code, can elevate a developer's status from junior to senior.

05:01

πŸ”§ Enforcing Coding Standards and Documentation

The paragraph discusses the importance of adhering to coding standards and documenting coding patterns for a team. The use of auto-formatting tools is encouraged to maintain consistency in code formatting. Additionally, documenting agreed-upon coding patterns in a central location, such as a wiki or markdown file, is highlighted as a best practice. This helps in maintaining uniformity and understanding within the team. The speaker also stresses the value of reviewing new patterns with the team to gain feedback and ensure everyone is on board with the changes.

10:03

πŸ›  Incremental Refactoring and Estimation Practices

The speaker advises against creating separate tasks for refactoring, as management might remove them, potentially harming the project's quality. Instead, they recommend discussing refactoring needs with the team and spreading the effort incrementally across features. This approach, known as incremental refactoring, helps in maintaining code quality without disrupting the development flow. Furthermore, the speaker suggests adding extra time for unexpected design meetings and documentation when estimating work, to ensure that the team can deliver high-quality, professional code without being micromanaged.

Mindmap

Keywords

πŸ’‘Micromanagement

Micromanagement refers to a managerial style where a manager closely observes or controls the work of their subordinates, often to the point of interfering with their freedom to make decisions. In the video, the speaker mentions the risk of micromanagement when developers have to report back to a project manager or scrum master for additional tasks like writing documentation, which can stifle creativity and autonomy.

πŸ’‘Senior Programmer

A senior programmer is an experienced software developer who has a deep understanding of coding practices, can mentor junior developers, and is capable of making architectural decisions. The video emphasizes the importance of writing good code as a senior programmer to gain respect from peers and to ensure code maintainability, using the term to contrast with 'junior developer' and to highlight the maturity in coding practices.

πŸ’‘Code Maintainability

Code maintainability is the ease with which a software system can be modified by its developers. The script discusses how writing good code is crucial for maintainability, as it reduces the time and effort required to support and explain the code to others, which is a key aspect of a senior programmer's role in ensuring the longevity of the codebase.

πŸ’‘Technical Debt

Technical debt is a concept in software development that refers to the implied cost of additional rework caused by choosing an easy, short-term solution instead of a more robust, long-term one. The speaker warns against building up technical debt by not fully completing work before moving on, as it can lead to future complications and increased workload.

πŸ’‘Coding Standards

Coding standards are a set of rules and guidelines for developers to follow when writing code. In the script, the importance of enforcing coding standards is highlighted as a habit of senior programmers to ensure consistency and readability across the codebase, which makes it easier for the team to collaborate and maintain the code.

πŸ’‘Documentation

Documentation in software development refers to the written materials that describe the system, its components, and how they work together. The video script underscores the necessity of thorough documentation for patterns and decisions made during the project, as it helps in understanding the system and reduces the need for ad-hoc explanations, a practice advocated by senior programmers.

πŸ’‘Refactoring

Refactoring is the process of restructuring existing computer code without changing its external behavior to improve nonfunctional attributes of the software. The speaker advises against creating separate tasks for refactoring, instead suggesting incremental refactoring integrated into feature development to avoid management's tendency to deprioritize such tasks.

πŸ’‘Incremental Refactoring

Incremental refactoring is an approach where refactoring is done gradually over time, often as part of the regular development process, rather than in large, separate blocks of work. The script explains that this method helps in building quality into the code and spreading the effort across the team, which is a strategy used by senior programmers to maintain code quality.

πŸ’‘User Story

A user story is a tool used in Agile software development to describe a feature from the perspective of the user or customer of the system. The video mentions the reluctance to create a user story for refactoring tasks, as it may lead to these tasks being deprioritized or removed by management, highlighting the need for developers to integrate refactoring into regular development cycles.

πŸ’‘Estimation

Estimation in a software development context refers to the process of predicting the amount of effort, time, and resources needed to complete a task or project. The script advises developers to include extra time for unexpected design meetings and documentation when estimating work, which reflects the foresight and planning expected from senior programmers.

πŸ’‘Self-discipline

Self-discipline is the ability to control one's emotions and actions, especially in the pursuit of long-term goals. In the video, self-discipline is portrayed as a key habit of senior programmers, who ensure their work is complete and of high quality before moving on to new tasks, thereby avoiding technical debt and maintaining a professional reputation.

Highlights

The importance of avoiding micromanagement by ensuring tasks are fully completed before reporting them as done.

The value of writing good code for better team understanding and the transition from junior to senior developer status.

Writing good code reduces support time and the likelihood of being interrupted by questions from other developers.

The risk of code rewrites due to lack of understanding and the benefits of writing code with longevity in mind.

The habit of completing work before moving on to prevent technical debt and ensure professional integrity.

The significance of enforcing coding standards for consistency and reducing the frustration of reading varied code styles.

The use of auto-formatting tools and the establishment of team coding standards to streamline code reviews.

The necessity of documenting coding patterns and decisions for team alignment and future reference.

The practice of reviewing new coding patterns with the team to ensure collective understanding and support.

Avoiding the creation of separate refactoring tasks to prevent management from deprioritizing quality improvements.

The strategy of incremental refactoring to integrate new patterns without significant disruptions.

The importance of adding extra time for unexpected design meetings and documentation in work estimations.

The professional responsibility of developers to protect code quality and prevent management from making detrimental decisions.

The consultant's approach to thorough documentation, benefiting the team and enhancing the perception of professionalism.

The suggestion to reject the notion of self-documenting code and instead focus on mature and professional documentation practices.

The call for developers to share their opinions and suggestions for what makes someone a truly senior programmer.

Transcripts

play00:00

and the worst thing is having to go back

play00:02

to a project manager or a scrum master

play00:04

and say hey i need to add a new user

play00:07

story for this new document that i need

play00:09

to write i mean you're almost like

play00:11

guaranteeing that you're going to be

play00:12

micromanaged if you do things like that

play00:16

[Music]

play00:25

why does it even matter if we write good

play00:27

code like a senior programmer or not

play00:29

well first of all it lets other people

play00:32

understand our code you've probably

play00:34

found yourself in a code base before

play00:36

reading it and just being like i don't

play00:38

understand what the hell is going on in

play00:40

here and the temptation is often to just

play00:42

jump in and rewrite everything but being

play00:45

able to write code where people can

play00:46

really easily read it is something that

play00:48

other developers on your team will

play00:50

really appreciate and that often is the

play00:52

difference between them looking at you

play00:54

as a junior developer and a senior

play00:56

programmer the second reason it even

play00:58

matters to write good code is it reduces

play01:01

the time it takes for you to support it

play01:03

and explain it to somebody else i often

play01:05

work with other developers who will rush

play01:08

through and not follow some of the six

play01:09

things i'm about to tell you towards the

play01:11

end of the video and then they're

play01:13

frustrated when they're constantly

play01:14

interrupted by other developers asking

play01:16

them questions about the code and

play01:18

they're like i don't have time for it

play01:20

well if you do follow some of the things

play01:22

i'm about to share with you today that's

play01:23

actually going to reduce that time quite

play01:25

a bit and let you just work on what you

play01:27

actually want to do and the third reason

play01:29

it's really good to learn to write code

play01:31

as a truly senior programmer is that it

play01:33

reduces the chance that somebody's going

play01:35

to rewrite your code i think one of the

play01:37

most frustrating things as a developer

play01:38

is when you work really hard to

play01:40

implement a feature and at a very short

play01:43

period after that somebody comes along

play01:45

and they don't like some aspect of it or

play01:47

they don't understand it and they

play01:48

rewrite all of it so if you follow some

play01:50

of the things i'm going to share with

play01:51

you today i think it's really going to

play01:52

increase the shelf life of your code and

play01:54

that's actually going to be much more

play01:56

valuable to your company because i think

play01:58

one of the biggest wastes of time on

play01:59

many software projects is rewriting code

play02:02

that already works just to suit

play02:04

someone's preferences when there's not

play02:05

really a refactoring reason that's

play02:07

actually adding value to the project so

play02:10

what are some habits you can put in

play02:11

place to write code like a truly senior

play02:14

programmer well i think the first habit

play02:16

you can put in place is completing your

play02:19

work before moving on there's immense

play02:21

pressure on many projects especially if

play02:23

you're doing scrum or something like

play02:24

that to say that you're done with work

play02:27

and know that okay i'm 85 done but

play02:30

there's a little bit of the code that's

play02:31

left and i'll just leave that to a

play02:33

future time i'll come back and fix it

play02:35

but at least in my experience after many

play02:37

projects i've been on when i do that i'm

play02:40

basically building up technical debt for

play02:42

myself now nobody else may see it i may

play02:44

be the only person on the team that's

play02:46

aware of it but it's ultimately there

play02:47

and somebody else will become aware of

play02:49

it and a lot of times when i'm reporting

play02:51

status to project managers about what

play02:54

i'm working on i have to be really

play02:56

honest if i'm going to be truly

play02:57

professional and say no i'm not done

play02:59

with this task and if the rest of the

play03:01

team or the management is frustrated i'd

play03:03

much rather have them be frustrated and

play03:06

have them know the real state of the

play03:07

project then basically lie to them to

play03:10

just say i'm done with something so

play03:11

having the self-discipline to really

play03:13

look at your code like this is my

play03:14

personal brand scott nimrod talked about

play03:17

that in the first interview i did with

play03:19

him i thought that was such a great

play03:20

point that every time we write code

play03:22

somebody else is going to look at it

play03:23

down the road and basically they're

play03:25

going to measure what they think of us

play03:27

based on that code so having some pride

play03:30

and making sure that you really finish

play03:32

it before you move on is honestly one of

play03:34

the first things you can do if you

play03:35

really want to be taken seriously as a

play03:37

senior programmer

play03:46

the second thing i see truly senior

play03:48

programmers do is they enforce coding

play03:50

standards luckily today and we didn't

play03:53

have this 15 plus years ago you know if

play03:55

you're using vs code or something like

play03:57

that you know emacs and vim and some

play03:59

other tools will do this too most

play04:02

languages have auto formatting so you go

play04:04

in you write your code if you decide to

play04:06

put your line breaks and your curly

play04:08

braces in different spots

play04:09

once you save the file it'll format

play04:11

everything for you in a consistent way

play04:13

but if you don't have something like

play04:15

that finding a third-party tool if

play04:17

you're using visual studio or like a

play04:19

thicker ide that has a lot more features

play04:21

something like that there are plug-ins

play04:23

for it that will let you do code

play04:25

formatting and establish code formatting

play04:27

for your team but some of the most

play04:28

frustrating code bases i've worked on

play04:30

have been where everybody has a

play04:32

completely different standard for

play04:34

formatting their code and it's so easy

play04:36

especially as a consultant sometimes

play04:38

when i come in on an existing project

play04:39

that i'm asked to audit to tell that

play04:42

very different developers wrote the code

play04:44

and it's really frustrating to have to

play04:46

read different styles of code when

play04:48

honestly we've got the technology today

play04:50

to do it now i still think it makes

play04:52

sense to write a wiki topic or have a

play04:54

markdown file or something somewhere

play04:56

that's really easy for the team to get

play04:58

to that says these are our coding

play04:59

standards and if you just use an

play05:01

off-the-shelf standard like that's been

play05:03

established by an open source community

play05:04

or something like that that's even

play05:06

easier because you can just say we're

play05:07

using this standard and give them a link

play05:09

to that standard to read about it

play05:10

another thing you can do that will

play05:12

really help you write truly senior level

play05:15

code i think is to get much more

play05:17

disciplined about documenting patterns i

play05:20

see many teams who will start a new

play05:22

software project they'll discuss amongst

play05:24

themselves pick a set of patterns some

play05:26

of them are just open source very well

play05:28

known patterns and some of them are not

play05:30

but especially like on a react project

play05:32

or something like that where you're

play05:33

using react just for the rendering part

play05:35

of the page and there's all these other

play05:37

libraries and different patterns you can

play05:39

pick from having at least one wiki topic

play05:41

or markdown file or something that says

play05:43

here's all the patterns that we've

play05:45

agreed we're going to use on the project

play05:47

i think is really valuable because that

play05:49

way too if you're doing code reviews or

play05:51

something like that and you find the

play05:52

developer on your team is using some

play05:54

other pattern it's not just arbitrary

play05:56

where you're like well we picked this

play05:57

pattern we didn't tell you about it you

play05:59

can be like hey remember when you joined

play06:00

the project we showed you this page with

play06:03

all the patterns this is one we haven't

play06:04

agreed on now if you're using an

play06:06

off-the-shelf pattern something that's

play06:07

already part of a framework or a

play06:09

language that you're using i think a

play06:11

really good idea can be just to include

play06:13

a link to the documentation somewhere

play06:15

online that at least has like a tutorial

play06:17

or explains how to use that pattern just

play06:20

to make it easier on your team so that

play06:22

they're not googling to try to find some

play06:24

example that might not be the example

play06:26

that you want them to look at for a

play06:28

pattern that already exists now if you

play06:30

have a pattern that's new you've created

play06:32

some pattern to be dry or basically to

play06:35

make the code easier to write i often

play06:37

see people that will introduce a pattern

play06:38

they'll do a brown bag lunch or a demo

play06:41

or like a meeting over slack and they'll

play06:43

show it to the development team and then

play06:45

that's the last time they talk about it

play06:47

and i think every single new pattern

play06:49

that you introduce for which there is an

play06:50

existing documentation you gotta create

play06:52

a wiki topic or a markdown article or

play06:55

something that says okay here's the

play06:57

purpose of this pattern here's when you

play06:59

would use it here's when you would not

play07:01

use it and here's some example snippets

play07:04

of code that will show you how to

play07:05

actually apply it in some common

play07:07

scenarios

play07:07

[Music]

play07:15

as a consultant i'll tell you one of the

play07:17

things my clients really like that i do

play07:19

for them is i often any code that i

play07:21

write in any project i'm on am really

play07:23

anal to be honest about my documentation

play07:26

but i just find the great thing about

play07:28

that is the the other developers on my

play07:30

team especially when i come in and

play07:31

remember i'm a consultant i'm not part

play07:33

of their company they love working with

play07:35

me because they have all these topics to

play07:37

go to i'm really disciplined about that

play07:39

so if you really want to get looked at

play07:41

as a senior programmer unfortunately a

play07:44

lot of these things that we've convinced

play07:45

ourselves aren't really important like

play07:47

self-documenting code you really just

play07:49

need to reject some of that and actually

play07:51

have just the maturity and the

play07:53

professionalism to really just step back

play07:56

and take the time and actually document

play07:58

the patterns and the decisions that

play07:59

you've made on your project another

play08:01

thing that will really help you work

play08:03

with other developers like a truly

play08:05

senior programmer would write code is to

play08:07

review any new pattern you're

play08:09

introducing to the project as soon as

play08:11

you've introduced it i've been on

play08:12

projects before where let's say there's

play08:14

one developer that's come up with a new

play08:16

way they want to access the database

play08:17

that's different than how everybody's

play08:19

been doing it it's a completely

play08:20

different library and they just

play08:22

introduce it to the code and over

play08:24

several sprints or just months of

play08:26

development they just start to slowly

play08:28

roll it out and introduce it to every

play08:30

feature across the code base and they

play08:31

never told anybody about it and then

play08:33

they find out later that somebody

play08:35

already evaluated that pattern and they

play08:37

had really good reasons for why they

play08:39

didn't want to use it and now it makes

play08:41

the person look kind of like an idiot

play08:43

because they realize that it's not

play08:44

actually going to meet the requirements

play08:45

of something that maybe another person

play08:47

on the team already knows is coming

play08:49

later in the code base

play08:51

so i would just suggest if you're going

play08:53

to do something like that change a

play08:55

pattern or introduce a new pattern put

play08:57

just enough code into the project to

play08:59

demonstrate it and then get with your

play09:01

team show it to them ask for feedback

play09:04

they're probably going to have some

play09:05

opinions on ways you could do it even

play09:07

better and then you can get buy-in from

play09:09

everyone and they'll actually be

play09:10

supportive of it and you can actually

play09:12

enlist all the other developers on your

play09:14

team to help you incrementally add that

play09:17

pattern to the code instead of putting

play09:19

it all on yourself

play09:21

[Music]

play09:28

another thing you can do that will

play09:30

really help you write code like truly

play09:32

senior programmers that i've worked with

play09:34

is never create a user story or a ticket

play09:37

or if you're using jira something like

play09:39

that a task that represents refactoring

play09:43

why would i say this well anything that

play09:45

you put in as an individual item that

play09:47

your management can see is something

play09:49

they can take out and i just find that

play09:52

building quality into code is something

play09:53

that we as developers i think we have to

play09:56

take responsibility for it and as

play09:58

professionals we have to actually

play10:00

prevent our management from making bad

play10:02

decisions that are going to tank their

play10:04

project whether it's through technical

play10:06

debt or just not delivering stuff that

play10:08

actually can be extended as the project

play10:10

evolves so when i'm on a project and i

play10:12

realize refactoring needs to be done i

play10:14

never create a ticket or a user story or

play10:18

estimate a refactoring effort what i do

play10:20

instead is i discuss it with the rest of

play10:23

the developers and we come up with a

play10:25

plan on how to spread that effort across

play10:27

the team so we can incrementally

play10:29

refactor now incremental refactoring is

play10:32

a really valuable skill and i meet a lot

play10:34

of developers who don't know how to do

play10:35

this they look at it like okay if we're

play10:37

going to change let's say the database

play10:39

pattern we're using or we're going to

play10:40

change some way that we do state

play10:42

management react we're going to use

play10:43

redux or something like that we have to

play10:45

now take a two week period or a month

play10:48

and refactor all the code to do that

play10:50

it's a lot smarter to just decide on the

play10:52

development team okay every time we get

play10:54

a feature we're going to basically add

play10:56

some time to it so that we build that

play10:57

new feature using the new pattern and we

play11:00

also go back to one or two other

play11:01

features and update it to use this new

play11:04

pattern that we've agreed upon the key

play11:06

though is don't call that out as a

play11:08

separate item because again management

play11:10

will be tempted to pull that out and i

play11:12

think as professionals we can't let that

play11:15

happen and the final thing that i think

play11:17

will really help you write code like

play11:19

truly senior programmers and i love when

play11:21

people do this on my teams is anytime

play11:24

you're asked to estimate work you gotta

play11:26

add extra time for unexpected design

play11:29

meetings and documentation that you

play11:31

might have to write it's so common when

play11:33

i'm on projects i'm going along writing

play11:36

code starting to implement a feature and

play11:38

i find out ooh there's some uncertainty

play11:41

in here and to meet the requirements now

play11:43

i've got to add some new documentation

play11:45

and the worst thing is having to go back

play11:47

to a project manager or a scrum master

play11:49

and say hey i need to add a new user

play11:52

story for this new document that i need

play11:54

to write i mean you're almost like

play11:56

guaranteeing that you're going to be

play11:58

micromanaged if you do things like that

play12:00

so i always tell people give yourself

play12:02

extra time not just for meetings and

play12:04

uncertainty and all that but writing

play12:06

documentation if you really want to keep

play12:08

the quality of the code high and you

play12:10

want to keep the team as productive as

play12:12

possible you have to protect your

play12:14

commitments with the extra time that you

play12:16

know it takes to write really excellent

play12:19

professional code i know a lot of these

play12:21

are my opinions today there's probably

play12:23

things that you agree with you don't

play12:25

agree with leave me some comments below

play12:27

i'd be really interested to know if you

play12:29

don't agree with me why and what would

play12:30

you suggest instead and if you've also

play12:32

got some other suggestions for what

play12:34

makes someone a truly senior programmer

play12:37

let me know about it until next time

play12:40

thanks

play12:46

[Music]

play12:57

do

play13:01

[Music]

play13:08

[Music]

play13:36

you

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Senior CodingCode QualityDocumentationTeamworkRefactoringTechnical DebtSoftware DevelopmentProject ManagementCoding StandardsIncremental Improvement