Open in app

Sign In

Write

Sign In

Maximiliano Contieri
Maximiliano Contieri

1.7K Followers

Home

Lists

About

Published in

Dev Genius

·Pinned

How to Develop a Wordle Game using TDD in 25 Minutes

Developing a complete Wordle Game is very easy with TDD — Everybody is playing Wordle these days… And I love TDD. TDD Conference 2021 — All Talks First International Test Driven Development took place on July 10th.blog.devgenius.io So, let’s get moving… TL;DR: With just a few steps we can build a robust Wordle. Defining a word The minimum information amount in Wordle is a word. We can argue that letter is smaller, but we think all needed letter protocol is…

Test Driven Development

6 min read

How to Develop a Wordle Game using TDD in 25 Minutes
How to Develop a Wordle Game using TDD in 25 Minutes
Test Driven Development

6 min read


Published in

Dev Genius

·Pinned

How to Get Rid of Annoying IFs Forever

Why the first instruction we learn to program should be the last to use. Nobody uses GOTO instruction anymore and few programming languages still support it. We have matured and confirmed spaghetti code is unmaintainable and error prone. Structured Programming solved that problem years ago. We got rid of the…

If

6 min read

How to Get Rid of Annoying IFs Forever
How to Get Rid of Annoying IFs Forever
If

6 min read


Published in

Dev Genius

·Pinned

Code Smell 13 — Empty Constructors

Incomplete objects cause lots of issues. Problems Mutability Incomplete objects Concurrency inconsistencies between creation and essence setting. Setters Nude Models — Part I : Setters Ye olde Reliable Data Structures and Their Controversial (Write) Access.medium.com Solutions Pass the object’s essence on creation The evil powers of mutants To mutate is to evolve. It was proposed by Sir Charles Darwin and we use it in the software industry. But something is…codeburst.io

Code Smells

2 min read

Code Smell 13 — Empty Constructors
Code Smell 13 — Empty Constructors
Code Smells

2 min read


Published in

Dev Genius

·Pinned

How to Find the Stinky Parts of Your Code

The code smells bad. Let’s see how to change the aromas. — TL;DR: A Compilation of bad smells in code. In this series, we will see several symptoms and situations that make us doubt the quality of our developments. We will present possible solutions. Most of these smells are just clues of something that might be wrong. They are not rigid rules. Code Smells Code Smell 01 — Anemic Models Your objects are a bunch of public attributes without behavior.medium.com

Code Smells

16 min read

How to Find the Stinky parts of your Code
How to Find the Stinky parts of your Code
Code Smells

16 min read


Published in

Dev Genius

·Pinned

Code Smell 01 — Anemic Models

Your objects are a bunch of public attributes without behavior. — Protocol is empty (with setters/getters). If we ask a domain expert to describe an entity he/she would hardly tell it is ‘a bunch of attributes’. Problems No Encapsulation. No mapping to real world entities. Duplicate Code Coupling Solutions 1) Find Responsibilities. 2) Protect your attributes. 3) Hide implementations. 4) Delegate Examples

Code Smells

1 min read

Code Smell 01 — Anemic Models
Code Smell 01 — Anemic Models
Code Smells

1 min read


Published in

Level Up Coding

·6 days ago

Code Smell 225 — Pass by Reference

Pass by copy, pass by reference. which is better? — TL;DR: Beware of passing arguments by reference Problems Unexpected Results Side Effects Readability Broken Encapsulation Solutions Pass arguments by copying even large objects. Don’t make premature optimizations. Declare variables as constants Refactor the code Make objects immutable to avoid accidental changes 5 Use Pure Functions Context A call-by-reference language like C# or PHP…

3 min read

Code Smell 225 — Pass by Reference
Code Smell 225 — Pass by Reference

3 min read


Published in

Level Up Coding

·Sep 12

Code Smell 224 - Deodorant Comments

You use nice words to excuse bad code — TL;DR: Don't excuse bad code. Write a clean one! Problems Readability Solutions Rewrite the code and delete the comment Context The term comes from Martin Fowler's book "Refactoring: Improving the Design of Existing Code" Sample Code Wrong # This is a function that adds two numbers def s(a, b): # Now you are going…

2 min read

Code Smell 224 - Deodorant Comments
Code Smell 224 - Deodorant Comments

2 min read


Published in

Level Up Coding

·Sep 3

Code Smell 223 — Racial Naming

Software evolves, and so does culture. — TL;DR: Avoid old terms like whitelists, blacklists, master, etc. Problems Racial Connotations Exclusionary Language Diverse Perspectives Solutions Use alternative terminology Context Language evolves, and technical terms should follow it. You can change racial names with alternative terminology: Allowlist: Replace “whitelist” with “allowlist.” This term maintains the intended meaning without racial connotations.

2 min read

Code Smell 223 — Racial Naming
Code Smell 223 — Racial Naming

2 min read


Published in

Level Up Coding

·Aug 29

Code Smell 222 - Comma Operator

Don't abuse this fancy operator — TL;DR: Use comma operator just for loops Problems Readability Hidden Defects Solutions Avoid operator usage Prefer foreach operator Break the sentences Context In JavaScript, the comma operator allows you to evaluate multiple expressions sequentially and return the value of the last expression. It's denoted by a comma and separates multiple expressions within a…

Code Smells

2 min read

Code Smell 222 - Comma Operator
Code Smell 222 - Comma Operator
Code Smells

2 min read


Published in

Level Up Coding

·Aug 9

Code Smell 221 - Missing Break in Switch

You abuse cases in switches and make subtle mistakes — TL;DR: Cases are GOTOs, but you might be missing them Problems Hidden defects Readability Solutions Add the missing break Convert the switch into a polymorphic hierarchy Remove the default switch Context In a switch statement, when a match is found in a particular case, the code execution will start from that case and…

2 min read

Code Smell 221 - Missing Break in Switch
Code Smell 221 - Missing Break in Switch

2 min read

Maximiliano Contieri

Maximiliano Contieri

1.7K Followers

I’m a senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan. Maximilianocontieri.com

Following
  • Josef Cruz

    Josef Cruz

  • Ritesh Shergill

    Ritesh Shergill

  • Stefan Kojouharov

    Stefan Kojouharov

  • Jesus Rodriguez

    Jesus Rodriguez

  • John Au-Yeung

    John Au-Yeung

See all (462)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams