1. Having trouble staying logged in? Note: We are rpgcodex.NET not .COM. Trying to login via .com will cause issues. Make sure you are on rpgcodex.net to login and all will be fine.

    And if the Password Recovery doesn't work (there was an error transitioning accounts during the upgrade), use the "contact us" link right down the bottom right of the forums and harass us about it. Include your account name and its e-mail address (or whatever parts of it you remember).

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Community At long last, we're finally back

Discussion in 'RPG Codex News & Content Comments' started by DarkUnderlord, Feb 13, 2012.

  1. thesheeep Savant

    thesheeep
    Joined:
    Mar 16, 2007
    Posts:
    2,771
    Location:
    Berlin
    Click here and disable ads!
    Okay, the way I see it, you are still a bit struggling with typical OO structures. You'll get used to it. I'm doing this since some years and (except one hell of a nightmarish 3D engine) have a pretty easy time doing what you described, in any language that I can "read" (similarity to C++ helps). And not because I'm some kind of genius. It's practice. :)

    Also, the code you showed is typical web-developer uncommented garbage. Maybe the concepts in there in how they use their classes is good, but as you noticed, you don't get anything thats going on there without having to look into each sub-function, class, etc. That is why good devs (good as in "other people will understand what I did there") use comments not only to describe a function, but also within the function.

    By what you showed there, I have no doubt that the rest is equally hard to get. so kudos to you for managing it somehow anyway. Even if you had resort to the method that will force you to do it again ;)

    Really, the code some web-devs produce gets me mad each time. And why? because they don't get that code is more often read than written, or worse, they don't care...
  2. Shagnak Augur

    Shagnak
    Joined:
    Sep 6, 2003
    Posts:
    4,523
    Location:
    Arse of the world, New Zealand
    Most excellent. Carry on :salute:
  3. OldSkoolKamikaze Liturgist Patron

    OldSkoolKamikaze
    Joined:
    Jan 24, 2007
    Posts:
    5,515
    Race Traitor
    Wasteland Ranger
    Dead State
    Server Slush Fund 2012
    Brian Fargo
    Divinity: Original Sin
    Potato 2013
    Looks fine to me.

    Good code is self-evident. Shitty/obscure/irregular code needs comments. All code needs documentation. There's nothing wrong with the code that he posted as long as there's external documentation describing what things like responseView is and how it's used.

    Herp derp. If that's all there was to OOP, DU wouldn't be having the issues he's having.

    I can't tell you what responseView is but there should be documentation telling you what it is.

    Don't know what a JFileChooser is in Java? http://docs.oracle.com/javase/7/docs/api/javax/swing/JFileChooser.html
    Don't know what an Event Source Object is in a random jQuery plugin? http://arshaw.com/fullcalendar/docs/event_data/Event_Source_Object/

    If there is no documentation, then there's not much you can do other than read lots of code.

    "XenForo_ViewPublic_Thread_CreatePreview" is an object.

    You're having trouble with this because of an OOP concept called inheritence. They're probably implementing the template pattern, but I can't tell if XenForo_ViewPublic_Base is abstract (if PHP even has abstract classes).

    That's a constructor initializing some or all of an object's properties. This isn't PHP specific stuff you're having problems with. I've only used PHP a bit years ago for simple CRUD operations, but I can figure out what's going on. You're struggling with the OOP.



    Don't let thesheeep bully you into feeling like an idiot for not understanding OOP. It's not simple. Especially not for someone with an existing background in procedural programming. OOP isn't just a few disjointed concepts, it's an entirely different mindset and way of approaching a problem. That said, If you're going to continue to maintain these forums using this software, it would probably be in your best interests to actually learn OOP.
  4. DarkUnderlord Janitor

    DarkUnderlord
    Joined:
    Jun 18, 2002
    Posts:
    17,331
    Location:
    Sitting on the outside, looking in and complaining
    Yeah, that was pretty much the plan - only it meant committing time to it that I didn't really have and it was a greater mind-fuck than I had anticipated.
  5. Irxy Scholar

    Irxy
    Joined:
    Nov 13, 2007
    Posts:
    249
    Location:
    Schism
    Race Traitor
    A pity, I used that one a lot.
    Guess I can just browse the news forum instead for now.
  6. Grim Monk Learned

    Grim Monk
    Joined:
    Nov 7, 2011
    Posts:
    365
  7. Fens Arbiter Patron

    Fens
    Joined:
    Nov 3, 2009
    Posts:
    1,727
    Location:
    pitcairn
  8. Kosmonaut Lost in Space

    Kosmonaut
    Joined:
    Jul 11, 2008
    Posts:
    4,717
    Location:
    CCCP
    Is not only OOP, but looking at the code DU posted, the Xenforo programmers make an extensive use of other concepts, like HTTP requests/responses, Model View Controller architecture, and software patterns, that you need to be at least a little familiar with.

    Moreover, and this is one of my biggest gripes with PHP: the lack of modules or namespaces support (at least in versions < 5.3) is the reason why all the objects and methods have those big-ass names.

    I think that the types and variables are well named and give you the intent of what they do. It's just the Xenforo devs love for long-ass chains of indirection (objects instances calling other instances calling other instances...) and the long names that makes the code a little difficult to follow.

(buying stuff via the above links helps us pay the hosting bills)