5 ms·
I'm not a web developer but my girlfriend needed a website to show her photography work so I decided to make it for her. It's the simplest thing in the world,
by simias 6y ago
I'm not a web developer but my girlfriend needed a website to show her photography work so I decided to make it for her.
It's the simplest thing in the world, basically just three columns with photo thumbnails and the only javascript is some simple image viewer to display the images full screen when you click the thumbnails.
It's really, really basic but I was impressed with the feedback I received from it, many people were impressed by how slick and fast it was. And indeed, I went looking for professional photographer websites and indeed, what a huge mess most of them are. Incredibly heavy framework for very basic functionality, splash screens to hide the loading times etc... It's the electron-app syndrome, it's simpler to do that way so who cares if it's like 5 orders of magnitude less efficient than it should be? Just download more RAM and bandwidth.
Mine is a bunch of m4 macros used to preprocess static HTML files, and a shell script that generates the thumbnails with image magic. I wonder if I could launch the new fad in the webdev community. What, you still use React? That's so 2019. Try m4 instead, it's web-scale!
- throwawaysbsh 6y agoLink?
- throwanem 6y agoSome of us still remember the hell of configuring sendmail, you monster.
- aidenn0 6y agoHah, I still have some m4 html macros lying around, it's certainly the quickest way to make HTML less painful.
- abrookewood 6y agoCan you give more details? I don't think I've ever heard of M4 before.
- hedora 6y agoYou probably already have m4 on your development machine: https://en.m.wikipedia.org/wiki/M4_(computer_language) https://en.m.wikipedia.org/wiki/M4_(computer_language)
- bartread 6y agoOK, I'd never heard of this before and now I'm questioning why we have all these JS templating frameworks like Mustache, Pug[1], and the rest. [1] I actually use this one and it's just fine - great, in fact - but seeing M4 does make me feel like a lot of people may have spent a lot of time reinventing a wheel.
- anderspitman 6y agoI've tried to get into M4 in the past but was always put off by the syntax. Mustache has been my go-to since it's simple and has lots of implementations in different languages. Are there any good reasons to use M4 over Mustache?
- simias 6y agoThe only reason I didn't use Mustache was because it was unnecessarily complicated for my very simple use case. I just needed to effectively include blocks from other files in order to be able to share boilerplate between pages, plus having basic variable substitution for things like the page name. I even considered using the C preprocessor instead! But I definitely wouldn't recommend using m4 for anything beyond a quick hack, unless you're a m4 wizard (or willing to become one) and you trust that whoever is going to work on the project is going to be one too. It's definitely clunky and not very user friendly.
- folmar 6y agoThe syntax of m4 is unwieldy, a "standard library" would be also needed to make it useful for smaller tasks. How often do you define loops yourself? Sadly this holds to an unexpected degree for Mustache. [1] - looks like a DOM AST + Javascript to me, quite unlike template
- 6y ago