Global variables?

A forum for Bolt related questions / issues

Global variables?

Postby PQR » Wed Oct 03, 2012 2:55 pm

Found a lot of global variables usage, for example $app in controllers:
Code: Select all
$backend->get("/latestactivity", function(Silex\Application $app) {
    global $bolt_version, $app;


But $app is already injected by function paremeter. global $app - what for?
$bolt_version - should it be stored somewhere in $app['version'] for better incapsulation?

Also you define a lot of functions in global namespace - may be try to put them in some Bolt namespace?

All these question are about code style and may be not so important, especially when you do a "lightweight" solution. What is your philisophy about code cleanness?
PQR
 
Posts: 2
Joined: Wed Oct 03, 2012 2:47 pm

Re: Global variables?

Postby Bob » Wed Oct 03, 2012 3:12 pm

Hi,

This is my/our first serious project using Silex, so we're obviously doing things in ways that can be done better and/or cleaner.

For october 2nd, the main priority was getting a working build out there in beta form. Over the coming few months we'll be refactoring stuff. All of the things you've mentioned are valid points and "Code cleanness" is a very important point, as far as i'm concerned.

Even though Bolt might be "small" and "lightweight" when compared to monoliths like Drupal, I _do_ want to make Bolt as good as it can be, because I'm sure there's a place in the crowded CMS market for a tool like this. To do this, I want to make it absolutely clear that Bolt is here to stay, and I want to have more developers who are actively working with us to improve Bolt. Having a solid, clean, codebase is a must to get other people enthused about it, so yes: I think it's very important.

That there are still quite a few things that can be done better, is mostly a matter of manpower. Only so many hours in a day. :-)
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Global variables?

Postby PQR » Thu Oct 04, 2012 4:52 pm

Have played with code a little bit more - you did a great job! Dont stop!
PQR
 
Posts: 2
Joined: Wed Oct 03, 2012 2:47 pm


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron