<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maxx Greene</title>
    <description>The latest articles on DEV Community by Maxx Greene (@maxxgreene).</description>
    <link>https://dev.to/maxxgreene</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F568126%2F5620c5cb-88bc-4b7d-b0a0-b472790ca224.png</url>
      <title>DEV Community: Maxx Greene</title>
      <link>https://dev.to/maxxgreene</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxxgreene"/>
    <language>en</language>
    <item>
      <title>Our component development principals.</title>
      <dc:creator>Maxx Greene</dc:creator>
      <pubDate>Thu, 28 Jan 2021 18:18:33 +0000</pubDate>
      <link>https://dev.to/react-rainbow/our-component-development-principals-h8d</link>
      <guid>https://dev.to/react-rainbow/our-component-development-principals-h8d</guid>
      <description>&lt;p&gt;Building a component library it’s not an easy task, notably when it fulfills the purpose of being used by multiple projects and requirements are continually changing. Given these challenges, we have a set of principles that guide us through the process of creating reliable components.‌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API design is foundational:&lt;/strong&gt; We take this field seriously.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Don’t start writing any code until the specification document is done and evaluated by the team.&lt;/li&gt;
&lt;li&gt;Design from restricted API then relax based on valid use cases.&lt;/li&gt;
&lt;li&gt;Create a deterministic API that doesn’t allow you to do the same thing in two different ways.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Defer it as long as possible. The best way of reducing the impact of breaking changes is to avoid them in the first place.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Until you have the information necessary, you are just guessing at what is needed and your success is determined largely by luck. I also believe you may be grossly underestimating the costs of speculation. — &lt;a href="https://wiki.c2.com/?WayneMack"&gt;WayneMack&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generalization process is the key to avoid breaking changes. Avoid generalizing your component too early but keep in mind that the new API shouldn’t compromise generalize when new use cases arrive. I wrote more about this interesting topic &lt;a href="https://medium.com/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-88b68421792c"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;First-class Testing&lt;/strong&gt;: Our components are test infected. There isn’t software improvement without refactoring and there isn’t refactoring without tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internationalization&lt;/strong&gt;: We design each component with &lt;a href="https://en.wikipedia.org/wiki/Internationalization_and_localization"&gt;i18n&lt;/a&gt; in mind. Any new component or feature has to be able to work fully in different locales.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://react-rainbow.io/"&gt;react-rainbow-components&lt;/a&gt; wouldn’t be possible without the support of engineers from around the world. Thus, building a component library with internationalization is a requirement, not a nice to have.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;: It’s part of our definition of done. It’s a must-have for each component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: It’s critical to the success of any project. There is no adoption without good documentation.&lt;/p&gt;

&lt;p&gt;I know you have your own set of principles, let us know if ours make sense to you, we are eager to learn from you. Comment below.&lt;/p&gt;

</description>
      <category>components</category>
      <category>library</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Generalization Process applied to API design of UI components.
</title>
      <dc:creator>Maxx Greene</dc:creator>
      <pubDate>Thu, 28 Jan 2021 18:05:31 +0000</pubDate>
      <link>https://dev.to/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-6hc</link>
      <guid>https://dev.to/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-6hc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;To make a piece of machinery “more general” you have to modify it to be capable of doing something other than what it already does, while making sure it can still do what it does now.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is Generation Process?
&lt;/h3&gt;

&lt;p&gt;If you search on Google about “Generation Process” one of the first results returned — at least for my Google profile :) — would be the Wikipedia &lt;a href="https://en.wikipedia.org/wiki/Generalization" rel="noopener noreferrer"&gt;definition&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Basically, the definition describes that given two related concepts A and B, A is a “generalization” of B (equivalent, B is a &lt;a href="https://en.wikipedia.org/wiki/Special_case" rel="noopener noreferrer"&gt;special case&lt;/a&gt; of A) if and only if both of the following hold:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every instance of concept B is also an instance of concept A.&lt;/li&gt;
&lt;li&gt;There are instances of concept A which are not instances of concept B.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The concept might have a more specific meaning in a specialized context(e.g. generalization in learning, generalization in programming).&lt;/p&gt;

&lt;h3&gt;
  
  
  Generalization in programming
&lt;/h3&gt;

&lt;p&gt;In my early days doing programming with Delphi and later with Java everything was about Object-Oriented Programming(OOP). Back then we read &lt;a href="https://www.amazon.com/Object-Oriented-Analysis-Design-Applications-3rd/dp/020189551X" rel="noopener noreferrer"&gt;Object-oriented analysis and design with applications&lt;/a&gt; and Generalization was tight in our mental model to Inheritance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmpteivbeac10bm1xs3b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmpteivbeac10bm1xs3b4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concept of &lt;strong&gt;Animal&lt;/strong&gt; is a generalization of the concept of &lt;strong&gt;Dog&lt;/strong&gt; since every dog is an animal but not every animal is a dog(a cat, for instance).&lt;/p&gt;

&lt;p&gt;Here some other examples of Generalization in programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Classes&lt;/strong&gt;. Abstract classes isolate the common characteristics of their descendants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templates&lt;/strong&gt;. Templates allow functions and classes to be parameterized by type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Libraries&lt;/strong&gt;. Placing a piece of code in a library allows it to be used by more than one program.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How we applied it to UI components API design?
&lt;/h3&gt;

&lt;p&gt;A UI component implementation by itself is a Generalization of all the use cases that support when you build it to be reusable in more than one use case or in more than one application. But how is Generation related to API design?&lt;/p&gt;

&lt;p&gt;When designing a component API you should defer implementing features as long as possible to avoid making guesses.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Until you have the information necessary, you are just guessing at what is needed and your success is determined largely by luck. I also believe you may be grossly underestimating the costs of speculation. &lt;a href="https://wiki.c2.com/?WayneMack" rel="noopener noreferrer"&gt;WayneMack&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At some point, you can’t defer anymore a new feature for a component, it’s clear that this feature belongs to component A, then one of the first question to ask ourself is, how the new version of the API won’t compromise the previous use cases.&lt;/p&gt;

&lt;p&gt;In other words, if every use case of your component is a special case of your component API, the new API must not conflict with the previous use cases or that will be considered a breaking change or a violation of the generalization process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There isn't a single receipt for always apply the generalization process on API design. I always try to exercise &lt;em&gt;generalization&lt;/em&gt; with the future API of the component by asking: how the new API won’t compromise other use cases we might want to implement in the future?&lt;/p&gt;

&lt;p&gt;Ultimately we need to be fine with designs we agreed on, they could be designed to not support certain use cases.&lt;/p&gt;

</description>
      <category>api</category>
      <category>programming</category>
      <category>design</category>
      <category>components</category>
    </item>
  </channel>
</rss>
