Notes On A Drupal Meetup And Estimates

Recently I went to the Austin Drupal Meetup. The topic was “What is this estimation thing? Why “no estimation” is not as crazy as it sounds“. The speaker was Michael Godeck.

Before the presentation, I did talk to someone about Drupal and Gutenberg. He said that right now Drupal uses the CKEditor. It recently got re-written from the ground up, and the new version has not been integrated with Drupal yet. He said that the Drupal community looked at Gutenberg, and saw that there was a lot of WordPress-specific code, so most people decided that Gutenberg was not the direction they wanted to go in.

However, some people kept going, and have ported Gutenberg to Drupal, or re-worked it to work with Drupal. He said that they will demo their results at the next DrupalEurope in September. I think he was referring to this presentation. So, Gutenberg in Drupal is not a sure thing. But if the demo in Europe shows promise, it might happen.

The main presentation was about estimations. He will be presenting at DrupalEurope.

One issue with estimation is that estimates are sometimes interpreted by managers as promises.

He talked about On the Theory of Scales of Measurement by S.S. Stevens which covers different types of measurement. One type is ordinal, which allows ranking, but no meaningful calculation. You can rank movies using a star-based system; usually people go up to four. We know that a four-star is better than a three-star, and a three-star is better than a two-star. But is the difference between a four-star and a three-star the same as the difference between a three-star and a two-star?

Another type is interval, which does allow you to know the differences between quantities. Think of things like time, temperature and distance.

He said one issue with some agile estimation strategies is that the numbers people give are really ordinal, but they are treated as interval. People think that all uses of numbers are the same, but that is not the case. The agile community still seems to be struggling to this day with the question as to whether or not a point is equal to some unit of time.

He also spoke of confidence intervals. It may be time to brush up on statistics.

He also mentioned Thomas Bayes and Claude Shannon.

Thoughts On WordPress

A week or so ago I went to the Austin WordPress Meetup which featured a presentation about Gutenberg.

Gutenberg is the upcoming editor for WordPress. I admit I did not quite understand everything that was said. But it means there are some big changes coming up. It will allow WordPress to interface with many different types of systems that it cannot talk to today. At one point, the presenter theorized that in a few years WordPress may not use themes as we understand them today. This could put some people out of work; I think there are several companies that sell WordPress themes.

Gutenberg will be written with React. I do not like JS and try to avoid it as much as I can (too much churn and reinvention of wheels), but this might help solidify React’s ranking. As WP people love to point out, WP powers 20-25% of all web sites. The presenter said that Drupal will be moving to Gutenberg as well (although I later found out this is not a sure thing).

I have toyed with the idea of porting WP to another language, even though it would be a massive undertaking. A lot of developers do not like PHP. When I was getting into Ruby and Rails, I joined the mailing lists for local Ruby/Rails groups in about a dozen cities. About once a month, someone in one of the cities would ask about any blog or CMS frameworks written in Ruby. They had made a Rails app for a client, and now the client wanted a blog or CMS. A few replies would mention Radiant or Refinery, but it seems like most of the time the original poster would just go with WordPress. Once someone just posted the Most Interesting Man In the World meme. I did have a go at porting WordPress to Rails.

Eric Normand posted a video titled What Clojure needs to grow – a boring web framework and boring data science.  He said Clojure needs a default web framework. At one point he talks about WordPress. It made me think again about porting WordPress to another language. I have not had problems with WordPress, but some sites have, including Naked Capitalism.

It would also be nice to port the WordPress database from MySQL to Postgres. There is pgloader (written in Common Lisp). There is also pg_chameleon, which is written in Python. But the issue is that some people might not like a new system if it does not look and work just like WordPress, kind of like people do not like other office suites. Plus things might change a lot with Gutenberg.

That said, I think if “ClojurePress” becomes a thing, there are a few things it should do out of the box. There are some things that are pretty common that are handled by plugins. Sometimes multiple plugins, sometimes plugins that have not been updated in a while. Maybe some of these are things that only I want, but here is my list:

  • HTML Tables
  • Static HTML Export
  • Contact Page
  • Twitter intregration (posting AND archiving)
  • Facebook (Granted, Facebook could block this; see here and here)
  • Deleting Revisions
  • Move Comments

 

Reasons I Do Not Like Sharepoint

Here are some reasons I do not like Sharepoint.

First off, I think the underlying concept is wrong. Putting office files in on the web is just stupid.
The web started out at HTML files; even dynamic sites make HTML files. Trying to make the web into a viewer for Office files adds a layer of friction. It is also vendor lock-in. The web was intended to be open. And again, MS is trying to close it.

Speaking of files adding friction to the web: I also do not like PDFs on the web, especially multi-column PDFs.

Why are people putting stuff in Word files anyway? (Spreadsheets are another story.) Why not just use some kind of wiki? Or Atlassian Confluence? Or Drupal? Or Intranet DASHBOARD? Or Jive? Or MindTouch? Or anything on this list? (I think this list is a bit more up to date, but unordered.) WYSIWYG editors are not that hard to learn. Why pay for MS Word when you are not using all of its features? And yes, I know SP has a wiki. I have never tried it, and I have no desire to. It is probably terrible. SP is about trying to make proprietary Office files relevant in an open web-centered world. Making a decent wiki with SP would expose the absurdity of SP’s existence. Making proprietary Office files relevant in an open web-centered world is Microsoft’s problem. Not mine, and not yours either.

If you really need to print, I am sure there are other systems that can convert content to PDFs. There are systems that have single sign-on capabilities.

If you use files, why are you using an online system? The impedance mismatch causes problems. People still download the files and email them to each other and get out sync. And even though there is versioning, people will manually add different versions of files. I have seen files in folders like this: file.doc, file_002.doc, file_DECEMBER.doc
I think this is because SP tries to do some many things.

Another reason is almost everyone hates it. At least, almost everyone I have asked about it at companies where I have worked that have used SP have hated it. Maybe everybody tells the big shots they love it and everybody is lying to me, but I really do not have any decision-making authority. Why would people lie to me?

There are many developers who take a course that uses Lisp or Scheme, or get a job using Lisp, and they will rave about it years or even decades later. They will say that Lisp/Scheme changed their perception unlike anything else. That they learned more by using Lisp than they learned using anything else. Nobody really holds MS technologies in the same esteem. A lot of non-technical people love MS products because they are generally unaware of any alternative. We should use technologies that we admire, not simply out of ignorance.

We are always told on the technology side that we have to “learn to understand the needs of the business.” Why don’t they have to learn anything about technology? Or what is good technology?

The only people who seem to like SP are managers and SP consultants. I asked someone at my current employer why we used SP, and he told me that we got a good deal from our cloud provider. Not that we need it. Or that it is good at its intended purpose (whatever that is).

I have found that many things that are justified based on cost and not quality are usually not very good. When I was at BofA, we had to use some computer-based training. Everybody hated it, except our finance guy. When he was asked to justify it at a meeting, he said it was “cost-effective.” If the users hate it and nobody learns anything from it, how is it effective?

Another reason is that it is from MS. It’s the same old bait and switch. They sell it as something easy, and you don’t need an admin. But when you hit a wall, or want to do something advanced, then MS says you need an admin.

Some people have this weird blindness about MS. If you present them with another spreadsheet or word processor, they will reject it because it is not exactly like MS Office. But if MS changes the interface (like from a toolbar to a ribbon), people just go along with it.

Another reason is that the search capabilities in SP are terrible. This is important for something used to store documents. I have always gotten better search results on blogs and wikis. Content on wikis can be versioned, so why put stuff into SP? I think most businesses could replace SP with a wiki. I think a lot of wikis can do single-sign on, permissions, whatever. Bookmarks would not change. A lot of people love to move SP folders.

SP is a complex product sold as a simple product. It is a desert topping and a floor wax. If SP does not fit your business, you have two choices: change your life to fit SP, or replace SP. Desktop PCs, laptops, cel phones induced people to change their behavior and workflow. SP is not amazing enough for people to want to change for it.

At my current employer, search is so bad that a committee was started to come up with solutions. I went to one meeting, and I realized it was a waste of time. Someone suggested a SP site with links to all the other SP sites. For some reason, dropping SP was not considered. I do not get the hold SP has on some people. Yes, migrating would be expensive. But using it is expensive. And painful.

complex product sold as a simple product
impedance mismatch
vendor lock-in
bad search

You’re welcome.

Venkat On Improving Code

The speaker at the Austin JUG last week was Venkat Subramaniam (https://twitter.com/venkat_s, http://www.agiledeveloper.com/). He is to Java what Sandi Metz is to Ruby: If he is speaking in your town, you don’t care what the specific topic is. You know you need to go because you will learn something.

The topic was Twelve Ways to Make Code Suck Less. I will post some notes I took at the presentation. He gave the list counting down from twelve to one.

Why should we care about code quality? You cannot be agile if your code sucks. Code we write is how we tell our colleagues how we feel about them. Quality code is code that can be understood quickly.

  • 12. Schedule time to lower technical debt. Technical debt can take the form of not upgrading a framework (or JDK) to a more current version. Bad code is not technical debt; it is sabotage. You should make a list of your technical debt and ask yourself if you are adding to it, or reducing it. Do not schedule 100% of your developers’ time for adding new features. You need some slack time; you need to spend some time learning.
  • 11. Favor high cohesion. Highly cohesive code does one thing and does it well. It reduces the frequency/reasons for change. High cohesion leads to low complexity. He mentioned Cyclomatic complexity. TL/DR: Be a dessert topping OR a floor wax.
    (I once again point you to the github page for Boot, with this little gem: “The Modern CLJS tutorials are an excellent introduction to Boot and ClojureScript. Pretty much everything you need to know about Boot to get a project off the ground is covered there. Check it out!” What if I want to learn about Boot but do not want to spend any time on ClojureScript? Why not have a tutorial that is just about Boot?)
  • 10. Favor loose coupling. Remove coupling if possible. Code with high coupling is hard to test, hard to extend. Having a lot of mocks in a test is a bad sign.
  • 9. Program with intention. He mentioned Kent Beck’s Design Rules:
    – Passes the tests
    – Reveals intention
    – No duplication
    – Fewest elements
    See also http://wiki.c2.com/?XpSimplicityRules They are in order, so passing the tests takes priority over intention. (So why does Dr Subramaniam go in reverse order?) We should program deliberately.
  • 8. Avoid primitive obsession. Do not write general code. Imperative code has accidental complexity.
    If you write a for-loop, you might wonder if you need less-than, or less-than-or-equal-to. That is a sign. We do imperative because it is familiar. He gave an example of a method with a for-loop. He noted you would need extra variables to hold the result and the count. He contrasted it with an example of functional code using Java lambdas. Functional code is about a series of transformations, not mutations. You can read the functional example in one pass, while with the imperative you need to go up and down while reading it.
    Imperative code is easy to write, but harder to read, while functional is easier to read. Good code is a story, not a puzzle. Lambdas are glue code, and sometimes two lines might be too many.
    Lambdas still take some work to understand. You need to learn the semantics. The functional style is a combination of declarative code and higher-order functions.
  • 7. Prefer clear code to clever code. Clever code makes you feel smart. Do not focus on performance too early.
  • 6. Apply William Zinsser‘s principles on writing: Simplicity, clarity, brevity, humanity.
    He recommended “On Writing Well” by William Zinsser. He said when his son asked to borrow his copy, he refused. Instead he bought his some another copy, and his son has re-read it at least three times.
  • 5. Comment the why, not the what. A lot of developers make a lot of comments because a lot of companies and professors mandate comments. Do not comment to cover up bad code. Write expressive code that is self-documenting. Many times a comment is like explaining a joke. He recommended the book The Design of Everyday Things.
  • 4. Avoid long methods – Apply SLAP (Single Level of Abstraction Principle) Long methods are hard to understand, lack cohesion, tend to become longer, and are harder to test. How to break up methods? Think about what layer of abstraction you are at.
    He said it could be a bad idea to have a hard and fast rule about how many lines a method should be. I know Sandi Metz has a rule that methods should not be any longer than five lines. But is putting a rigid number such a good idea? I am probably not as smart as Sandi Metz, and frankly, you probably are not either. If you dogmatically insist on a hard number, you will probably just get a lot of methods that call methods that call methods, etc. Maybe we should stop using the word “Rule” when “Guideline” would be more appropriate.
    One example he gave is that if someone asks you what you did over the weekend, you might say, “I went to such-and-such city on Saturday, and stayed home and did laundry on Sunday”. If they ask for more details, you could give them. Or you would talk about how you woke up, had breakfast, got in the car, got gas, with route you took, etc, etc, etc. They might not want that level of detail off the bat.
    You might have a method that gets info from a database table, gets info from a web service, combines/transforms them somehow, and writes the result to another table. And has all the try/catch blocks for all the exceptions. That would be a good candidate for breaking it up.
    He related a story about someone who attended one of his lectures who was hired by a company to refactor a method that was 40,000 lines long. After a year, this person got it down to 30,000 lines.
    I stopped to talk to someone after the presentation, and then walked to my car. I think I overheard at least three conversations about this particular point.
  • 3. Give good, meaningful names. Your variable names represent your level of abstraction.
    He gave an example of bad variable names from a company that he could not name. It was software used to control oil refineries. One license is $1 million. He would not name the company, but if one license is $1 million, that narrows it down.
  • 2. Do tactical code reviews. Do code reviews often, and make them incremental. If you put them off, people will just allow code to pass without understanding it or really looking at it.
  • 1. Reduce state and state mutation. Do not make a field in a class (or method) unless you really need it. He related a story about an exhibit of Picasso with twenty versions of a painting, instead of just showing the final result. If Picasso could iterate, so can we. (I have a note asking how do functional languages deal with databases.)

Here are some pages on his site that I found to be informative:

You’re welcome.

2018-06-24 Update

There was not a lot of Clojure this week. There will be more in next week’s update.

I am taking a couple of weeks off from work. I have to take a lot of time off. I have accrued so much that if I do not take a lot in the next few months I will lose some.

I will study some Clojure, perhaps make progress on Simply Scheme. I also plan on writing something on why Lisp interests me, and perhaps why I hate Sharepoint. I will also visit some family in another state that we are not from.

You’re welcome.

2018-06-17 Update

I am still going through the tutorials on Purely Functional. There is nothing new to me in the intro videos, but I am getting practice with the REPL and emacs.

The project that I am on is downsizing. I might leave my employer and try my luck in the big, bad world. At one point I told my manager that I was interested in Lisp and Clojure. I probably mentioned that Lisp is one of the oldest languages and also not widely used. At a recent meeting, he said that I was interested in “legacy” technology. I plan on writing a post about why I am interested in Lisp and Clojure. While Lisp is one of the first programming languages invented, I don’t think it is appropriate to call it “legacy”. Lisp can adapt to any paradigm. “Legacy” has a negative connotation.

Part of the appeal of Lisp is that it seems like languages in the C family are becoming more like Lisp and Smalltalk over time. I have written this on this blog a few times. I mentioned it to some people once in Chicago, and they thought it was an interesting insight.

You’re welcome.

A Look at cond Function

Here is a look at the “cond” function in Clojure. It’s like “if”, but with more conditions.

 

You’re welcome.

2018-06-03 Update

I am working through the tutorials on Purely Functional.

I got a bit hung up right away. I was trying to figure out how to reload files while working in the REPL as I updated the files. I followed this suggestion on StackOverflow by some guy named Dirk. At first, Dirk’s quirk did not work. Was Dirk a jerk? His burst was not voted first. SO at its worst? It made me so weak I could not speak. My REPL I could not tweak, putting an end to my learning streak. I do not want to sound pissed, but I do not wish to be dissed by Lisp. I am too tired for this.

Then I realized that while the files were reloaded, the new functions were not included in any aliases I used when I brought in the namespace with “require”. I could use the new functions, but I had to type out the ENTIRE namespace. O, the huge manatee! I did some googling, and I don’t think anyone mentions that.

You’re welcome.


2018-06-12_23.46.42 Update:

Just so it is easy to copy and paste, here are the commands:

Or you could do this:

You might have a function called “refresh”, but you will probably not have a namespace “repl”.

Do this after you follow the directions in the StackOverflow answer. It is better to bring in the clojure.tools namespace in your profile than in every stinkin’ project.

 

2017 Tweets

I have not gotten around to setting my twitter-retriever with a cron job yet. In the meantime, I will just copy and paste tweets. The plug-in that I was using stopped working in 2016. Here are all of my tweets from 2017:

You’re welcome.

Remaining 2016 Tweets

I have not gotten around to setting my twitter-retriever with a cron job yet. In the meantime, I will just copy and paste tweets. The plug-in that I was using stopped working in 2016. Here are the remaining 2016 tweets:

You’re welcome.