Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-03-19 21:22:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,391
Website GitHub

Re: [contrib] Textpattern on Rails

gerhard wrote:

Working with code that doesn’t have tests

Tests shmests :-) That’s for proper programmers who care about coupling, cohesion, and putting assertions in their code! I kinda like PHP for its nebulousness. That’s not to say I wouldn’t love Rails (if I understood it) but PHP is more what-you-see-is-sometimes-what-you-get, which is a close approximation to a programming language in my mind. I’m a hacker not a coder; hell, if I was a coder the world would have way more bad code than there is out there already.

I would also like to replace the core tag parser with ERB syntax

It sounds like you spend a lot of time in the corporate world (just guessing, since you love Capistrano and other productivity tools) and want a grown up, corporate CMS to the point it has an uber-efficient programmer-style syntax for its tags. As Bert says, fork away! Luckily (for me) I escaped the corporate world when I realised that if I didn’t write code to meet the deadline or didn’t put piece of Paper A into slot B in a timely fashion the world would keep on turning. But I can see how people who are still in that environment would crave a more streamlined engine to TXP so it can do more stuff better, with more terse code.

Like a few others who have posted, I’m glad TXP is not that. You can say that it’s resistance to change if you like, but — even as a programmer of sorts — I consider the XML syntax simpler for non-geeks to comprehend. And TXP is primarily for designers (they outnumber us code monkeys by a hefty margin, and where would TXP be if it was only for people with a programmy mindset?)

Of course, because I occasionally have a hankering for code-like tags, I’ve done my best to bring the ‘programming’ style of tags to the masses with my plugins. For those that want the extra 20% of grunt from their sites, it gives that power and flexibility while (sort of) retaining the TXP feel. For the majority that don’t, ignorance is the best medicine; if I may mix my metaphors.

BTW, would a new engine stop all current plugins working, or can Rails interpret PHP too? Sorry if it seems a naive question. I’ve looked at Rails a couple of times and have just failed to grasp MVC. I feel so stupid, but it just doesn’t ‘click’; perhaps because all the examples I’ve seen so far are so bloody abstract that I can’t see any real-world use for them :-)

I got OO; it seemed logical and made sense to model and encapsulate real-world objects in code (hehe, then I wrote Java for a while and the novelty soon wore off because of the poxy API!) MVC sounds like it should be the answer to everyone’s coding prayers but — call me Mr Thick Thicky Thickety-Thick— I just don’t get it.

I guess what I’m trying to say is that Rails might well be the future, but I’m quite happy with my comfy, albeit unwashed, PHP blanky. Come the revolution I’ll probably eventually grasp Rails (and Perl too, one day!) and then look back, bleary-eyed and wonder how I ever managed with PHP, in the same way I can’t believe I spent years writing web sites by hand before I found TXP. It seems you’ve reached that stage and desire more; go for it. A Rails TXP would no doubt rock. And I might even be able to learn from it and understand this Rails stuff when I see it in a real environment that I can relate to. But please leave this TXPPHP warts and all — for those less fortunate than yourself.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2009-03-19 21:59:55

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: [contrib] Textpattern on Rails

What about Python/Django?

Offline

#15 2009-03-20 01:04:10

TheEric
Plugin Author
From: Wyoming
Registered: 2004-09-17
Posts: 566

Re: [contrib] Textpattern on Rails

I just gotta say. I hate RoR. I’ve tried it, and absolutely loathe it.

For those wanting features? Hire a plugin developer or wait for the xPattern beta.

Offline

#16 2009-03-20 09:36:09

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [contrib] Textpattern on Rails

Guys, your feedback is fantastic!

VW Beetle vs Mitsubishi Lancer Evo

Bert, PHP is like a Beetle: reliable, easy on everything, fun to drive. Ruby is like a Mitsubishi Lancer Evo: brutally powerful, more complex than a space shuttle, jap reliable and detailed. Rails is the hatchback version : ).

PHP is great for the quick hacks, but the more complex the things one is trying to achieve, the more difficult it makes it. I’ve spent days and days trying to make Textcommerce work, I just had to give up in the end. Last time I’ve put a Rails app together it was an address book – a simple exercise. It was uploading images (multiple per account), it was resizing them, contacts could be assigned to multiple groups etc. It took me just shy of 4 hours from start to finish. This did not include any styling, only the raw code. 4 hours is still damn good if you ask me! Oh, and I didn’t use any scaffolding.

You’re right though Bert, I will fork the TXP core principles, the admin look, the conventions (XML tags for example). I will however use Ruby, not PHP, simply because I’ll be able to implement all those features that I’ve mentioned much quicker, with my BDD wet blanket : ).

I am not Waterfall or Gantt, I’m Agile.

There’s a big difference between being corporate and wanting to build a watertight CMS, and giving more flexibility to the poor sods that try and squeeze every ounce from Textpattern. I have been one of those sods for years. I have been a freelancer that has been pushed into the corporate world because TXP would take me to a certain point, and then just leave me hanging. I couldn’t turn around websites quickly enough, I couldn’t stay on top of updates, of client requests, of general maintenance. I knew there had to be something better out there and I went looking. Now I’m back, and my glz_custom_fields plugin which was the last thing that I’ve done in the TXP area was more of a hit than I would have thought. That was just a glimpse of what was possible, maybe 1% of all the good ideas that float around TXP. What it could be, but it isn’t and never will be because there aren’t enough coders around to give up the time required by PHP to actually write the damn code.

Our current Textpattern is great, the best CMS there is, no doubt about it, but I know for a fact that it can be better by leaps and bounds.

Stef, I understand you mate, you’ve seen the rat race, did the rat race, walked away and vowed to never go back. What if I told you that it doesn’t have to be a rat race? What if I told you that the management (God, I hate that word!), in general, are a bunch of fat tossers that think coffee, profit, client expectations, bonuses, expensive-fat-bodeans-lunches, solitaire, blackberry, etc. There is also a minority however that are all about Agile, self-organizing teams, best practices, 4 day work weeks etc. I had my share of both, and now work for the latter group (well, almost). I am fortunate and I can tell you for a fact that it doesn’t have to be all about deadlines. It is however about making things better. Dude, our nature is to try making stuff better, it’s why we are where we are.

If you just think for a few minutes, Ruby (the programming language) and Rails (the framework) came from nowhere a few years ago. There are whole ecosystems built around them because they have proven themselves over and over again to be better. They have taken on Java, C#, Python and, not last, PHP, and won the adoption race. It might be just a trend, but it’s been going for a few years now and it’s stronger than ever, so I think it’s safe to assume that they won’t go anywhere within the next few years – at least.

37signals is by far one of the most successful web companies in the world, Rails and Ruby are the reason. Spotting that is a no brainer, but joining all the goodness of 2 things without cocking it up is. That’s where you guys come in. Trash my idea, entertain it, give me your honest opinions. Heck, change your mind about it. I really want to get this right and I want you all involved from the start.

XML tags will stay

Suffice to say that these are quiet popular and would be greatly missed. I’m approaching this from an optimization & coding viewpoint, most of your are coming from the designer perspective. I can relate to that and I will definitely keep them. Yes, Radius is the right way, thanks Jon. I think Radiant has the same approach, it will be a good starting point.

Ruby is my day job

Amen to that brother. I’m exactly in the same position Graeme, glz_custom_fields had to come second to all the Ruby and Rails work that I’m doing throughout the day.

Talking about permalinks, the routing mechanism had a great boost in Rails 2.3 – faster by about 50%, huge memory savings. There is so much goodness in Rails 2.3 alone that I could easily fill 2 pages, not to mention the other releases. I’m sure you’re familiar with Rails Guides Graeme, right?

I have the ideas, I know what’s what… now I have the tools

I knew about glz_custom_fields 2 years before I’ve actually released the plugin. I loathed the idea of how ugly some of the approaches will have to be, but there was great demand for it, I had some extra time on my hands so I’ve done it. I wanted to build my own CMS for ages now – this seems to be more like a teenager’s dream these days – but then I discovered Textpattern and all was handy dandy. For a while. Now I want to bring all the good coding ideas, practices etc. that I’ve acquired since glz_custom_fields and take it one further. That’s all nice and sweet, but I would be spending far too much time working for something that could benefit in a far greater way by a new approach.

Just imagine what will it be like to have a live search in the admin area for all existing Textpattern plugins and 1-click install. Upgrading between revisions will be just as easy.

And I’ll leave you with that thought alone, it’s great enough on its own : ).

Offline

#17 2009-03-20 09:39:22

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [contrib] Textpattern on Rails

As a complete non-developer, a RoR system would mean way more complications. From making sure my clients’ host supports RoR (not quite as common as PHP) to figuring out how things are installed/configured in RoR. I’d rather stick to PHP and work on making the current Txp better. we don’t need another fork out into nowhere.


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#18 2009-03-20 10:21:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,391
Website GitHub

Re: [contrib] Textpattern on Rails

gerhard wrote:

There is also a minority however that are all about Agile, self-organizing teams, best practices, 4 day work weeks etc.

Ace! Shows how much 6 years out of the loop can do to rot my brain of all the good things that are coming out of the mess I left behind. I’ve been part time since then and wish to stay that way.

I’m all for the “make things better” mantra; I’m a firm believer in that (not just in code terms!) ; it’s how I started in this thing called life, and it’s how I’ll end. Your enthusiasm for RoR is amazing and it’s hard not to get caught up in the wake of your posts alone. I’ve seen how it’s gradually taken a hold out there and hear loads of great stuff about it all over the place. If I understood maybe 1/10th of what the hell it’s all about I might be up there with you, rah-rah-rahing from the sidelines. But as I said, I plain don’t get it even after watching demos and trying it out.

On the surface it seems like my first encounter with Visual Studio. Everybody was like “VS man, it’s the greatest dev tool in the software kingdom, man”. Dutifully we convinced the boss to buy it for us so we could be leaner, meaner developers. What a dissapointment! After two days with the most cluttered and unintuitive interface since VisiCalc, I was close to eating the keyboard.

In order to show a Hello World on the screen in response to a button click you have to connect the output object to the button object and write your one line of code inside the auto-generated (oft badly named) stub function, have the system include 30 libraries and generate a tonne of supporting code on your behalf. Just so you can write one line of actual code.

So instead of one file containing my code it’s splattered across 40 files, 39-and-a-half of which I have no clue what they do. Nice from a cleanliness and encapsulation viewpoint, but not so great when you want to change something in code you haven’t written. You not only have to understand the way your own mind works, but the way the minds of the developers of the software tool work as well. And the two don’t always mesh.

From the demos — and this is just cursory, I’ve probably completely missed the point — it seems that the RoR framework ‘helps’ by generating code for you as well, but from the command line instead of point and click (which is kind of a blessing because I’m all about the keyboard). Perhaps that’s my reservation and where the mental block comes in: when it comes to developing in such a system, it’s like trying to debug code that someone else has written. And I’m crap at that ;-)

EDIT: and kemie’s point about host support is totally valid. Heck, a lot of cpanel hosters are only just putting PHP5 out as standard. Getting Ruby/Rails added is like asking for a side order of whale with ivory tusk dressing.

Last edited by Bloke (2009-03-20 10:29:01)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2009-03-20 10:26:38

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [contrib] Textpattern on Rails

Kemie, things are no different in Rails than they are in PHP. It runs under Apache through mod_passenger (just like you have mod_php) and it connects to a database, MySQL by default. The only hassle (if I can call them that) are gems and plugins, but they will all come bundled with the CMS, no need to install extra things on the server.

Dreamhost supports RoR and most other big names (including GoDaddy). Also, there is heroku which is incredibly slick (and currently free). Not to mention that Textdrive (current Joyent) is one of the friendliest Rails web hosts around.

Offline

#20 2009-03-20 10:58:26

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [contrib] Textpattern on Rails

Scaffolds are for show Bloke. They shouldn’t be used for anything else but templates. It’s like starting with a default blueprint in Photoshop that has the layout grid marked out. Rails is just a framework, the interesting part is Ruby. I think it will help if you took a look at Sinatra first. It’s also a Ruby framework, but an extremely lightweight one. I think it’s going to make much more sense than Rails to start with.

Rails is currently a bit bulky, but this is going to change with Rails 3. Not sure if you’ve heard about Merb, but the 2 are basically going to join together. Merb is modular and extremely configurable while Rails has everything under the sun and then some. Also, inline comments make more than 50% of Rails’ codebase if I’m not mistaken, so it’s extremely well documented in the code, that makes it appear bigger than it actually is.

Have you come across Peepcode? Those are the best starting-with-Rails tutorials I know about. Also, there is RailsEnvy which is also amazing. This would be a good starting point : ).

Offline

#21 2009-03-20 15:58:08

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [contrib] Textpattern on Rails

Gerhard, I’m really impressed with your goals and your enthusiasm. More power to you. I’ll try out rails, if it’ll deliver a much more powerful version of textpattern, absolutely.

Unfortunately I fear that plugins will have to be rewritten, is this the case? I have a pretty big investment in a few custom plugins.

When I formulated the ideas behind xPattern, (after messing with drupal’s CCK, and feeling textpattern’s limitations building sites with client login sections) I was totally shocked that the devs at the time didn’t jump on it. The dismissive, condescending and hostile response was totally weird to me. Flexible custom content types just seemed like the obvious path forward for textpattern, but for some reason it was like the idea had poo on it’s shoe.

Alas xPattern suffered from lack of available time resources (I’m chiefly to blame here) and has moved very slowly.

Fortunately two key plugins allowed me to build the kind of sites my clients want; glz_custom_fields + sed_section_fields. It’s amazing how some creative thinking and clever coding took care of about 80% of what I wanted from xPattern. I’d be building sites with something else, if these hadn’t come along.

So Kudos Gerhard, your work is appreciated. Good luck with Textpattern on rails, I’ll help out where I can.

Offline

#22 2009-03-20 16:23:46

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [contrib] Textpattern on Rails

typeshige wrote:
What about Python/Django?

I’m with you. Way more interested in seeing this in python/django than rails. I was thinking of taking a stab at reimplementing TXP semantics in Django to learn it.

Although anything that is not .NET C# (day job) would work for me :-)


Shoving is the answer – pusher robot

Offline

#23 2009-03-20 16:26:01

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [contrib] Textpattern on Rails

Thanks Dale!

You’re right, plugins will need to be rewritten but I think we need to get to that bridge before crossing it. I mean, there is Facebook’s thrift and a few other development resources, it’s something I can look into when the time comes. I don’t really think that we’ll have a cutoff point, a transition seems to be most sensible option. Also, TXPR might be more suited for some sites while the original TXP will be better for the ones that require specific plugins.

Offline

#24 2009-03-20 16:28:26

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [contrib] Textpattern on Rails

Patrick, I favour Ruby and can see how most things could be worked out in it, no idea about Python/Django. Hey, maybe not before long we’ll have TXP in every programming language under the sun, that’s one of the things I love about democracy. : )

Offline

Board footer

Powered by FluxBB