How to write unmaintainable code

In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes. Further, if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn’t be able to maintain the code!

To foil the maintenance programmer, you have to understand how he thinks. He has your giant program. He has no time to read it all, much less understand it. He wants to rapidly find the place to make his change, make it and get out and have no unexpected side effects from the change.

He views your code through a toilet paper tube. He can only see a tiny piece of your program at a time. You want to make sure he can never get at the big picture from doing that. You want to make it as hard as possible for him to find the code he is looking for. But even more important, you want to make it as awkward as possible for him to safely ignore anything.

Programmers are lulled into complacency by conventions. But every once in a while, by subtly violating convention, you force him to read every line of your code with a magnifying glass.

You might get the idea that every language feature makes code unmaintainable — not so, only if properly misused.

Roedy Green, Canadian Mind Products
@ github

AOL Late 90’s

January 1999
AOL 1999.PNG
via the wayback machine
https://web.archive.org/web/19990125084628/http://aol.com/

The late ’90s, according to Schober, was when chat rooms hit their peak. Just how powerful was America Online during this time? Reggie Fairchild, product manager for AOL 4.0, shared this little story on Quora:
“When we launched AOL 4.0 in 1998, AOL used ALL of the world-wide CD production for several weeks. Think of that. Not a single music CD or Microsoft CD was produced during those weeks.”
It worked. People signed up in droves.

via CNN

Lessons for creating good open source software, Eric Raymond

  1. Every good work of software starts by scratching a developer’s personal itch.
  2. Good programmers know what to write. Great ones know what to rewrite (and reuse).
  3. Plan to throw one [version] away; you will, anyhow. (Copied from Frederick Brooks’ The Mythical Man-Month)
  4. If you have the right attitude, interesting problems will find you.
  5. When you lose interest in a program, your last duty to it is to hand it off to a competent successor.
  6. Treating your users as co-developers is your least-hassle route to rapid code improvement and effective debugging.
  7. Release early. Release often. And listen to your customers.
  8. Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix obvious to someone.
  9. Smart data structures and dumb code works a lot better than the other way around.
  10. If you treat your beta-testers as if they’re your most valuable resource, they will respond by becoming your most valuable resource.
  11. The next best thing to having good ideas is recognizing good ideas from your users. Sometimes the latter is better.
  12. Often, the most striking and innovative solutions come from realizing that your concept of the problem was wrong.
  13. Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away. (Attributed to Antoine de Saint-Exupéry)
  14. Any tool should be useful in the expected way, but a truly great tool lends itself to uses you never expected.
  15. When writing gateway software of any kind, take pains to disturb the data stream as little as possible—and never throw away information unless the recipient forces you to!
  16. When your language is nowhere near Turing-complete, syntactic sugar can be your friend.
  17. A security system is only as secure as its secret. Beware of pseudo-secrets.
  18. To solve an interesting problem, start by finding a problem that is interesting to you.
  19. Provided the development coordinator has a communications medium at least as good as the Internet, and knows how to lead without coercion, many heads are inevitably better than one.
  20. When the next generation inevitably stumbles for the second time around on the first contention, doff cap and take heed;

* Eric Raymond, via wikipedia

Toyota’s Six Rules for the application of kanban

Toyota has formulated six rules for the application of kanban

  1. Each process issues requests (kanban) to its suppliers as it consumes its supplies.
  2. Each process produces according to the quantity and sequence of incoming requests.
  3. No items are made or transported without a request.
  4. The request associated with an item is always attached to it.
  5. Processes must not send out defective items, to ensure that finished products will be defect-free.
  6. Limiting the number of pending requests makes the process more sensitive and reveals inefficiencies.

via wikipedia
https://en.wikipedia.org/wiki/Kanban

Health care workers and computers, Atul Gawande on.

Why Doctors Hate Their Computers

More than ninety per cent of American hospitals have been computerized during the past decade, and more than half of Americans have their health information in the Epic system. Seventy thousand employees of Partners HealthCare—spread across twelve hospitals and hundreds of clinics in New England—were going to have to adopt the new software. I was in the first wave of implementation, along with eighteen thousand other doctors, nurses, pharmacists, lab techs, administrators, and the like.

https://www.newyorker.com/magazine/2018/11/12/why-doctors-hate-their-computersc

Clojure Hello World

user=> (println “Hello World!”)
Hello World!
nil
user=> exit
Bye for now!

check out ->

Leiningen is the easiest way to use Clojure. With a focus on project automation and declarative configuration, it gets out of your way and lets you focus on your code.

https://leiningen.org/

Build Your Functional Skills One Idea at a Time, by Russ Olsen
https://pragprog.com/book/roclojure/getting-clojure

 

Amazon help chatbot Turing test

Me:
Ordered a book and gloves and it says they were delivered and they weren’t.
You are now connected to Cyrene from Amazon.com
Cyrene:
Hello, my name is Cyrene. I’m here to help you today.
Me:
Hi.
Cyrene:
Oh! I’m sorry that you did not receive the item that was scanned as delivered.
Me:
The order in question says delivered on Friday.
Ok. Continue reading “Amazon help chatbot Turing test”

Good introduction to Docker

“Docker is a tool for running applications in an isolated environment.”

Jake Wright
Learn Docker in 12 Minutes
Docker is all the rage right now. In 12 minutes I’ll give you comprehensive introduction to docker, covering:

1. What is Docker
2. Virtual Machines vs. Docker
3. Introduction to Dockerfiles, images and containers
4. The Docker Hub
5. Writing a Dockerfile
6. Building an image
7. Running a container
8. Mounting volumes
9. One process per container

Google Translate Compared With Human Translator – Madame Bovary example

Three versions of Madame Bovary:

Original French via Project Gutenberg
Elle dessinait quelquefois; et c’était pour Charles un grand amusement que de rester là, tout debout à la regarder penchée sur son carton, clignant des yeux afin de mieux voir son ouvrage, ou arrondissant, sur son pouce, des boulettes de mie de pain. Quant au piano, plus les doigts y couraient vite, plus il s’émerveillait. Elle frappait sur les touches avec aplomb, et parcourait du haut en bas tout le clavier sans s’interrompre. Ainsi secoué par elle, le vieil instrument, dont les cordes frisaient, s’entendait jusqu’au bout du village si la fenêtre était ouverte, et souvent le clerc de l’huissier qui passait sur la grande route, nu-tête et en chaussons, s’arrêtait à l’écouter, sa feuille de papier à la main.

French to English via Google Translate
She drew sometimes; and it was for Charles a big fun only to stand there, while standing at the bend over his cardboard, blinking to see his work better, or rounding, on his thumb, balls of bread crumbs. As at the piano, the faster the fingers ran, the more marveled. She struck the keys with aplomb, and walked up and down the entire keyboard without interrupting. So shaken by her, the old instrument, whose strings curling, was heard to the end of the village if the window was open, and often the clerk of the bailiff who was passing on the high road, bareheaded and in slippers, stopped to listen to him, his sheet of paper in his hand.

Human Translator – Margaret Mauldon, via Amazon
She used to draw sometimes; and Charles found it most entertaining to stand there at her side, watching her concentrate on her sketch, screwing up her eyes to see her work more clearly, or rolling breadcrumbs into little erasers with her thumb. As for the piano, the faster her fingers flew about, the more was he amazed. She struck each note with a confident touch, sweeping across the whole keyboard from top to bottom without a pause. The old piano with its badly stretched strings shook under her hands and could be heard, if the window was open, right across the village; often the bailiff’s clerk, shuffling along the road with his head bare and his feet in slippers, would stop to listen, holding the document he was delivering in his hand.

Labor Day podcast episode on where the labor movement is now

http://radioopensource .org/a-new-labor-movement/

It’s Labor Day week 2018, and “The American Worker” doesn’t fit any single poster shot. Is it the Uber driver – working flex time in the ‘gig’ economy, for a magic dispatcher of taxis around the world? Is it the brainiac Google engineers insisting to their CEO that “we need to know what we’re building?” In a gilded, globalized, unequal economy of work today, the old industrial unions are almost gone. But suddenly non-union professionals feeling dealt out of pay and power are shouting, we’re workers, too, and forming unions: graduate students at great universities, magazine writers at the ritzy New Yorker. Prisoners, too, and sex workers, coming out of the shadows to claim rights, and respect, as workers, with skills, thank you. Plus hospital nurses and public school teachers coast to coast.

The midterm measure of the American mood in Trump-time may well turn out to be not – or not just – the off-year House and Senate election scorecard, but the work-place turbulence all over the map this year. Workers who never organized before – in grad schools, in media, in sex work, in prisons – are talking solidarity. And notice the word “strike” is back in circulation, inspired maybe by the furious telemarketers in the seriously funny fantasy film, Sorry to Bother You. In the movie they shout “Phones down!” In real Boston, this week, housekeepers in three Marriott-owned hotels downtown could soon be shouting “Mops down!” in their fight for a new contract.

We’re in the work-place, not the political arena, this hour, though of course they’re connected as soon as workers say it’s all about the power of the corporate class, a fight about places at the table and restoring an idea of people-power democracy.

 

What is => ? What is it called and what does it do? C#.

The ‘lambda operator’. It’s read as ‘goes to’. As in, x => 2 * x is read as “x goes to 2 times x .”

A lambda expression is an anonymous function that you can use to create delegates or expression tree types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls. Lambda expressions are particularly helpful for writing LINQ query expressions.

To create a lambda expression, you specify input parameters (if any) on the left side of the lambda operator =>, and you put the expression or statement block on the other side. For example, the lambda expression x => x * x specifies a parameter that’s named x and returns the value of x squared.

via ms docs

Searle’s Chinese Room

Chinese room thought experiment

“Searle’s thought experiment begins with this hypothetical premise: suppose that artificial intelligence research has succeeded in constructing a computer that behaves as if it understands Chinese. It takes Chinese characters as input and, by following the instructions of a computer program, produces other Chinese characters, which it presents as output. Suppose, says Searle, that this computer performs its task so convincingly that it comfortably passes the Turing test: it convinces a human Chinese speaker that the program is itself a live Chinese speaker. To all of the questions that the person asks, it makes appropriate responses, such that any Chinese speaker would be convinced that they are talking to another Chinese-speaking human being.

The question Searle wants to answer is this: does the machine literally “understand” Chinese? Or is it merely simulating the ability to understand Chinese? Searle calls the first position “strong AI” and the latter “weak AI”.

Searle then supposes that he is in a closed room and has a book with an English version of the computer program, along with sufficient paper, pencils, erasers, and filing cabinets. Searle could receive Chinese characters through a slot in the door, process them according to the program’s instructions, and produce Chinese characters as output. If the computer had passed the Turing test this way, it follows, says Searle, that he would do so as well, simply by running the program manually.

Searle asserts that there is no essential difference between the roles of the computer and himself in the experiment. Each simply follows a program, step-by-step, producing a behavior which is then interpreted as demonstrating intelligent conversation. However, Searle would not be able to understand the conversation. (“I don’t speak a word of Chinese,” he points out.) Therefore, he argues, it follows that the computer would not be able to understand the conversation either.

Searle argues that, without “understanding” (or “intentionality“), we cannot describe what the machine is doing as “thinking” and, since it does not think, it does not have a “mind” in anything like the normal sense of the word. Therefore, he concludes that “strong AI” is false.

wikipedia