avatarBirat Rai

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1630

Abstract

code becomes more testable as the code encapsulates behavior that is easily testable.</li><li>The code facilitates reuse across applications and systems.</li><li>The compiler gives an error for statically typed languages whereas, unit tests will help for the dynamically typed languages.</li></ul><p id="39a9" type="7">TL;DR Start exploring domain-specific types for the purpose of developing quality software.</p><p id="a0c3"><a href="https://readmedium.com/97-journey-every-programmer-should-accomplish-a0c53dbbfd47"><i>Go to the series</i></a>.</p><div id="10b2" class="link-block"> <a href="https://readmedium.com/97-journey-every-programmer-should-accomplish-a0c53dbbfd47"> <div> <div> <h2>97 Journey Every Programmer should Accomplish</h2> <div><h3>“A journey of a thousand miles begins with a single step.”</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*ImU1JEXOUUKMJxBF_OP-_w.png)"></div> </div> </div> </a> </div><p id="d42c">Go to <b>64th<i> Step</i></b></p><div id="f3ab" class="link-block"> <a href="https://readmedium.com/step-64-pair-program-and-feel-the-flow-e643a3936d2e"> <div> <div> <h2>Step 64: Pair Program and Feel the Flow~</h2> <div><h3>This is the 64th Step towards gaining the Programming Enlightenment series. If you didn’t learn the 63rd Step, read it.</h3></div>

Options

 <div><p>medium.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*MRJXmrlC2zVOTenTx_XGLA.jpeg)"></div>
          </div>
        </div>
      </a>
    </div><p id="5f94">Go to <b>66th Step</b></p><div id="1e43" class="link-block">
      <a href="https://readmedium.com/step-66-prevent-errors-giles-colborne-140c3234d43f">
        <div>
          <div>
            <h2>Step 66: Prevent Errors ~ Giles Colborne</h2>
            <div><h3>This is the 66th Step towards gaining the Programming Enlightenment series. If you didn’t learn the 65th Step, read it.</h3></div>
            <div><p>medium.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*o--GgnrJdWgbZdqtfJU4iA.png)"></div>
          </div>
        </div>
      </a>
    </div><blockquote id="ba78"><p><b>References:</b></p></blockquote><ul><li><a href="https://www.gitbook.com/book/97-things-every-x-should-know/97-things-every-programmer-should-know/details"><i>97 things Every Programmer Should Know</i></a> ~ Git Book</li><li><a href="https://www.amazon.com/Things-Every-Programmer-Should-Know/dp/0596809484"><i>97 Things Every Programmer Should Know</i></a> ~ Paperback</li><li><a href="https://en.wikipedia.org/wiki/Primitive_data_type"><i>Primitive Data Type</i></a> ~ Wiki</li><li><a href="https://en.wikipedia.org/wiki/Abstract_data_type"><i>Abstract Data Type</i></a> ~ Wiki</li></ul></article></body>

Step 65: Prefer Domain-Specific Types to Primitives~

This is the 65th Step towards gaining the Programming Enlightenment series. If you didn’t learn the 64th Step, read it.

Data Types

What is Primitives?

It is a basic type of data type provided by a programming language. We can create more complicated using these basic types. Examples, int, float, boolean, etc.

What is Domain-Specific Types?

Also known as Abstract Data Types. These are the more complicated data types that are constructed using the primitive data type. The class represents the Domain-Specific types in modern languages. Example; VelocityInKnots, DistanceInNauticalMiles, UserAge, UserSex, etc.

Why use Domain-Specific Type?

  • The code becomes more readable as it expresses concepts of a domain, not just float or string.
  • The code becomes more testable as the code encapsulates behavior that is easily testable.
  • The code facilitates reuse across applications and systems.
  • The compiler gives an error for statically typed languages whereas, unit tests will help for the dynamically typed languages.

TL;DR Start exploring domain-specific types for the purpose of developing quality software.

Go to the series.

Go to 64th Step

Go to 66th Step

References:

Programming
Java
Software Development
Android
Coding
Recommended from ReadMedium