top | item 19252952

Running a Bakery on Emacs and PostgreSQL

465 points| flocial | 7 years ago |bofh.org.uk

191 comments

order
[+] altotrees|7 years ago|reply
Stories like these are the ones that inspire me the most. People using technology in a way that helps them in their everyday lives, or in a hobbyist fashion. I feel like many of the things I pick-up at work are out of career necessity: the latest framework, bits of an up and coming language that is going to be "the future", semi fluency in a stack so I can aid in a project,I enjoy it, but I don't enjoy it like in the same way I once did.

Probably my favorite programming memory was teaching myself Java as a teenager and building games for my friends and I to play. No responsibility, if they worked...great, if not oh well. It was exhilarating. I do not think programming will ever become a lingua franca, as stated in other places here. I think hobbyist programmers may pop up more and more,or people who know enough to build small tools for themselves (not to scale) and I don't think that's a bad thing.

[+] abakker|7 years ago|reply
As one of those hobbyists, I can say that the thing I wish most for was an easier way of "getting started". I mostly hack around in python, or arduino c, but I really wish that it was easier to write a script and actually give it to someone else, and actually have it run.

The feature I like most about excel, is that it is practically ubiquitous. If I give someone else an excel toy workbook that does something, they can run it without needing to "manage the environment". If I write something in Python/numpy/pandas/Jupyter, it is actually pretty difficult to make it useful to anyone. Portability just makes the whole hobby programming thing much more fun.

[+] jedberg|7 years ago|reply
This reminds me of the time I used Python to fill out my Wife's 4th grade report cards. She kept all the records in google sheets, so when it came time to do report cars, she already knew what all the grades should be. But the school only provided a terrible app where you literally had to make three clicks with a mouse to enter each grade. Each kid had about 20 grades to enter, and there were 30 kids. That was a lot of clicking and a lot of RSI.

The app had no import/export, but it turned out you could save your work in progress to a proprietary file format. I figured out the format, and then figured out how to basically take the data in google sheets and munge it into the save file format.

It took about 3 hours to enter all the grades manually, and it took about 3 hours to develop the app. So for the first time we used it, it was a wash, but then we got to use it twice more.

Sadly, then they changed report card programs and the new one used a binary file format. At least the new program allowed keyboard input with shortcuts, so it wasn't as a bad.

[+] fifteenforty|7 years ago|reply
My clinical training log (requirement for specalist board registration) is similarly frustrating, so I wrote some JavaScript hooks and then used Keyboard Maestro to mostly automate data entry. 9 clicks became Ctrl-9, for example.
[+] paulryanrogers|7 years ago|reply
RSI seems to have gotten worse as the newer school systems are trying to be touch compatible. They also update often enough to break any useful shortcuts or get swapped for another entirely different system.
[+] ubermonkey|7 years ago|reply
I haven't read the article (yes, I know, sorry), but the headline reminded me of a donut shop here in Houston.

I don't know if the sign is intentionally this way, or if the middle letter of the first word in the name fell off, leaving behind the short, horizontal mount point, but either way it amuses emacs folks a lot, because it appears to say:

M-x Donuts

Who among us hasn't wanted, at least once, to invoke that mode?

[+] sevensor|7 years ago|reply
When I was a child, we would always drive past a particular convenience store on our way to my grandmother's house. At some point in history, it must have been called "Self Service Mart," but the first S had long since fallen off. I loved imagining what the staff were like. It's probably for the best that we never went inside.
[+] mhd|7 years ago|reply
This makes me wonder what someone with less computer experience would do, ie if you're not a former computer professional.

Sure, open source makes everything rather accessible from a monetary point of view, but you still have to learn things. I almost feel like in the past there were more attempts at making this accessible to the end user, HyperCard, dbase etc, even just BASIC on your 8-bit machine.

Nowadays? Excel/Google Sheets for the most simple case, probably, but if you have to transfer data from/into there or present it differently? Web sites and GUIs aren't that easy, but it's what the users know.

If your point of interaction with a computer is more bare-bones (eg a BASIC/DOS prompt), solutions feel closer, easier to grasp.

[+] crispyambulance|7 years ago|reply

    > This makes me wonder what someone with less computer experience would do, ie if you're not a former computer professional.

One would simply make bread the same way as it has been done for 1000 years!

Humans can understand ratios, write stuff down, plan for the future, etc all without org-mode in emacs, databases, and sometimes without even a calculator.

[+] mruts|7 years ago|reply
I know a lot of financial analysts who don’t know how to “program” but develop incredibly complicated Turing complete excel models regularly. Excel is a very flexible tool and can be leveraged to great effect.
[+] 0x445442|7 years ago|reply
Can't remember where I read the story, Steve Yegge perhaps. But they were talking about how where they worked secretaries actually used Emacs apps developed by the IT department and, over time, the secretaries started to extend the apps with Elisp.
[+] kome|7 years ago|reply
> I almost feel like in the past there were more attempts at making this accessible to the end user, HyperCard, dbase etc, even just BASIC on your 8-bit machine.

Oh for sure, look at web: we transformed something simple and beautiful like html+css in a complete shit show.

Also, I don't feel like the new programming languages are easier then COBOL or BASIC, quite the contrary. We are making technology more complicated for no reason.

Or at least, at the time we had the very complicated stuff and stuff that simplified complexity. Think about S and SPSS.

Now we have complicated and very complicated. We are giving less creative possibilities to the end user: making them consumers, first of all.

Other example VB6.

[+] projectramo|7 years ago|reply
Google Sheets with Google Forms (or whatever it may be called) for some users. Or, without internet, Excel.

The spreadsheet is sort of one of those insane breakthroughs where it really makes programming (functional at that) really easy to grasp. And you can iteratively and intuitively add hundreds of variables and logic gates.

[+] tyingq|7 years ago|reply
There's a fair amount of low code type web application makers. Google's AppMaker, Quickbase, Zoho Creator, Knack, Airtable, etc.

No real comparable open source equivalent for these types of things yet.

[+] singingfish|7 years ago|reply
There's a decent size (albeit a little bit - but only a little bit - specialist) wholesaler in sydney. The boss is a tech enthusiastic, and the whole thing is somewhat glued together with various bits of perl and other stuff.
[+] paddy_m|7 years ago|reply
I'm trying to help my girlfriend manage the inventory for her cactus business. She raises cacti from seed, cuttings, but mostly from wholesale suppliers. She has a square account and store. I’m trying to set up inventory tracking for her. There are couple of things that make her business different than most inventory holding businesses.

1. Generally her inventory increases in value over time because it grows. Over time a plant will grow from a smaller pot to a larger pot, plants in large pots sell for more. 2. She wants to track which suppliers provide better quality plants (do the plants die quickly?). She also wants to track how fast different plants grow.

I could pretty easily write a django app that tracks this stuff.

Any recommendations for a platform I could build on top of (airtable? google forms+sheets?). Maybe some type of marketing automation platform.

Custom business apps are tricky. As a programmer it's easy to turn my nose up at excel based solutions, but I totally see how they end up being built.

[+] jwr|7 years ago|reply
> Custom business apps are tricky. As a programmer it's easy to turn my nose up at excel based solutions, but I totally see how they end up being built.

Both of these are true. And most people do not appreciate how tricky niche apps are. When I started writing PartsBox (for myself initially, later grew it into a business at https://partsbox.io/) several years ago, I thought I'd be done in a weekend. Nearly 4 years and almost 3000 commits later…

Spreadsheets are a pain for anything but the simplest things. And yet they are useful to a point, because making a domain-specific application is surprisingly hard: there are lots of edge cases that you don't think about initially.

[+] dvdhsu|7 years ago|reply
Hi! I'm David, the founder of Retool (https://tryretool.com). We describes ourselves as "a fast way of building custom internal tools". (That's what's on our landing page, in fact!)

We're inspired heavily by Excel and visual programming. The idea is that business apps — even custom ones — all have the same building blocks for their front-ends: tables, buttons, dropdowns, textinputs, etc. And so we give you all of these building blocks, as components that you can use.

And most custom business apps interface with SQL databases or APIs, so we have native integrations with those. If you want to render a list of users in your app, for example, you could write the SQL query (`select * from users`), and save it as `users_query`. Then, you can drag on a `Table`, and have its `data` property set to `{{users_query.data}}`. Then you're done!

This probably all sounds a bit abstract... so here's a 3 minute demo video, if you're curious: https://vimeo.com/303811211

Let me know if you'd be interested in trying it? I'm at [email protected] if you have any questions / feedback! :)

[+] taylorwc|7 years ago|reply
Have you looked at Retool[0] at all? I don't know if you have a budget > $0, but they are awesome for this sort of thing.

[0] https://tryretool.com

[+] zbentley|7 years ago|reply
Django is a decent start. I suggest keeping it as simple as possible, and providing easy export of data to CSV’s or spreadsheets, so she can do reporting and analysis in a more free-form fashion (and you don’t have to build a reporting system).
[+] wbl|7 years ago|reply
Don't knock Microsoft Access for this sort of thing.
[+] cascom|7 years ago|reply
Talk about organic growth
[+] gglitch|7 years ago|reply
One or more Jupyter notebooks?
[+] istjohn|7 years ago|reply
I have only ever been a tech hobbyist, but I have leveraged my Python skills in a similar way. I run a home cleaning service with my wife, and I started using Airtable to track clients, jobs, expenditures, employee hours, etc. The data entry became tedious due to having to make entries in multiple tables for each job, so I wrote a Python script to use a simple command line read-eval-print loop to collect job information and make entries in the appropriate Airtable tables through the Airtable API.

I also use Python to produce paycheck stubs, do simple business data analysis, and email me leads from our website.

A small tangent: I have recently become frustrated with the limitations of a command line interface (primarily the inability to display charts and graphs), but there is a dearth of solid alternatives. Both web frameworks and GUI frameworks add far too much complexity for a solo amateur developer to quickly iterate to meet a small business' needs.

I would love to have a product that let me produce ugly but practical GUIs in Python without having to learn a big framework like PyQT or Django. EasyGUI comes close, but isn't quite good enough.

For now, I update an HTML file to display graphical output in Python and use a Firefox extension to auto-refresh the page on changes.

[+] ses1984|7 years ago|reply
If you're familiar with python, try jupyter notebooks.
[+] roel_v|7 years ago|reply
I have the exact same problem, I've tried many things over the last 10 years and the solution you're using is (imo) by far the easiest, most flexible and robust. It feels hacky but it just works. If you want some interactivity (different graphs in tabs for example) you can just add some jquery or bootstrap - basically a serverless SPA (real serverless, not the 'cloud hosted' thing they call 'serverless' nowadays). I have 'apps' for recipe management, investing, and food forest design that work this way (the food forest one even incorporates Sketchup 3d models and generates a clickmap that lets you click on 2d renders of 3d models to let you interactively select areas using the canvas api - so yes you can make it as complicated as you want, but the easy things remain easy).
[+] Swalden123|7 years ago|reply
I had a similar use case as you for making apps to run on a Rasberry Pi for my staff to use in my business (Chocolab.com.au) I discovered appjar.info which has been so simple to use for quick ugly interfaces. It is built on top of tkinter
[+] mst|7 years ago|reply
Seconding tkinter - tkdocs.com will show python examples if you click the right button.
[+] rekshaw|7 years ago|reply
As people flock to become programmers, as a population we will become increasingly technologically literate. Sooner or later we will enter an age where programming is as second nature as writing. Communication at the end of the day is a way to get people to understand what we want. Programming is very similar only directed at machines, and as machines continue to replace people in trivial (and not so trivial) tasks, that will be the lingua franca. And yes, it will be javascript.
[+] seanwilson|7 years ago|reply
> The key insight is that a bakery formula is so cliched that it can be represented as data. Here’s the formula for seedy malt loaves:

> Of course, that’s not the full set of formulae, because it doesn’t tell you how to make ‘Seedy malt dough’, but that’s just another formula, which consists of flour, water, starter, salt and a multiseed ‘soaker’, where the starter and the soaker are the results of other formulae, which are (finally) made from basic ingredients1. I did consider reaching for the object oriented hammer at this point, but thought that I might be able to do everything I needed without leaving SQL.

There's no way you can do something similar with spreadsheets? The example wasn't in enough detail for me to understand why not. The jump from spreadsheet to SQL seems massive in terms of ease of use.

[+] estsauver|7 years ago|reply
This is pretty cool to see. I frequently about how much most businesses could do if they just has a database to back there core business operations.
[+] omouse|7 years ago|reply
This is basically why I end up going back to Emacs. It's waaaaay too easy to start writing functions and the built-in help system (with docstrings almost everywhere for every function and variable) is invaluable.

Though I'm beginning to wonder if JavaScript-based extensions in VS Code can match the power of Emacs code. Are there plugins that connect to Postgres? or do what Org-mode does?

[+] w8rbt|7 years ago|reply
Great uplifting article. It's awesome to see a geek get ahead in business by using his/her favorite open-source tech tools.
[+] olalonde|7 years ago|reply
That's the most HN title I've seen in a while.
[+] unwind|7 years ago|reply
Frustratingly thin on details about the actual bakery (perhaps not surprising since it's a blog series). All I could figure out is this Facebook page: https://www.facebook.com/theloafery/.

It seems he mainly sells at a market.

[+] drieddust|7 years ago|reply
I keep coming back to Emacs reading these stories but it never became a habit primarily I have to work across many desktops/laptops computers with Windows & Linux as well as Android mobile.

Emacs not being usable on mobile is a big problem and biggest roadblock in the path.

[+] TeMPOraL|7 years ago|reply
I used to run separate Emacs instances on both Windows and Linux, but these days I settled for a different workflow. I keep my main Emacs running on my home Linux desktop. From other computers and locations, I just SSH to the desktop and run an Emacs frame in terminal mode (the command is just: emacsclient -t). Turns out, this is usable for about 95% of things I use Emacs for (the remaining 5% are when I need to view a picture or a PDF, which obviously won't show in terminal). Hell, if you configure your terminal/SSH client to run in 256-color mode, the resulting terminal Emacs will be nearly indistinguishable from the GUI one!

That's one of many hidden strengths of Emacs-based workflow - it works the same whether you're running in GUI mode, or connecting remotely with text terminal. That also means I can work on heavy projects from my underpowered 2-in-1 netbook :).

[+] ams6110|7 years ago|reply
I can't imagine editing any document longer than a sentence or two on mobile, regardless of the editor.
[+] zeveb|7 years ago|reply
Emacs runs on Windows as well as Linux (& on macOS, too). It works fine on the terminal in Android, but you'll want a keyboard, too.

In principle you could add special Android bindings for emacs which would make using it without a keyboard somewhat useful.

[+] ohnoabigshark|7 years ago|reply
Former CS major, current chef/owner checking in. Restaurants feel pretty ripe for voice assistants/AR but unfortunately lack the necessary technological and financial capital to make it happen, imo. Being able to record and retrieve important information without stopping your work (pulling up and scaling a recipe while chopping onions, for example) saves an immense amount of time in the kitchen. This is especially true during a busy service when circumstances and priorities can change quickly and without warning. The need is there, my question lies in whether an industry with tight profit margins can afford to pay for such a product.
[+] dsr_|7 years ago|reply
It's a pity that I read the title first, because when I read the recursive descriptions I immediately thought about a Makefile that emitted directions, cumulative timing, and optional ingredient debit entries for an ordering system.

But SQL is OK.

[+] gglitch|7 years ago|reply
Is there a name for small(ish), self-contained programming environments that offer optional but well-coupled guis/tuis? I realize this is a gray area, because someone will point out that Tk and SQLite can be slapped on basically anything; but I'm thinking of systems more like Hypercard, Tiddlywiki, Jupyter, Org-mode, even Racket or Picolisp.

Edit: I should clarify that when I say "small(ish)," I'm referring to the number of discretely moving pieces and dependencies, not to, e.g., the size of a binary, or how many batteries are included, etc.

[+] burger_moon|7 years ago|reply
I'm going to be the unfortunate hater, but it sounds like he should spend more time on actually learning how to be a baker and less time writing code in this particular case.

This is what I'd imagine most of the people on here would fall into the trap of when the monthly 'I want to quit and work with my hands' post comes up. It's the cliche, I want to disrupt the industry before I even learn it.

My girlfriend works at a bakery and I showed her this post and asked her what she thought about it. None of the bakers need to write down anything or make spreadsheets on how to make a loaf of bread or any of the other products they make every day. This is like having to google 'how to write a for loop' even though you're a programmer.

Bakeries make the same things every day, there's very little change even though as a customer(me) it might look crazy. Knowing recipes and quantities and how to adjust them are the most basic requirements of the job.

Huge props to this guy for doing it though! I hate making negative posts shitting on someones venture. If this is what makes it more fun for him, then keep doing it, and get better.

[+] vanous|7 years ago|reply
This. Being able to run easily selectable scripts on pieces of selected text in my editor is what keeps me in vim. Doing repeatable tasks, filling XML data, gosh, I even keep my odometer book in vim via small hacked together python script.

People keep recommending things like Visual Studio Code, but I am yet to find a way to do it there... Is it even possible?

[+] yingw787|7 years ago|reply
I wonder if there's room for a software deployment model for SMBs. Create a GUI on top of Ansible so customers can configure their build, build/deploy a software tarball to a VM, and provide data and code migration tools to your local community colo - all open source. Company offers upgrades, security patches, operations/customer support, and occasionally new features - no mandatory subscription fees, no forced cloud-native stack, and no VCs demanding 20x returns. Something friendlier to programs than Microsoft Excel and XP, and friendlier to SMBs and end users than Slack and G-Suite. Almost like a neighborhood Red Hat, with shims for toy shops, bakeries, and bookstores.

I think a bootstrapper could pull it off, or a small team of two/three funded by a friendly angel.