News for hackers. Stuff that matters.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by hayksaakian on Tuesday March 04, 2014 @02:35AM (#7338979)
Don't take this the wrong way, but why PHP?
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by noonespecial on Tuesday March 04, 2014 @02:57AM (#7339028)
Outside of "the bubble" the web is basically made of php and perl. Its like the dark matter of the internet. If you want to reach all they way down to the weekend dabbler, you really need to choose one of those 2, and of those 2, php seems more immediately accessible.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by codygman on Tuesday March 04, 2014 @03:21AM (#7339077)
Sadly the web is made up of a lot of php code. Luckily this graph lets me sleep better at night:

http://www.indeed.com/jobtrends?q=php&l=&relative=1

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by vidarh on Tuesday March 04, 2014 @04:44AM (#7339287)
I think you'll find that graphs like that are meaningless. I work for an agency that does mostly PHP work, and we never advertise, because for common skills like PHP, recruiters and potential hires inundate us with calls every single day. I expect the very common skills like PHP are severely under-represented in ads for this reason. For less common skills, you need to advertise, as people won't know where to go.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by deckiedan on Tuesday March 04, 2014 @02:40AM (#7338993)
Presumably because of how many webhosts have it available automatically.

I'd pondered a flat file based php 'blog' engine once - with all the benefits of markdown or whatever - no database complexity, easily rsyncable for deployment, git can keep revisions, etc...

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by hayksaakian on Tuesday March 04, 2014 @02:43AM (#7339002)
Sure makes sense. I asked because I always see post about Jekyll and octopress, and such. That are basically server-less.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by deckiedan on Tuesday March 04, 2014 @02:50AM (#7339016)
Yep - and there's also some benefits performance and security wise to not having any serverside code at all (other than nginx, or whatever).

The problems you have with jekyll, pelican, et al is that you lose site-side search, 'related posts' (without some reasonably complex compile-side clobber), etc. etc.

Using extremely minimal PHP lets you deploy just as easily, you don't get too much of a performance hit (a hell of a lot better than wordpress, etc), you can still do search, related posts, forms, embedding, and all that.

PHP as a server-side 'clever templating' language really isn't that bad. It's only awful when used to build anything massivly complex (such as joomla! or drupal...), and that it encourages messy project design.

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by mercurial on Tuesday March 04, 2014 @03:05AM (#7339042)
> PHP as a server-side 'clever templating' language really isn't that bad.

I only touch PHP as little as possible, and work with a legacy PHP codebase, but AFAIK, it hasn't evolved a tag to automatically HTML-escape/JSON-escape content. So, it's as good a templating language as it is a programming language: pretty terrible. I'll trade PHP for something as barebones as Python with WSGI + Jinja2 any day.

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by pestaa on Tuesday March 04, 2014 @03:55AM (#7339164)
It's not fair to compare to compare pure PHP and Jinja2. Twig is the PHP-equivalent of Jinja2, and it is an extremely well designed templating engine.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by mercurial on Tuesday March 04, 2014 @04:20AM (#7339209)
What's not fair about it when talking about PHP as a templating language? My point is that while PHP is often lambasted as a terrible programming language, people forget that its HTML templating part is even more abysmal. If you need to have a templating system in your "advanced templating language", this really tells you everything you need to know about its capabilities.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by pestaa on Tuesday March 04, 2014 @04:47AM (#7339302)
It's not fair because PHP came way earlier than Jinja2. Both Twig and Jinja2 could learn from its predecessors.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by deckiedan on Tuesday March 04, 2014 @05:06AM (#7339358)
Sure. But it /is/ a fair comparison, _in this discussion_, as essentially I did say - rightly or wrongly - in the grandparent to your original post that PHP was a reasonable templating language.

The fact is that it has been surpassed by Twig, Jinja2, Cheetah, and many other templating languages - which rather proves the point of @mercurial who you're arguing with, which is that PHP is not a great language to use for templating.

And, to be honest, I agree with him, actually. I'd be very very hard pushed to start a new project in PHP. Python+Jinja2 is a much more powerful and sane way to work.

However, as a templating language, for basic blogging stuff, if you're careful, PHP can be made to work, and, on a cheap host, may end up being easier to deploy than a technichally better system.

Just as BASH can sometimes be an easier solution to some problems than python or perl or whatever else. I'd never claim that BASH was a nice language to work in, but for very simple scripting, it can end up being an easier automation system than the alternatives.

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by mercurial on Tuesday March 04, 2014 @05:01AM (#7339344)
Your rebuttal would only be correct if the two following propositions were both true:

- software cannot evolve

- the notion of sanitizing input/output has magically appeared out of thin air in the last 15 years (I'm pretty sure that Perl Mason could do that when it first came out, around the same time PHP did)

Since clearly neither is, attributing the current state of affairs to bad technical decisions early on followed by inertia is the most logical explanation.

It's like comparing Java and C#: C# has managed to regularly introduce interesting features, while Java has stagnated for a long time. Of course it's easier when you start from scratch, but especially for simple features like escaping, which I highly doubt would require major changes in architecture, there is simply no excuse.

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by vesinisa on Tuesday March 04, 2014 @02:59AM (#7339035)
> It's only awful when used to build anything massivly complex (such as joomla! or drupal...)

Or a Bitcoin exchange

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by meritt on Tuesday March 04, 2014 @03:21AM (#7339076)
If only Mark Karpeles had simply written mtgox in another language, there's no way he would have lost 750,000 bitcoins.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by 72deluxe on Tuesday March 04, 2014 @04:35AM (#7339260)
Wouldn't he have just recreated the same bug in another language? I think you are confusing a bug in implementation/code with the language.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by vidarh on Tuesday March 04, 2014 @04:45AM (#7339290)
I believe you're missing the dripping sarcasm.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by uniclaude on Tuesday March 04, 2014 @03:10AM (#7339052)
To be honest, not implying you're wrong, but you could have "related posts" with pre-computation, and "site-side search" with a mix of pre-computed data structures and front-end Javascript (which could be quite efficient, provided the blog is not too large).
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by danpros on Tuesday March 04, 2014 @03:19AM (#7339073)
HTMLy has a built-in search feature and related posts. I use file-naming convention than the speed always fast even though let say the blog has about 3k of posts with hundreds of tags, why? HTMLy don't read the content first but filter it first. I already test it with mini VPS (RAM 128 MB) and no speed penalty.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by imdsm on Tuesday March 04, 2014 @03:22AM (#7339079)
Interesting choice. A lot of places still use it, but it definitely feels dirty. Not the kind of thing you usually see around here. While it is still used a lot, I have to say, when I saw PHP I immediately closed GitHub.
Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by 72deluxe on Tuesday March 04, 2014 @04:33AM (#7339249)
Do you close your browser when you find out it is written in C++? Or shut down your OS when you find out it is written in C? Or angrily close the browser tab when you find out something on the page uses JavaScript? Do you then go and wash your hands and wipe the nervous sweat from your brow?

If a tool gets a job done, does the language matter?

No language is perfect. I know PHP feels "dirty" but the misuse of it is likely the cause of widespread disparaging. Even the English language is not perfect. Does this stop you using it?

Just a thought. I tend to close tabs when I come across stuff written in languages I can't write in... :-)

Re:HTMLy: Databaseless Blogging Platform (Flat-File Blog) by meritt on Tuesday March 04, 2014 @03:17AM (#7339068)
Why not? It's a static cache generator. Does the language remotely matter?