You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
9.9 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Semantic Modules</title>
  6. <link rel="stylesheet" href="ui/state.js" type="text/css" media="screen" />
  7. <link rel="stylesheet" href="ui/panel.css" type="text/css" media="screen" />
  8. <link rel="stylesheet" href="ui/button.css" type="text/css" media="screen" />
  9. <link rel="stylesheet" href="ui/table.css" type="text/css" media="screen" />
  10. <link rel="stylesheet" href="../src/shape.css" type="text/css" media="screen" />
  11. <link rel="stylesheet" href="example.css" type="text/css" media="screen" />
  12. <script src="../dependencies/jquery.js" type="text/javascript"></script>
  13. <script src="ui/state.js" type="text/javascript"></script>
  14. <script src="../dependencies/transform2d.js" type="text/javascript"></script>
  15. <script src="../dependencies/transform3d.js" type="text/javascript"></script>
  16. <script src="../src/shape.js" type="text/javascript"></script>
  17. <script src="example.js" type="text/javascript"></script>
  18. </head>
  19. <body id="example">
  20. <div class="container">
  21. <h1 id="the-problem">The problem</h1>
  22. <p>The DNA of the web is user interface but the DNA of websites is HTML</p>
  23. <h2 id="issues-with-html-as-a-building-block-of-websites">Issues with HTML as a building block of websites</h2>
  24. <ul>
  25. <li>Browsers had to write interpreters for web coding languages before the web became universal popular, so the majority of the lasting decisions on the html standard weere made without the foreknowledge of what the web could be, href= 'hypertext reference', 'a' anchor for a web link. Based on naming conventions and suppositions of a small group of decision makers at a particular moment in history.</li>
  26. <li>Additions to HTML standards were done in a legitimately conservate way to preserve compatability and momentum, consistency etc. </li>
  27. <li>Falls into the Prescriptivist/descriptivist trap in linguistics. </li>
  28. <li>Example: Académie française, french institute that acts as a watchguard on the usage of french language, voices opinion to government about the 'corruption' of the language based on common usage, foreign influences, etc. http://en.wikipedia.org/wiki/Acad%C3%A9mie_fran%C3%A7aise#Role_as_authority_on_the_French_language </li>
  29. <li>Another <DFW Article on the subject> http://instruct.westvalley.edu/lafave/DFW_present_tense.html</li>
  30. </ul>
  31. <h3 id="not-completely-semantic">Not completely semantic</h3>
  32. <ul>
  33. <li>Examples: hgroup, ul, li, href, </li>
  34. <li>What would the logical children elements for these elements be?</li>
  35. <li>TR &gt; TD (What is a td anyone know?)</li>
  36. <li>Hgroup &gt; h1 h2 (How does this make sense?)</li>
  37. <li>UL &gt; LI (Why? Who thought of this?)</li>
  38. <li>There's nothing semantic about an hgroup. It' as idiomatic as me referring to a group of people a a pgroup. Maybe over time my friends could get used to me saying this, but why should they?</li>
  39. <li>Who here refers to links as "hypertext references", yet now HREF is codified. And links are 'a' as in short for anchor? </li>
  40. <li>Ok this may be taking things overboard but its to prove a point, that coding language is unconventional</li>
  41. </ul>
  42. <h3 id="incompleteness-compels-developers-to-add-their-own-conventions">Incompleteness compels developers to add their own conventions</h3>
  43. <ul>
  44. <li>Everyone who codes front end knows the possible minefield you encounter when collaborating on a large project.</li>
  45. <li>Every developer is king of their own naming domain, and has idiomatically created their own schemas for naming everything. Everything on the site had at some point to be subjected to their own naming decisions. These decisions could be influenced by personality, culture, what mood their in, etc.</li>
  46. <li>How many ways can we say the same thing? </li>
  47. <li>
  48. <p>Example: A modal has just poped on the screen. What should it be called? </p>
  49. <p>&lt;div id=&quot;modal_visible&quot;&gt; &lt;div id=&quot;login&quot;&gt; &lt;div class=&quot;pop_up_login&quot;&gt;&lt;/div&gt;</p>
  50. </li>
  51. <li>
  52. <p>All of these are correct by nature, but why are we redefining everything? </p>
  53. </li>
  54. </ul>
  55. <h2 id="how-to-fix-the-problem">How to fix the problem</h2>
  56. <h3 id="a-semantic-approach">A semantic approach</h3>
  57. <p>Well if progressing html isnt the future of a re-useable, semantic web than what could be?</p>
  58. <h3 id="whats-good-from-html">What's good from HTML</h3>
  59. <ul>
  60. <li>A good way to approach what's useful is to look at whats used.</li>
  61. <li>People really liked 'ul' and 'li' for explaining grouping. All sorts of things people dont usually think of as lists seem to find representation in html usage as Unordered list is a slightly obtuse concept, but perhaps there's something in the nature of defining a plural and singular relationship.</li>
  62. <li>Classnames appear to be the most useful aspect of code because they allow for everything. A catch-all for all the things html hasnt defined. </li>
  63. </ul>
  64. <h3 id="some-presumptiveness">Some presumptiveness</h3>
  65. <ul>
  66. <li>HTML and CSS are languages used to describe structural relations and appearances, which is a much easier task to accomplish than giving a more abstract explanations of behavior or instructions. </li>
  67. <li>Physical, declarative langauge was one of the first aspects of language to evolve. Think caveman running into a cave and saying "two big tiger". this is enough to convey to the other caveman to run further into the cave. </li>
  68. <li>Language have been selected for and evolved since prehistoric times. Its terse, universal, and selected for by convention and usage not top-down.</li>
  69. <li>How many words do you need in a vocabulary? To read a chinese newspaper you need around 4,000 characters. That's good enough for describing most anything you will encounter or experience. And thats damn near everything in the world! We only need to account for a language and (definition) for a website, which needs a much much smaller subset of language. Maybe even a hundred or so discrete element definitions.</li>
  70. <li>For proof that this concept is viable, and that not all the web is idiosyncratic, and unable to be defined in common ui, look at the success of Twitter's Bootstap library, which paved the way for reusable UI components. </li>
  71. <li>These UI elements can be defined in language anyone can understand. Dropdowns, Modal, Button Groups. These are all parts of the english vernacular that did not exist two decades ago, but miraculously has evolved as language has adapted to fill in the gaps. This is what should inform our naming decisions in code. Usage.</li>
  72. </ul>
  73. <h3 id="how-we-actually-do-the-dirty-business-of-making-a-semantic-standard-for-ui">How we actually do the dirty business of making a semantic standard for ui</h3>
  74. <ul>
  75. <li>Define a set of elements as nouns. "ui button", "ui field" "ui form"</li>
  76. <li>Define a set of modifiers that are universal and carry the same meaning (when appropriate). i.e. if "large" means 20px tall. Then anything that is large should be 20 pixels tall, ex1. "large button", "large header". ex2. red. "grey field", "grey button".</li>
  77. <li>Assume prototypical qualities if no modifiers present. I.e. If i ask you to imagine a bunny, you probably imagine a white furry animal with 2 long ears." without having to imply all those characteristics. In the same way the definition of "button" should account for all the prototypical qualities while the modifiers only the modifying qualities.</li>
  78. <li>Reduce language complexity (KISS) by defining relationships using plural/singular relations. We dont go around saying "there is a large man and a large man and a large man", you just say "There are three large men". in the same way "<div class'two ui buttons">" can define the size and proportions of its children elements more succinctly then classing them all.</li>
  79. <li>Avoid jargon and idiomatic expressions, stick to common usage. (Keep the ego out)</li>
  80. </ul>
  81. <h3 id="once-you-create-a-visual-vocubulary">Once you create a visual vocubulary</h3>
  82. <ul>
  83. <li>If you can define a standard for a button, say that it can be either tiny, small, medium, big, large, huge or gigantic. Or it can be red, yellow, green, or blue. Then the task for a front end developer becomes explaining how this website's definition of a button strays from standard, not redefining what a button is from scratch over and over.<br />
  84. </li>
  85. <li>This task now only requires them redefining the modifiers, not the button element, or any of the causal relationships.</li>
  86. <li>Once a consensus spec is built for user interface. Then modules have predefined ui components to work with. No arbitrary selectors, or redefining ui elements on a module level. If a modal needs a button then it would use</li>
  87. </ul>
  88. <h3 id="as-it-would-exist">As it would exist</h3>
  89. <ul>
  90. <li>Nouns are classnames, modifiers are also classnames</li>
  91. <li>All ui elements are subclass "ui" to avoid collissions. <div class="ui button"></div></li>
  92. </ul>
  93. <h3 id="as-it-might-exist">As it might exist</h3>
  94. <ul>
  95. <li>Nouns are tags and always end in a noun, modifiers precede them.
  96. &lt;two large button&gt;
  97. &lt;button&gt;one&lt;/&gt;
  98. &lt;button&gt;two&lt;/&gt;
  99. &lt;/&gt;</li>
  100. </ul>
  101. <h2 id="why-try-to-fix-this-problem">Why try to fix this problem</h2>
  102. <p>Its important to acknowledge there has been lots of work which has attempted to solve this already. Or to take these techniques at heart when creating a language. The higher order-ness of SQL for example "SELECT FROM TABLE WHERE CONDITION"</p>
  103. <h2 id="make-coding-more-accessible">Make coding more accessible</h2>
  104. <p>There have been numerous make programming accessible, KhanAcademy, Code Academy, meetup groups. Gamification. All these problems are great, but solve the issue of making learning programming more difficult
  105. Tackling the issue of making programming less difficult is a separate issue entirely. This has been tackled in the past from the perspective of gurus helping making programming less difficult for gurus, i.e dart/cofeescript, or less/sass, but has not been tackled much for making languages easier for complete beginners.</p>
  106. <p>stopped writing for time constraints.</p>
  107. </div>
  108. </body>
  109. </html>