Programming styles, and does it really matter?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Programming styles, and does it really matter?
« on December 15th, 2012, 04:55 AM »
So, I've been reading up on vB 5, mostly out of the trainwreck mentality, and a bit of curiosity about how it's shaping up[1] and one of the things I've seen is commentary from developers doing a sort of peer review.

It also brings to mind a conversation I've had in the last couple of days, about coding style, where I said that a fair chunk of Wedge's code is written 'SMF style', which is a completely fair assessment from my perspective; Nao and I spent so long writing for/with SMF that it's not really surprising that it has shaped how we do things. There are some more modern things - there are more classes and things like exceptions in the newer code, but it doesn't change the fact that it's still carrying a lot of SMF structure and mentality to it.

Now, there are some interesting debates about OOP and procedural coding out there (and we are more OOP than the past) but my real point is... does it actually matter?

The only people who are going to see the code are the people who are going to modify the code, either directly or through a plugin - and of course us, in development and bug fixing. Whether something uses OOP or not should not be a concern for most people - and even for the people who do have a concern because they use the code, I'm not entirely sure most of them understand all the ramifications - heck, I'm not entirely sure I do some of the time.

Having classes to bundle functionality can be important. But it doesn't have to be as important as some of the pundits and reviewers say it is.

What I do know, and believe in, is using the right tool for the job. OOP is a tool, nothing more, but a lot of the 'but it isn't OOP' stuff seems to drift into the realms of 'when all you have is a hammer, every problem looks like a nail'. There's good OOP, there's bad OOP, just as there's good and bad procedural code, and we have a strange mish-mash, some of which we've inherited and some of which we've fixed.

But how many people care? As long as it works, does it actually matter that much?

/discuss
 1. The answer is badly. Even fresh installs are taking 60+ queries to do simple pages.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Programming styles, and does it really matter?
« Reply #1, on December 15th, 2012, 06:56 AM »
In my mind, it doesn't matter. Objects or no, just ensure that it's readable and logical. And unified - one style in the entire project.

(and lulz at vB)
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

MultiformeIngegno

  • Posts: 1,337
Re: Programming styles, and does it really matter?
« Reply #2, on December 15th, 2012, 07:58 AM »
For what I know and understand, I agree with live. Pick the tool you need and you're more comfortable with, and be sure to be consistent and clear (it would help you in primis). :)

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Programming styles, and does it really matter?
« Reply #3, on December 15th, 2012, 10:43 AM »
I agree with the above, it's important to go with what you're comfortable with. That being said, I'm personally more comfortable with OOP as it has grown on to me in the recent past (I've been using it almost exclusively for past few years), I find it easier to follow especially on larger projects and frameworks, unless you happen to be Gallery 2 which is a plane crash on a train wreck. As you probably would've seen from my recent codes, I tend to write almost everything under classes and objects with procedural wrappers if required.
The way it's meant to be

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Programming styles, and does it really matter?
« Reply #4, on December 15th, 2012, 08:19 PM »
I say if it ain't broke, don't fix it... For the last two years we've both used a good share of procedural coding and a small share of OOP when we felt like it (me, mainly for the templating object and hopefully soon for the hasBrowser code), it should depend on what we feel is best, rather than whatever rules we set for ourselves. We're shaped by how SMF was developed, it's a given, and it's not a bad thing -- most of the SMF devs were and are still good developers with good guidelines for themselves. I see no reason to try and move into another direction... ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Programming styles, and does it really matter?
« Reply #5, on December 15th, 2012, 08:33 PM »
What I'm worried about is more people writing off Wedge (and other of the free platforms) because it doesn't match up to some theoretical ideal of how code should look. Enough people write off the free platforms as being 'toys' and not 'real' software as it is.

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Programming styles, and does it really matter?
« Reply #6, on December 16th, 2012, 12:53 AM »
Quote from Arantor on December 15th, 2012, 08:33 PM
What I'm worried about is more people writing off Wedge (and other of the free platforms) because it doesn't match up to some theoretical ideal of how code should look. Enough people write off the free platforms as being 'toys' and not 'real' software as it is.
I see no way to fix this. Different people will have their own ideas of pretty code, and one platform just isn't going to satisfy them all. Just as in real life: some prefer raw carrots, others like them baked;  still, others like them steamed, some don't want any, and prefer corn instead.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Programming styles, and does it really matter?
« Reply #7, on December 16th, 2012, 12:58 AM »
Sure... the problem is that there are people who have it in their head that OOP is the 'answer to everything' and anything that isn't fully OOP is fundamentally wrong. Mind you, there are plenty of other issues to address in the free space first...

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Programming styles, and does it really matter?
« Reply #8, on December 16th, 2012, 01:12 AM »
"OOP is the end-all and be-all to code. You don't use it? Screw you! You blaspheme against the coding gods! You desecrate the sacredness of OOP!"
"But why is it better?"
"Uhh... just f***ing use it!!!"

 :niark:

It''s like dealing with the Apple fanboys.

Disclaimer: This does not apply to those who prefer OOP because they find tit more local and easier to use.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Programming styles, and does it really matter?
« Reply #9, on December 16th, 2012, 01:18 AM »
Sounds like feline :P
Quote
It''s like dealing with the Apple fanboys.
There are some people who like Apple devices and build quality but are not fanbois. (Like me.)

What it comes back to is that it is a tool for a job, and that you shouldn't try to do what Java does and force everything into this object pattern because it makes it ugleeeee.

Auk

  • Can I get a Box?
  • Posts: 64
Re: Programming styles, and does it really matter?
« Reply #10, on December 16th, 2012, 12:25 PM »
To use OOP doesn't matter to me. I've read about many bloggers making use of OOP and I tried to get into the trend but I just do not see the need for it. It's not making a huge difference except the code loses a bit of readability from my point of perspective, even after I copy a few examples. Still looks ugly to me.

Nothing is more despicable than respect based on fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Programming styles, and does it really matter?
« Reply #11, on December 16th, 2012, 03:49 PM »
Quote from Arantor on December 15th, 2012, 08:33 PM
What I'm worried about is more people writing off Wedge (and other of the free platforms) because it doesn't match up to some theoretical ideal of how code should look. Enough people write off the free platforms as being 'toys' and not 'real' software as it is.
Let's all remember how *that* totally killed WordPress ;)
Re: Programming styles, and does it really matter?
« Reply #12, on December 16th, 2012, 03:55 PM »
Quote from Arantor on December 16th, 2012, 01:18 AM
There are some people who like Apple devices and build quality but are not fanbois. (Like me.)
And there are even people who are avid Apple haters, but still miss their build quality :P[1]
 1. To be precise, I'm still desperately looking for a phone with: (1) a high quality screen, (2) freeeeeedom, (3) a physical Home button to make it easy to turn on when taking it out of my pocket, (4) quality components that ensure it won't break if I drop it from time to time, (5) narrow enough that I can manipulate it with one hand... The S3 has 1/2/3, the iPhone 5 has 3/4/5... Where do I get 'the' perfect phone now? :P Oh, sorry for the topic hijack :lol:

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Programming styles, and does it really matter?
« Reply #13, on December 16th, 2012, 03:56 PM »
Quick, name one other pure blogging platform out there that isn't WordPress.

Therein lies the challenge. WP is crap, of course, but there's a real shortage of other platforms that aren't hosted. Yes, there's MovableType but I'm still not sure how much of it actually requires Perl any more. Other than that... I'm struggling to think of any that you can actually host yourself on standard hosting.

On the other hand, there's a multitude of forum packages - off the top of my head, there's Wedge, SMF, MyBB, phpBB, PunBB, FluxBB, Vanilla, YaBB... *deep breath* IPB, vBulletin, XenForo, Woltlab Burning Board, WowBB *deep breath* and that's before getting into the likes of Joomla and Drupal's forum modules (the 'official' ones), or for that matter things like bbPress.

Much as I hate to legitimise it, http://www.forum-software.org/vote-for-best-forum-software-of-2012 lists a lot of software.[1]
 1. I don't like legitimising it because it's not about the software, things like that are simply about how many people shout it from the rooftops, and you have people like the MyBB fanboys who are about as bad as the Apple fanboys in shouting down opposition and ignoring the truth. They're not all that bad, but all the ones I've had the misfortune to encounter are.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Programming styles, and does it really matter?
« Reply #14, on December 16th, 2012, 09:01 PM »
Off the top of my head..? Dotclear (because it's French), Nucleus (because I used it back in the early noughts), and SPIP (just look at my old website http://dossiers.cyna.fr -- still the best pro-writer-oriented CMS IMHO, to this day.)

Really, there are tons of platforms around, it's just that WP has managed to outshine them all, not out of sheer quality, but because most people settled on it, and thus there's this 'virtuous circle' where blog users install WP because everyone is using it and thus it has the most support. Just like the S3 phone is the most used, and thus gets more attention from coders... :P

* Nao is wondering whether he shouldn't go for a S3 Mini... Ah ah ah.