SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 49

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking followup on post "Is it safe to abandon PHP4 yet?"

    I read the thread and the various replies to the post "Is it safe to abandon PHP4 yet?", and it reminded me of something. I have been developing in ms access 97 for several years. I tried 2000, and even 2003. I even downloaded the beta of the latest and tried it. After all the mess, I still use access 97. I mention this because over the last year I've been learning php. I even switched to the 5.0, but switched back to 4.4.3. Here's my point: People cannot leave well enough alone. Why can't they get something that works well and leave it alone for at least several years? Sure, now-a-days you have a lot of flash and non-sence on web sites. But you know something, all the extra bull isn't really needed to simply pull records from a database, edit records, add records, etc. You take a large warehouse that ships 50 to 100 truck loads a day, if they use php as a frontend to their backend database weather oracle or mysql, or whatever, they want one thing. And that is to pull up that order, load that truck, and press on. They don't need a cute little flash movie, or something bouncing across a screen. They need to search for load number 125576-5, get the info, and load the freakin truck. NOW, with that said, why does php5 even exist? I think php4 is great and should be around for another 10 to 100 years. When will modern humans leave stuff alone. To close: I liked microsoft better when they only had a small number of employees. I believe some of the bull applications people are coming up with now is due to the lack of having anything better to do. You hire those 1000 extra college grads, and turn them loose coming up with non-sense instead of good stable applications. Some of the best applications were written in the old dbase 3 plus. Good ole raw databasing, no cute little thingies all over screen.

  2. #2
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Lithuania, Europe
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why use PHP 5? Because it's better compared to PHP 4 in many ways: added exceptions, removed idiotic PHP4-style passing of objects by reference, class autoloading, improved overall OO model, etc... If you only code in procedural (and I guess you do), you probably wont win much by switching, otherwise it's worthwile to do so.

  3. #3
    SitePoint Guru Skyblaze's Avatar
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    734
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    infact i'm learning php OOP from php antologies that focus on php4. I mean my hoster (and the most) still has php4 so........It isn't a problem to use the reference operator on objects....

  4. #4
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    I'm still using PHP4, but every dat I count the number of lines of code that will be removed when we switch to PHP5. Especially with the clean-ups of adding exceptions and dependency injection.

    So I use PHP 5 to write less code, and Ruby to write even less than that.

    Regarding Access, it's seems to me to be pretty much the only player in it's field. I don't follow these things though. Have you considered any alternatives that may be better in some way? What things do you find repetitive in Access?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  5. #5
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question re: concerning access

    Access is by far the best single user and small office network frontend to a database. I'm learning and doing things in php for the sake of web databases. prior to a year ago I strictly focused on networked databases.
    One program I tryed is Phprunner from xlinesoft. It's pretty darn good because you can still modify the generated code. They also have before/after edit events, before/after add events, and all sorts of things like that. I did learn alot of raw php programming before I tried any other programs. Now what is oop? And one more thing for your info, You can still gain access to a large database using odbc or oledb with microsoft access and ado. I set up a test to one in another city and it worked great. Again the only reason I bothered with php or asp, or asp.net is to better myself and learn web databasing. But if a company doesn't need the general public to see/veiw their database, ie., more of an intranet, the ms access or a visual foxpro frontend is still a good choice. The trucking company I work for has to get orders off a web database the customer has setup. And believe me there are many other trucking companies having to go to this same database. So for many hits to a database a web database is the way to go now. But if you have only 3 or 4 offices accessing a private database, then the ms access or vfp method is still great. So far I like php runner it works with php4 or php5. I programmed our dispatch and settlement software. I think in database terms, I imagine a lot of you don't. I guess I don't understand some of the crazy websites out now. I'm used of pulling up data and working with it. I don't want or need 100 pictures or a flash movie playing while I'm trying to do my job. I focus on entering a load in our database, and dispatching a driver on that load. Please answer the what is OOP thing? Sounds like a gimmick. After all the fuss, you still have raw data on the backend database weather mysql, oracle, ms sql, or whatever backend. People, these are database records, ie., raw data. Period! So call some modern technique anything you like, but after the smoke clears, you are still retrieving a database record to view or edit or print or whatever it is you do with your raw data.. Is someone out there calling a database record an object now?

  6. #6
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Evolution. PHP4 solves it's task - yes. But PHP5 does it better.

  7. #7
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And what is dependency injection?

  8. #8
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While I have some of you here, what is your opinion on asp.net? I don't like it I like php better. Just wondering.

  9. #9
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9
    While I have some of you here, what is your opinion on asp.net? I don't like it I like php better. Just wondering.
    You just opened a can of worms.
    * devbanana runs for the hills

    ASP.NET is a great framework. It's nice because you can use several different languages with it, so you can generally use whatever you're most comfortable with. However, i always feel restricted with it. It controls a lot of details, even down to how fields are output and such. I think that for those who don't mind giving up some flexibility for faster or easier development, it's superb. There are generally ways to do what you need to do, but sometimes it takes so much work just to jump through the framework's hoops that it's not worth it.

    For myself, I like PHP because it doesn't really restrict me at all, but lets me do whatever I want/need to do in whatever way I want/need to do it. It's kind of like Perl, except that you don't have to manually parse input, don't have to send headers if you don't want to (PHp will send its defaults). Note: I'm not saying that those are the only differences, just that they are fairly comparable in the level of control you have. Not to mention that PHP has a lot of useful classes and functions to let you do things you'd have to create manually otherwise. Seems like every time I wonder if there's a way to do something in PHP, I look at the manual and it's always in there somewhere.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  10. #10
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jim9, while you do have some valid points, it is just the inevitable progression of software. The same questions could be asked for MySQL, MS SQL, Perl, Python, C++, whatever you like. Either security holes are found, bugs are discovered, or the user-base requests new features that they feel will enhance their ability to develop in that language. In the case of PHP, many developers requested to have much better OO support. We got it. Not to mention there are better and easier ways of parsing XML, handling errors, just to name a few additional features.

    If you don't know what object-oriented programming is, well, it's not something one can explain in 50 words or less, but the linked article might help to at least give you an idea.

    Quote Originally Posted by jim9
    Sure, now-a-days you have
    a lot of flash and non-sence on web sites.
    Quote Originally Posted by jim9
    They don't need a cute little
    flash movie, or something bouncing across a screen.
    Quote Originally Posted by jim9
    I don't
    want or need 100 pictures or a flash movie playing while I'm trying to do my job.
    I don't see how this has anything to do with PHP versions. Blame flash for that. Whether you use PHP4 or PHP5, though, doesn't have any baring on how your web site looks.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  11. #11
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read this, http://www.devx.com/DevX/Article/26776/0/page/3. I agree with this article. Also the article I was asked to check states: OOP is a new paradigm, point of view, and marketing term. The term has been here since the 60's. Sounds like oop is nothing more than a common stored procedure, ie., IsPageLoaded type thing. Or an include used over and over again. OOP is only in your mind, it doesn't exist, it's a term being thrown around. A fad, a gimmick. I believe in relational databasing. I like set theory, b-trees. Do you guys call smarty oop?

  12. #12
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by jim9
    Thanks for wasting my time on one of the lamest articles I've ever read .

    Quote Originally Posted by jim9
    Sounds like oop is nothing more than a common stored procedure, ie., IsPageLoaded type thing. Or an include used over and over again.
    What text did you read that makes it "Sound like" a stored proc or include (two very different things)? Was it the "Beginners guide to Assembly" from the same author as above? OO has nothing to do with either of these. It's a layer of abstraction above (two if you count closures) that makes things easy to change and easy to work in the language of the domain.

    What do you think polymorphism is?

    Quote Originally Posted by jim9
    OOP is only in your mind, it doesn't exist, it's a term being thrown around.
    I don't understand why you post on forums? Your attitude is pretty much going to guarantee that you drive away anybody who would be willing to help you. A shame given the quality of this forum.

    You are obviously not going to make the effort to learn OO until you see a need. While you are slapping front ends on relational data, you won't. Fair enough.

    You might start to see the point when you are dealing with non-tabular data, fuzzy data, or any system that has to evolve, or is poorly defined to begin with, a project with a large number of developers or one that has to be very flexible or configurable. That's normally anything that's new.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  13. #13
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That article seems to be comparing C-like languages to basic. If someone wants code that looks like normal language, then they should use basic. I find the syntax of C-like languages more intuitive than that of basic. But that's besides the point of the discussion.

    How does OOP fail in efficiency? Speed of execution? Speed of development? It didn't really clarify. In some languages OOP is somewhat slower, but the difference isn't that great. Anyone here will argue that development time in OO can be much faster than with procedural programming, if you are experienced with OO concepts.

    jim9, no offense really, but you shouldn't really form an opinion on something you yet have no idea about. It is not any of the things you mentioned. it's a programming paradigm.

    If OOP is so bad, why have most modern languages adopted object-oriented support? Java requires it, C++ supports it (all the way back from 1983), PHP now supports it, just to name a few.

    A fad lasting 4 decades is an awfully long fad.

    By the way, most of the languages supported by .NET require OO, as well. The .NET framework itself is object-oriented. It just seemed like that article was saying that since .NET languages are all compiled to the same result, we don't need to use OOP.

    also, C++ really isn't that bad. Yeah it's hard but extremely powerful. You have more flexibility and control than any language I know, except for Assembly, of course. But it also has a lot of useful functionality for the programmer, including operator overloading (my favorite), template classes and functions, pointers, function pointers, friend functions and classes, and an excellent standard library, not to mention it supports multiple paradigms. It doesn't force you to use OOP if you don't want to.

    I replied to some of the points the article was trying to make, so that's why my post jumped around so much.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  14. #14
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your own words, what is oop? I read 2 articles, and still don't know what it is. Is Smarty oop? I have programmed in c. Not a lot, and to me it was no different than basic. I used to do a lot of basic programming. I even programmed an advanced tubing program, like when a muffler is bent, how far to advance to next bend, then how much is rotation from previous bend. Very advanced math used. A basic program will kick out results as fast as c. Please explain what oop is besides a term. Really, I don't understand. FYI, I have also done some lisp (autolisp) scripts in autocad. Now lisp is hard. I am not new to programming. I have been doing it since 1988. Started out on dbase 2. I'm just new to internet databases.

  15. #15
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Oh no doubt basic can get the job done, I just hate the syntax. Lisp wasn't too bad, just a totally different programming paradigm than, oh, just every other language in existence.

    Now to the point.

    In procedural programming, which is what you're used to, each function or subroutine is an operation you want done. You call a function, give it some parameters, and it does something, and may or may not give an output.

    An object is similar, but at a higher level. An object has properties and operations. You can set or work with those properties (either from outside or within the operations), and execute those operations, called "methods," just like functions.

    Those objects have relationships to one another, for instance you can have an object be a child of another object, or in C++, be a "friend" of another object. Objects can use other objects to do operations that they are not responsible for and that should be delegated to another object.

    For example:

    In C++:

    Code:
    user bob(1); // Get user #1
    string email = bob.email; // email property
    // Could also do:
    // string email = bob.get_email();
    if (bob.authenticate("Bob", "foo"))
    {
    // Bob's credentials are correct
    }
    In PHP:

    PHP Code:
    $bob = new User(1);
    $email $bob->email;
    // Could also do
    // $email = $bob->getEmail();
    if ($bob->authenticate('Bob''foo'))
    {
    // Bob's credentials are correct

    So basically it is a way of thinking about the various parts of your code or of your application, as objects instead of a set of operations.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  16. #16
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  17. #17
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by s1lentslayer
    Already linked to it above.

    On a sidenote, jim9:
    The benefit of object-oriented programming mostly is that responsibilities can be separated between different objects. Each object should generally only have one responsibility. So, it has the properties and operations in order to only take care of that responsibility, and do it well.

    it also has the concept of encapsolation. Data that only the object shoul know or care about is kept "private" or "protected", which means that outside code (outside of the object) can't know about that data.

    Also, there are many software design patterns that have object-orientation at their core, which allow for more flexible, maintainable code.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  18. #18
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Visual basic has methods, poperties and objects. Open recordset method for example. Now is this oop?

  19. #19
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's part of a class and has encapsolation, etc, then it is OOP. I don't have enough experience with Visual Basic to say either way, though.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  20. #20
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, you have to read this article, it cuts to the chase. http://www.odbms.org/introduction_rdbms2odbms.html. It seems that they are basically saying an OOP database in nothing more than a database with linked tables. Please read the article.

  21. #21
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  22. #22
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still use php4 on my web server (leased). However, I develop on my localhost with php5 -- but not yet implementing php5 specific code at this point.

    The only thing I may have to go back and revise on some sites is using $_POST rather than relying on globals as was the case with php4 .. I'm of course referring to sites I created 6+ years back.
    intragenesis, llc professional web & graphic design

  23. #23
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re:bubble sort

    Not to argue, but not seeing the code doesn't explain how the query interater works. Now, concerning the bubble sort. Doesn't the short code you show still have to go through the regular bubble sort routine or not? In the deep background, aren't parameters still passed to a function to return results? I believe the big confusion is the same things are being done, but we're calling it something different. Example: Right now add these numbers. 5 + 4 + 1.25 + 10. Did you get 20.25? Ok, I might use pencil and paper, write them down and add like in school. You might put them in an excel spreadsheet and hit the sum button. Adding on paper I carry over the 1. Ok, deep in excel or whatever, isn't the same exact thing happening? Maybe I don't understand passing parameters to a function verses a class or object. But one thing for sure, to do the bubble sort something in the background still has to be called to do it right? Example
    function multiply(a,b)
    multiply = a*b
    end function

    x=2
    y=3
    z=multiply(x,y)

    you get z = 6. Now how would this look in oop? I can reuse this til the sun novas.
    I can sent any pair of numbers to it. Of course here I typed quick, the real function would have (a as double, b as double). Basic used here $a in php ---- same difference.

  24. #24
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could program in Assembly also and get the job done as well. I could go even further back than that and send electronic pulses straight to memory and read the binary data. Modularity allows for better reuse of code, more flexibility, as well as maintainability. For simple systems, you're right, OOP is probably not needed. But for complex systems, OOP has the benefits mentioned above.

  25. #25
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well put, s1lentslayer. Another positive, is that once you learn the OOP concepts, when you want to jump to Java (not JS) or C++, the transition is a lot faster. However, if I just need a 3 line script to do something that chances are I'll only use once, I'm not going to build a class library for it. lol
    intragenesis, llc professional web & graphic design


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •