ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

No kind way to ask this, so. . .

October 17, 2007 12:11am

Subscribe [0]
  • #61 / Oct 25, 2007 9:10am

    gberz3

    31 posts

    Saving a line of code here or there is nothing compared to the time and money saved by knowledge and experience of using a language and a framework. There’s something called a worklflow. Its purpose is to cut out the wasteful deliberation of always debating what to do next. Sometimes you revise it. But only when the gains are proportionate to the effort invested in the revision.

    Exactly.  So then, some question(s):  What drives improvement for you (whether that be a new framework with the same language or a new language)?  If you’re perpetually committed to said “workflow” at what point do you actually *truly* consider looking at other frameworks or languages? 

    I mean, I am *assuming* that most everyone looks to improve on a reasonably regular basis.  And seeing as how CI itself is reasonably new, something brought you here; so I’m curious as to what that *thing* is.

  • #62 / Oct 25, 2007 11:00am

    kucerar

    42 posts

    Here’s what I think:

    <?php
    include_once('config.inc.php');
    
    // *** TINY APPLICATION ***
    
    
    function action_home() {
        $GLOBALS['template_data']['main_content'] = "hello world";
    }
    
    
    function pre_action_login() {
        $GLOBALS['action_check_logged_in'] = false;
    }
    function action_login() {
        $GLOBALS['template_data']['main_content'] = "hello world";
    }
    function pre_action_dologin() {
        $GLOBALS['action_check_logged_in'] = false;
    }
    function action_dologin() {
        $_SESSION['logged_in'] = true;
        set_action('home');
    }
    function action_dologout() {
        $_SESSION['logged_in'] = false;
        $GLOBALS['view_data']['message'] = 'You have been logged out of the system.';
        set_action('login');
    }
    
    
    
    // *** TINY CONTROLLER ***
    
    init_action();
    pre_action();
    call_action();
    post_action();
    
    function init_action () {
        $GLOBALS['view_template'] = 'view_template.html';
        $GLOBALS['view_data'] = array();
        $GLOBALS['template_data'] = array();
        $GLOBALS['action_check_logged_in'] = true;
        $GLOBALS['action_show_template_view'] = true;
        $GLOBALS['action_show_action_view'] = true;
        set_action($_REQUEST['action']);
    }
    
    function set_action( $action ) {
        $GLOBALS['action'] = $action;
        $GLOBALS['action_view'] = "view_$action.html";
    }
    
    function pre_action() {
        global $action;
        if ( ! function_exists("action_$action") ) {
            $GLOBALS['error_actions'].="$action, ";
            set_action('error');
            return;
        }
        if ( function_exists("pre_action_$action") ) {
            call_user_func("pre_action_$action");
        }
        if ( $GLOBALS['action_check_logged_in'] ) {
            if ( ! $_SESSION['logged_in'] ) {
                set_action('login');
            }
        }
    }
    
    function call_action() {
        global $action;
        if ( function_exists("action_$action") ) {
            call_user_func("action_$action");
        } else {
            $GLOBALS['error_actions'].="$action, ";
            set_action('error');
        }
    }
    
    function post_action() {
        global $action;
        global $smarty, $view_data;
        if ( ! function_exists("action_$action") ) {
            $GLOBALS['error_actions'].="$action, ";
            set_action('error');
        }
        if ( function_exists("post_action_$action") ) {
            call_user_func("post_action_$action");
        }
        if ( $GLOBALS['action_show_action_view'] ) {
            $smarty->assign( 'view_data', $view_data );
            $GLOBALS['template_data']['main_content'] = $smarty->fetch( $GLOBALS['action_view'] );
        }
        if ( $GLOBALS['action_show_template_view'] ) {
            $smarty->assign( 'template_data',  $GLOBALS['template_data'] );
            $smarty->display( $GLOBALS['view_template'] );
        }
    }
    
    function post_action_error($message=null) {
        if (empty($message)) $message="Sorry,  incorrect action in sequence '{$GLOBALS['error_actions']}'.";
        $GLOBALS['view_data']['message'] = $message;
    }
    
    ?>

    Eventually, I would plug ZEND_DB into this to talk to the database.  ZEND_DB is in the same spirit as CI database lib.  I would never use an ORM.

    Smarty ain’t bad…it really could be worse.  It’s got the brand recognition.  jQuery with jQuery/jQuery-ui for dialog boxes and you have pieced together enough to gitrdun.

    I don’t need no lipstick on a pig which is Capistrano,  and we know what the pig is.

    Well the real problem is becoming a fanboy with whatever we’re working with…I remember wasting 2 days with CI just last week,  when ATK knocked it off in 2 hours.  Had I been wearing RoR fanboy goggles I would’ve wasted 2 weeks instead.

    -R

  • #63 / Oct 25, 2007 5:26pm

    llbbl

    324 posts

    I remember wasting 2 days with CI just last week, when ATK knocked it off in 2 hours.

    what is ATK?

    But I’m also always on the move and not averse to using PHP heavily once again, if the right framework comes along.

    Again, if you don’t think CI is the right framework or aren’t interested in making it the “right” framework than why incense people here needlessly with Ruby questions. If you want Ruby benchmarks versus every framework known to man, goto a Ruby forum.

    We read the same things you do, where experienced programmers tell us that Ruby is not as good as PHP in terms of performance and yet this is not good enough for you? 

    How about this:
    Computer Language Benchmark Tests

    According to that everyone should be using Python.

  • #64 / Oct 25, 2007 7:21pm

    BigErnMcCracken

    4 posts

    But I’m also always on the move and not averse to using PHP heavily once again, if the right framework comes along.

    Did you ever consider that for people here Code Igniter is “the right framework”?

    I basically choose CI over Cake, Symfony, et. al. because of the quick setup time and flexibility compared to the others. I’ve been using PHP for a while and the only reason I would switch to Ruby is if it provided functionality that PHP doesn’t, and that functionality was so important to me that it was worth learning another language and possible spending more money. So far that hasn’t happened and I doubt it will any time, if at all.

  • #65 / Oct 26, 2007 11:27am

    kucerar

    42 posts

    I remember wasting 2 days with CI just last week, when ATK knocked it off in 2 hours.

    what is ATK?

    http://www.achievo.org/atk

    It’s a big bloated CRUD framework with a bound widget library.  You’re done pretty fast.  They’re trying to do the same thing in Rails-land:  http://streamlinedframework.org/

    I used it but I think I’d like to get rid of it and redo it with some EXTjs widgets and just say I’ve upgraded the widget library.  I really don’t like working with widget libraries,  would rather write some vanilla code to generate the bound widgets if I have to.  If you’re bothered by .NET dweebs who say “well .NET does all that for you”,  you have my approval to say “well,  yeah I might like that…if I were an idiot”.

    How about this:
    Computer Language Benchmark Tests

    According to that everyone should be using Python.

    Actually according that that everyone should be using SBCL 😊

    When you look at the performance of all the scripting languages,  it kind of puts an end to the debate right there.  The performance is abysmal across the board with ruby the pig at the bottom.  Why do we take it so seriously when none of these languages are worth our time…

    -R

  • #66 / Oct 30, 2007 9:46am

    pickledegg2

    157 posts

    Kill em all!

  • #67 / Nov 03, 2007 4:30pm

    pedro123penduko

    3 posts

    This is just a discussion.
    No need to kill..
    😉

    But….

  • #68 / Nov 06, 2007 5:36pm

    gberz3

    31 posts

    Again, if you don’t think CI is the right framework or aren’t interested in making it the “right” framework than why incense people here needlessly with Ruby questions. If you want Ruby benchmarks versus every framework known to man, goto a Ruby forum.

    But I want CI benchmarks versus every framework known to man (including Ruby 😉).  And I figure that a CI forum is the best place to ask CI questions.

    We read the same things you do, where experienced programmers tell us that Ruby is not as good as PHP in terms of performance and yet this is not good enough for you?

    Right, experienced PHP programmers tell you that.  Just like experienced Ruby programmers tell you otherwise.  There seems to be a lot of “experienced” people giving opinion, which I why I’m looking for some tangible evidence.  As I said, I’m hoping to take a few ticks during the upcoming downtime to test these out, but until then I’d like whatever others have come across.

    Regards

  • #69 / Nov 06, 2007 5:48pm

    llbbl

    324 posts

    Computer language benchmark tests + the other articles about how bad Ruby is should be proof enough, but yes you are free to make whatever choice you want.

  • #70 / Nov 06, 2007 5:50pm

    gberz3

    31 posts

    I basically choose CI over Cake, Symfony, et. al. because of the quick setup time and flexibility compared to the others. I’ve been using PHP for a while and the only reason I would switch to Ruby is if it provided functionality that PHP doesn’t, and that functionality was so important to me that it was worth learning another language and possible spending more money.

    Fair enough—in a sense.  But it seems many are basically saying “since I don’t use [insert language here] I don’t know much about it.  If I knew more about [insert language here] then I might use it, but since I don’t I won’t.” . . .seems to be a bit of a chicken or egg scenario.

    So my question, again, what is your basis for determining the viability of something you have never used? 

    I’ll also ask another question.  Many people are experienced with several different languages and obviously choose the ones they use based on their needs.  Python/Django seems to be best at developing content-driven sites.  Ruby/Rails seems to be best at developing data-driven sites.  PHP/CIseems to be best at. . .?

  • #71 / Nov 06, 2007 5:59pm

    llbbl

    324 posts

    Because you could spend a year or two becoming really good at a language to only discover that what other people are saying is true, that it is not as good as, or offers no significant advantage to using a language you already know.

    PHP/CI is flexible enough that you can use it for a content-driven or data-driven (same thing?) or whatever else type of site. It is not best at a particular type of site, because it depends heavily on the skill of the programmer.

  • #72 / Nov 06, 2007 6:03pm

    gberz3

    31 posts

    Computer language benchmark tests + the other articles about how bad Ruby is should be proof enough, but yes you are free to make whatever choice you want.

      The articles—on all sides—are pretty biased. Yes, benchmarks, however, are definitely a source of strong proof.  Personally I am usually on small development teams (as that is what I prefer), and choose frameworks that allow speedy prototyping and more than acceptable performance.  Currently Rails is that.  It allows me to do what would take me at least twice as long in other frameworks I’ve used (including, but not limited to, Django, and Symfony).  Ruby is markedly slower than PHP on “average” machines, no doubt.  But *for me* the development time saved is well worth it.

    Being as I’ve never written a Rails app with more than a few thousand people worth of traffic, I don’t notice any true performance hit as opposed to PHP.  What I’m hearing though is that when you get into the several hundred thousand users arena, things start to go awry.  I’d be interested in seeing how true this is—with all the frameworks.  (I use “all” loosely)

  • #73 / Nov 06, 2007 6:12pm

    gberz3

    31 posts

    Because you could spend a year or two becoming really good at a language to only discover that what other people are saying is true, that it is not as good as, or offers no significant advantage to using a language you already know.

    Perhaps, but the beauty of languages today with their support communities, wikis, forums, and whatnot is that it won’t take nearly “a year or two.”  We all know that being a programmer in today’s world is about a mindset, and knowing how to learn—not just about what language you’re using.

    Sure 30 or 40 years ago you were known as a FORTRAN or COBOL programmer.  But that certainly isn’t the way it is today (or is it?).  While developers certainly can’t afford to change with the tide so to speak, can they afford to remain anchored?

    That said (or asked), when do you decide to actually spend that “year or two”?  Ever?

  • #74 / Nov 06, 2007 6:14pm

    llbbl

    324 posts

    With PHP frameworks you won’t have that problem, since it is completely different codebase.

    You can speedly prototype sites using PHP and CI, you just know RoR better, fine great than keep doing that until you have time to learn something better.

    I would imagine speedly prototyping is possible with Python and Django also, if you took 1-2 years to get really good at it.

    It takes time, knowledge and experience to become “proficient” in a language.

  • #75 / Nov 06, 2007 6:29pm

    gberz3

    31 posts

    With PHP frameworks you won’t have that problem, since it is completely different codebase.

    You can speedly prototype sites using PHP and CI, you just know RoR better, fine great than keep doing that until you have time to learn something better.

    I’m sorry, I know it’s rude, but. . .“then”. . .

    No, I wouldn’t say I know RoR (or Ruby) better than I do PHP, but what I do know about it does provide me even greater value than having stuck with strictly PHP+Framework.  Admittedly it took me about 2-3 months of regular RoR use to become “proficient”, but only 2-3 months—not a year, or two years or three years.  I know that everyone learns at their own pace, but it’s simply *not* that bad.  Nor are Django and Symfony, for what it’s worth.  You certainly get better over time, but the learning curves just *aren’t* massive.

    I would imagine speedly prototyping is possible with Python and Django also, if you took 1-2 years to get really good at it.

    It takes time, knowledge and experience to become “proficient” in a language.

    Yes, and I could likely get amazingly good with chopsticks and figure out how to eat every single dish with them, but I don’t.  I keep hearing different tools for different jobs, but then I get pretty much “same tools for different jobs because it’s what I know.”  If that’s the one and only basis then I guess there is no need for further discussion in that vain, and we can stick strictly to the benchmarks and such.

    Regards.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases