Refactor site structure to put general information (such as brief introduction to...
authorNick Downing <nick@ndcode.org>
Tue, 18 Jan 2022 03:57:49 +0000 (14:57 +1100)
committerNick Downing <nick@ndcode.org>
Tue, 18 Jan 2022 03:57:49 +0000 (14:57 +1100)
_menu.json
index.html.jst
projects/index.html.jst [new file with mode: 0644]

index 9a1b5bf..6edaaad 100644 (file)
@@ -1,7 +1,7 @@
 {
   "entries": [
-    {"dir": "jsdoc", "name": "JSDoc", "navbar": true},
-    {"dir": "sphinx", "name": "Sphinx", "navbar": true},
+    {"dir": "projects", "name": "Projects", "navbar": true},
+    {"dir": "sphinx", "name": "Documentation", "navbar": true},
     {"dir": "contact", "name": "Contact", "navbar": true},
     {"dir": "my_account", "name": "My account", "navbar": true},
     {"dir": "search", "name": "Search"}
index c34c82d..dc2a4f7 100644 (file)
@@ -1,8 +1,6 @@
 return async env => {
   let breadcrumbs = await _require('/_lib/breadcrumbs.jst')
-  let icon_jst = await env.site.get_min_svg('/_svg/icon_jst.svg')
   let navbar = await _require('/_lib/navbar.jst')
-  let icon_pitree = await env.site.get_min_svg('/_svg/icon_pitree.svg')
  
   await navbar(
     env,
@@ -12,52 +10,98 @@ return async env => {
     async _out => {
       await breadcrumbs(env, _out)
 
-      p {'We have developed these projects because we wanted to do things differently — and make our vision come to life. At times our vision is quite radical and creative, at other times we just fall back on good engineering and making it as simple as possible.'}
+      h4 {'About Dr. Nick'}
 
-      p {'Given that we do things differently, we have generally had to build up each idea into a complete framework that provides a comprehensive solution to a family of problems. Please do contribute to help make each framework more comprehensive over time.'}
+      p {'I have always been a technical guy, and I am usually found building something—unless I am spending quality time with my wife Laura or parenting a large brood of children. I like working with my hands, and equally my brain. And as I’m still using a physical keyboard, writing code allows me to do both!'}
+
+      h4 {'About this site'}
+
+      p {'This site serves as a repository for my open-source projects. Smaller projects will show up as a blog entry, and for long-term projects this expands to a project page, tutorials, online documentation and so forth. I would also welcome any contributions you may have.'}
 
       p {
-        'Go on, take a look inside! '
-        i {'[Actually don\'t because it\'s still under construction]'}
+        'My '
+        tt {'git'}
+        ' source code repositories are at '
+        a(href="https://git.ndcode.org") {'https://git.ndcode.org'}
+        ', and eventually there will be an '
+        tt {'apt'}
+        ' repository there too, for the binary versions of my packages. My project pages contain the explanations of what things are, with links to the appropriate repositories. I prefer not to use github, as I do not like the idea of for-profit companies using my work to bring traffic to their site. I’d rather that traffic came to '
+        i {'my'}
+        ' sites, where I could monetize it later if I saw fit.'
       }
 
-      ul.nav.flex-column {
-        li.nav-item {
-          a.nav-link {
-            table.icon-and-text {
-              tr {
-                td {
-                  _out.push(icon_pitree)
-                }
-                td {
-                  span.h1 {
-                    span.serif {'π'}
-                    'tree'
-                  }
-                  br {}
-                  span.h3 {'the source code analysis and transformation framework'}
-                }
-              }
-            }
+      h4 {'About my coding style'}
+
+      p {'I like precision and I generally don’t leave unhandled cases in my code. (In my long career as a professional programmer I’ve encountered Murphy’s Law on a regular basis). I also prefer consistency in matters such as identifier naming, indenting and so on.'}
+
+      p {'Having said that, my emphasis is on productivity rather than dotting i’s and crossing t’s. So my code is generally quite rough until I decide it needs to be polished up for release. As an example, suppose I’m writing a language compiler. Any language features that I do not use will not be implemented and will crash with an assertion failure or similar. I rely on people like yourself to download and exercise my code and inform me of the features you’ll use.'}
+
+      p {'I also rarely use comments in my code. One of the reasons why I avoid commenting, is that often you spend inordinate amounts of time writing up the interfaces and algorithms used in your code in great detail in comments, and then change your mind and delete big blocks of code—along with those painstakingly constructed comments. If you do not invest too much in the code in the first place, it’s easier to delete and refactor.'}
+
+      p {'Comments will be placed where I had to stop and think, if I realize the thought process probably won’t be obvious later. But good code should be self-documenting in general. For this reason I often write out longer code for things that could be done with language tricks, and I avoid abbreviation. Usually this is enough to record my intentions for later. But sometimes I really can’t understand what I wrote, and once I’ve figured it out again, I will leave a belated comment for next time!'}
+
+      h4 {'About my testing style'}
+
+      p {
+        'On this point I refer the reader to an excellent article, ‘'
+        a(href="https://techbeacon.com/app-dev-testing/no-1-unit-testing-best-practice-stop-doing-it") {'The No. 1 unit testing best practice: Stop doing it'}
+        '’. I do in fact use tests, and they are often to be found in a '
+        tt {'/test'}
+        ' or '
+        tt {'/tests'}
+        ' directory in my repositories, but the tests are only what I needed during development to exercise my code, and they might not be maintained once I am satisfied that the code works.'
+      }
+
+      p {'The problem with unit tests that are required to be maintained (usually as a matter of company policy) is that once again, you have invested a lot in how the code works at the present time, and this makes it much harder to refactor it. You need to be agile and be able to fix things when you see a better way, not get mired in mountains of administrative detail.'}
+
+      p {'If the code fails in the field or I decided to work on it again, I will maintain and extend the tests as required. But my point is simply that testing is not an end in itself, it’s a means to an end (reliable software). The best means to that end, in my view, is end-to-end testing (E2E). E2E is absolutely the opposite of unit testing. E2E tests that outcomes are meaningful for users, whereas unit testing tests that 2 + 2 = 4.'}
+
+      h4 {'Why these projects?'}
+
+      p {'When I am working in salaried work, or for clients, usually I have to fit in to established practices. Some of these practices are useful, but many of them I disagree with, because I like to re-think things from first principles and decide what I will adopt and what I will not (and why).'}
+
+      p {'On the other hand, when I am working on my own projects, I am free to do things in a less-established or more radical way, if I think that my way is better. However, turning paradigms on their head is hard work, since you have to recreate things from scratch rather than standing on the shoulders of giants.'}
+
+      p {
+        'I would aim for a sort of a happy medium where I use established tools such as '
+        tt {'Linux'}
+        ', '
+        tt {'Python'}
+        ', '
+        tt {'node.js'}
+        ', and the extensive infrastructure that comes along with them, to gain a measure of power and productivity, and then I use this power and productivity for rapidly prototyping new ways of doing things. But I would try not to add a lot of middleware layers like '
+        tt {'docker'}
+        ', '
+        tt {'mysql'}
+        ', '
+        tt {'nginx'}
+        ', and the like. I like building on the bare metal where I can.'
+      }
+
+      p {
+        'Eventually, I would like to build my own operating system, languages and applications to meet my day to day needs. Although this is too ambitious for the time being, it might become possible if I can develop more efficient ways of working. That’s essentially the rationale to the projects here—in particular:'
+        ul {
+          li {
+            'The JST project allows to build websites efficiently.'
           }
-        }
-        li.nav-item {
-          a.nav-link {
-            table.icon-and-text {
-              tr {
-                td {
-                  _out.push(icon_jst)
-                }
-                td {
-                  span.h1{'JST'}
-                  br {}
-                  span.h3{'the web development framework with JavaScript Templates'}
-                }
-              }
-            }
+          li {
+            'The '
+            span.serif {'π'}
+            'tree project allows to build languages efficiently.'
+          }
+          li {
+            'The LogJSON project allows to build databases efficiently.'
           }
         }
       }
+
+      p {
+        'There are also some associated Computer Aided Software Engineering (CASE) tools that I built as examples, such as the '
+        tt {'c_to_python'}
+        ' tool which (roughly) translates C code into Python using the '
+        span.serif {'π'}
+        'tree framework. Having custom-built CASE tools can really turbocharge a refactoring project and make the impossible possible. I also think that CASE tools will help my longer-term goals of developing larger and more ambitious projects efficiently.'
+      }
     },
     // scripts
     async _out => {}
diff --git a/projects/index.html.jst b/projects/index.html.jst
new file mode 100644 (file)
index 0000000..9e65ac3
--- /dev/null
@@ -0,0 +1,69 @@
+return async env => {
+  let breadcrumbs = await _require('/_lib/breadcrumbs.jst')
+  let icon_jst = await env.site.get_min_svg('/_svg/icon_jst.svg')
+  let navbar = await _require('/_lib/navbar.jst')
+  let icon_pitree = await env.site.get_min_svg('/_svg/icon_pitree.svg')
+  await navbar(
+    env,
+    // head
+    async _out => {},
+    // body
+    async _out => {
+      await breadcrumbs(env, _out)
+
+      p {
+        'The below projects are essentially frameworks that make it easier for you to build something. To make use of them, you will need to be familiar with either '
+        tt {'Python'}
+        ' or '
+        tt {'node.js'}
+        ' depending on each project’s language. The frameworks meet my needs for the present, and are intended to become more mature over time based on your feedback and/or contributions.'
+      }
+
+      p {
+        'Go on, take a look inside! '
+        i {'[Actually don\'t because it\'s still under construction]'}
+      }
+
+      ul.nav.flex-column {
+        li.nav-item {
+          a.nav-link {
+            table.icon-and-text {
+              tr {
+                td {
+                  _out.push(icon_pitree)
+                }
+                td {
+                  span.h1 {
+                    span.serif {'π'}
+                    'tree'
+                  }
+                  br {}
+                  span.h3 {'the source code analysis and transformation framework'}
+                }
+              }
+            }
+          }
+        }
+        li.nav-item {
+          a.nav-link {
+            table.icon-and-text {
+              tr {
+                td {
+                  _out.push(icon_jst)
+                }
+                td {
+                  span.h1{'JST'}
+                  br {}
+                  span.h3{'the web development framework with JavaScript Templates'}
+                }
+              }
+            }
+          }
+        }
+      }
+    },
+    // scripts
+    async _out => {}
+  )
+}