SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 53
  1. #26
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,935
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's compiled at runtime. Compiled means the whole file is converted before being run. Interpreted means a line is read, converted, and run. Then the next line and so on and so forth.

  2. #27
    SitePoint Addict
    Join Date
    Aug 2007
    Location
    GR
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hammer65 View Post
    PHP is considered an interpreted scripting language.
    Last time I checked, yes.

  3. #28
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    without the bad stuff (manual memory management).
    Exactly the point I made earlier

  4. #29
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ihtesham, if you don't quit the personal bashing, I think you'll find your stay around here rather short. Because of your childish responses, I won't even respond to your poorly-made points.

    wwb_99, yeah C# or Java would make good starting points as well. I think just about any strongly typed language is excellent to start off with.

    To those who have said it doesn't matter because PHP is dynamically typed and thus typing doesn't matter: PHP still has typing, it is just dynamic, and arguably more dangerous than strongly typed languages. If you mess up data typing in a strongly typed language, the compiler will complain and you know you've made a mistake. It is good to learn about these data types before diving into PHP, where you can treat any variable as any type, and generally not have any complaint from the parser. The only sign there is sometimes that you have made a mistake with typing is when there is a very hard-to-track bug in your script.

    Also, I believe PHP inherently promotes bad practices, because of how easily you can just embed PHP into HTML. At least with another language, you can learn good practices of programming, such as design patterns even, before learning PHP and figuring out how to apply them to that language. if you do this, then you will be less likely to make a mess of a PHP script and create spaghetti code, but instead have cleanly-separated logical layers.

  5. #30
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Regardless of that, what you are describing is the internal workings of PHP. This thread is about learning to code in PHP, not how to become a contributor to the PHP dev team.

    There is an important distinction to draw between how a C/C++ application is coded, deployed and ran as opposed to how a PHP/Ruby/Perl/etc. application is coded, deployed and ran (from a developer's standpoint). You end up confusing new coders that read this thread by trying to blur that distinction by citing the inner workings of the language parser.

    This is not something a new PHP coder needs to concern themselves with. Some people reading your comments are going to be under the impression that they will need to compile their project before deploying it. Fueling that misconception is deceptive, and not the point of this thread.

  6. #31
    SitePoint Addict
    Join Date
    Aug 2007
    Location
    GR
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Funny, this thread lives me questioning.
    I was taught programming. Started with Pascal then moved to C, after some years that had to get into the web thing I choosed PHP because of the similarity in syntax with C (because I would be comfortable in that), then I found out all the beauties of PHP. At work I write C#.
    Arguing for languages is like arguing what type of vehicle you will choose to go from point A to point B without knowing how to drive.
    Programming is thinking - not PHP not JS not C/C++ and as I always say languages are just tools, it's just a syntax matter after all.

  7. #32
    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)
    Quote Originally Posted by devbanana View Post
    Also, I believe PHP inherently promotes bad practices, because of how easily you can just embed PHP into HTML. At least with another language, you can learn good practices of programming, such as design patterns even, before learning PHP and figuring out how to apply them to that language. if you do this, then you will be less likely to make a mess of a PHP script and create spaghetti code, but instead have cleanly-separated logical layers.
    Top-down or bottom-up? For some (perhaps even most) people, I think it's more inspiring to start working with something, which is forgiving, and works right out of the box. Good practises can come later. On the flip side -- Having good practises enforced by the limitations of a given language may not make you appreciate why some things are better than others -- just that they are.

  8. #33
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,104
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    this thread is getting pathetic, someone asked and wants to learn php and there are people saying learn this, that and the other thing first.

    NO, Learn php and then learn the rest if you need to.

    I tried to learn perl back in the day and was totally confused and then php was released. There was not a lot of info but after downloading some php guestbook scripts (remember when you could not be serious on the web without one) and tweaking them I learned the basics like processing form submissions, once you have that down you can experiment with other aspects. for me php was 100(0) times easier than learning perl, I sort of doubt learning c or c++ would be easier than learning perl but I understand neither.

    I did not understand anything at php.net in the beginning and now I have a cot set up in their functions section.

    anyway try a tutorial, download a small script - dissect and modify them and run them on your server. you will be hooked sooner that you think.

    then coding will not leave your brain and don't blame me if you no longer have time for friends, family, loved ones or pets.

    Cheers and happy coding. dont let this thread discourage you
    Loren

  9. #34
    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 kyberfabrikken View Post
    Top-down or bottom-up? For some (perhaps even most) people, I think it's more inspiring to start working with something, which is forgiving, and works right out of the box. Good practises can come later. On the flip side -- Having good practises enforced by the limitations of a given language may not make you appreciate why some things are better than others -- just that they are.
    May be true, though unfortunately once people have something that works, they don't see the need to see how to do it better. If they're shown that they can just mix presentation and logic, it's rare that they will wonder if there is a better way. Even if the project gets bigger, they'll just do what they know and then it spirals out of control.

  10. #35
    SitePoint Addict SirAdrian's Avatar
    Join Date
    Jul 2005
    Location
    Kelowna, BC
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guys, remember he said this:
    Please describe in detail as I want to be a industry-ready professional.
    IMO, you will want to learn (or at least look into) other languages to see how they compare, because it will give you a better understanding of programming in general.

    You don't have to, though. Learn PHP, but also pay very careful attention to security, efficiency, design patterns, types, and the syntax. Those last two are very important for beginners. After a year or two, you will know every little thing that causes the parser to hiccup, and all the type casting rules / gotchas. Then you can focus on the real programming, which is where the other languages will come in handy.

    Don't go learn C, C++ and Java before digging into PHP. You are putting your original goal so far off, it's almost ridiculous. Learn PHP, but as I said earlier, you may want to look into those other languages to see how they compare. Heck, you might even want to switch away from PHP.

    The biggest factor to learning is just to go and do it. No matter which language you go with, or which paths you take, as long as you keep programming and trying to improve, you will. Be sure to check back here often and ask lots of questions (WHYs) and get advice with your code. Also look through the PHP.net functions - often. Try to learn the majority of the functions and read through the comments, as they'll often give you advice for alternative uses or better solutions.

    I personally use PHP Editor 2005 for basic coding, and then Eclipse PHP (actually TruStudio) for projects. Whichever you use, find an editor that allows you to run the script in the editor, then you can really tinker and learn quickly. Once you get into bigger projects you'll want an IDE that has built in debugging (with breakpoints, etc).

    Good luck!
    Adrian Schneider - Web Developer

  11. #36
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good and bad practices are relative to the type of environment you are deploying the application. The idea that good practices in C/C++ are the only ones that are appropriate is ridiculous. The web is not the desktop, they are two different environments. You have a client server relationship, using a client that has very specific requirements as to document format. This is NOT the same thing as GUI development in C/C++, Objective C, etc.

    A lot of large PHP, ASP, Ruby, Perl, etc. projects use templates and try to separate presentation from logic , but it is still the web. Smaller projects are structured as the individual developer requires.

    Quite frankly, I think using the words bad practices and proper and improper in such a broad context shows a bit of ego. If it's not horribly insecure, inefficient, unreadable or unmaintainable, there is nothing wrong with it.

  12. #37
    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 Hammer65 View Post
    Good and bad practices are relative to the type of environment you are deploying the application. The idea that good practices in C/C++ are the only ones that are appropriate is ridiculous. The web is not the desktop, they are two different environments. You have a client server relationship, using a client that has very specific requirements as to document format. This is NOT the same thing as GUI development in C/C++, Objective C, etc.
    Then if you want to focus on the web, try C# or Java. No one said it was limited to C or C++, just really any strongly typed language. C# would make a valid starting point for learning programming.

    Quote Originally Posted by Hammer65 View Post
    A lot of large PHP, ASP, Ruby, Perl, etc. projects use templates and try to separate presentation from logic , but it is still the web. Smaller projects are structured as the individual developer requires.

    Quite frankly, I think using the words bad practices and proper and improper in such a broad context shows a bit of ego. If it's not horribly insecure, inefficient, unreadable or unmaintainable, there is nothing wrong with it.
    Maybe for very, very small projects, it's fine to mix things together as you like (very difficult for me to say that ), but not in general. The fact is, most PHP developers never learn that it is bestto separate the logical layers, nor that there may even be better practices than mixing everything together. Generally such a setup is rather unmaintainable once it gets to any decent size. Unfortunately most PHP tutorials and books don't hint at any good practices.

  13. #38
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well most PHP books and articles still show using register globals, magic quotes and putting POST variables directly into SQL queries. We fight those issues every day here.

    I didn't say there wasn't room for best practices in PHP. If a coder wants to know what PHP best practices should be, they should use the PEAR or Zend coding guidelines, not some C/C++ book. Those projects have developed guidelines that are appropriate for PHP, given how PHP is used on the web.

    I'm a big proponent of OOP but within the OOP community there is sometimes an attitude, that if isn't done according to the religion, right down to the last detail, that it's wrong. I'm saying that's not so.

  14. #39
    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 Hammer65 View Post
    Well most PHP books and articles still show using register globals, magic quotes and putting POST variables directly into SQL queries. We fight those issues every day here.

    I didn't say there wasn't room for best practices in PHP. If a coder wants to know what PHP best practices should be, they should use the PEAR or Zend coding guidelines, not some C/C++ book. Those projects have developed guidelines that are appropriate for PHP, given how PHP is used on the web.

    I'm a big proponent of OOP but within the OOP community there is sometimes an attitude, that if isn't done according to the religion, right down to the last detail, that it's wrong. I'm saying that's not so.
    Of course best practices aren't carved in stone, nor have I ever hinted at that. I'm saying that too many PHP developers totally discard any attempts at even learning better practices. Starting with another language can often help to teach some of these practices before jumping into PHP. Most of such practices are not language-specific, thus what you learn in one language usually can be applied to any other language.

    For instance if I learn the observer pattern in C#, I can still apply it to PHP, even if it is coded differently.

    However, unfortunately there's a lack of information on such practices in PHP.

    I think that learning other languages including C, C++, and C# has greatly improved my skills in PHP development, and you learn some things that you just can't learn from PHP alone. You can further learn these things from different perspectives through seeing them in different languages.

    I just am speaking from my personal experience.

  15. #40
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and you learn some things that you just can't learn from PHP alone.
    Well for the benefit of new coders, by all means be specific.

    The features I know of, such as manual memory management, are of no use whatsoever to a web programmer.

    I don't know you, so I don't know how you work, but I work for a web development company. I do whole sites but I also do a contact form here, a RSS reader there, a modification to a CMS or CRM system here.

    My deadlines are measured in days or hours and I'm hip deep in other peoples code a lot of the time. I've seen a lot of ways to do things. Some of them good, some of them bad. Some of them are things that I never thought of, but make good sense and work very well in the context that they are used. I also can't say to a client we'll add it to the feature list, look for it in the next version, like a desktop developer can.

    If I'm doing a simple contact form, I have some re-usable classes that I use for those every time, but it makes absolutely no sense to deploy a full blown MVC framework for that sort of thing. Yet this is a large portion of what I do. Some of these sites are just HTML except for my additions. That's how the client wants it, that's how they get it.

  16. #41
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course for contact forms, etc, i.e., small scripts, it's fine just to throw it together, unless of course you want to be able to reuse the code later on. I've done that before myself. But I'm talking about larger sites beyond that.

    You keep saying you can't compare web and desktop apps, yet no one said you had to program in a desktop language. If you will never program that type of software, then try something like C#, which is still strongly typed, similar to Java and somewhat to C++, but yet can be used on the web as well.

    Regarding specifics, it's just different ways of looking at things, or new perspectives, that really can't be voiced; you just have to learn those other languages. Perhaps better ways of doing something, etc. I think anyone who has learned multiple languages will agree that it improves them as an overall programmer.

    Also, as mentioned, I think it's easier to start with a strongly typed language to learn about data types, type conversion, etc; issues you'll still have to deal with in PHP (though maybe not as much), or at least will have to think about to prevent bugs from coming up.

    Edit:

    Nevermind the offtopic, no longer an issue.

  17. #42
    SitePoint Enthusiast wyte raven's Avatar
    Join Date
    Feb 2007
    Location
    England, High Wycombe Bucks
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What a joke....talk about testosterone flying about the walls, shall we take this outside guys? ;-) lol

    The guy is beginning PHP.....why complicate things?

    I know every person is different at the way they learn, but come on......this is not a battle between which language is the best, or whats best to learn first...we aren't all children surely?


    Mate....I suggest you pick a solution that suits yourself best, only you know how you learn best.

    I was a beginner to PHP once, without ANY knowledge of any programming language at all......if I asked that simple question, and had it answered in this very funny way.....it would put me off programming full stop....talk about thousands of completely different angles to come at it from........I'd be thinking, "I thought this would be more simple than this....boy was I wrong!"

    Good luck to you, it sounds like your going to need it! lol
    Wyte R@ven - Creator of the Rift

  18. #43
    SitePoint Zealot
    Join Date
    May 2006
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    If you are a beginner to PHP, then I recommend downloading WAMP5. It gives you everything you'll need in a simple install.

    Then, to learn the language, go to W3schools' PHP tutorial (Free, of course) to learn the basics of PHP. Then, ask us here if you have any questions or problems, and we'll help you out.

    Before you know it, you'll know PHP inside-out.
    Thanks arkinstall.

  19. #44
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    To be honest, no other language is like PHP. Yes, C has it's similarities (because PHP is interpreted into C), but I think that if you want to learn C first, go back to the twentieth century. PHP is a programming language, and shouldn't be thought of as inferior to C.

    This is the way that I learned PHP. First, after HTML, I learned Javascript. Once knowing the basics of programming, I learned PHP. I did a google search, and went to the site i'd used for HTML, CSS and JavaScript: W3schools.com. After an excellent tutorial, I spent hours doing small projects, like a calculator and a simple database searching system.
    When I felt comfortable with the language, I felt like I should be learning more. The thing that excelled me the most in the language is here, sitepoint PHP forums. By people asking questions I hadn't even thought of, I searched google for the answer, answered the question, then I knew something else. That's why I get a kick out of answering people's questions, because either it's a chance for me to help someone like I was, or I learn something new. After all, knowledge is power.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  20. #45
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Programming is thinking - not PHP not JS not C/C++ and as I always say languages are just tools, it's just a syntax matter after all.
    Excellent point. If you want to be a programmer, you need common sense, logical thinking, problem solving and knowledge of your limits.

    I would say the definitions of an industry-ready proffesional are:
    • NOT reffering to a tutorial when a project comes along - write your own stuff people.
    • Collecting your written codes, so you can use the functions again.
    • Quick at solving an advanced problem.
    • Know what you can do with what you have. Knowing when to use Server-Side, when to use Client-Side, and when to use Server-Side to write Client-Side.
    • Using the available libraries - But also able to program without them when the time comes
    • Keep updating, using the newest PHP versions (the next one has big changes), and even the newest techniques (AJAX comes to mind)
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  21. #46
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice interesting thread ... yeah, I am also against personal attack, that's childish, and leaves a bad taste.

    Coming back to php, may be onething one might consider is the version of php one is going to learn. The web is still plenty of php4 tutorials (and there are still plenty of books teaching us php4) whereas it's getting more and more obsolete, php5 is pretty standard now and work on php6 is already going on. Also, support for php4 is going be stopped, as I read in the php site.

    Personally, I would suggest to avoid any book / website that's teaching php4 today and concentrate on php5, else, we will learn a language investing a lot of time that is not going to help us for long.

  22. #47
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wyte raven View Post
    What a joke....talk about testosterone flying about the walls, shall we take this outside guys? ;-) lol

    The guy is beginning PHP.....why complicate things?

    I know every person is different at the way they learn, but come on......this is not a battle between which language is the best, or whats best to learn first...we aren't all children surely?


    Mate....I suggest you pick a solution that suits yourself best, only you know how you learn best.

    I was a beginner to PHP once, without ANY knowledge of any programming language at all......if I asked that simple question, and had it answered in this very funny way.....it would put me off programming full stop....talk about thousands of completely different angles to come at it from........I'd be thinking, "I thought this would be more simple than this....boy was I wrong!"

    Good luck to you, it sounds like your going to need it! lol
    This is a discussion board and we have discussions here, some of them will get heated. This isn't a ***** length contest, at least most of us care about the issue,

    The trouble with telling people to only pick tutorials on PHP 5, is that a new coder isn't necessarily going to know the difference, if the book or article doesn't say "PHP 5". It's up to us as developers to guide new coders to the right resources and to chastize those publications that are still publishing incorrect, or downright dangerous information.

    PHP got it's reputation of being quick and easy to learn, because of how flexible and convenient it is, unfortunately, however good intentioned, some of the features that gave it that rep, turned out to be insecure or just a bad idea.

    So now we are working through it. PHP 5 has many of those features turned off by default, and PHP 6 will see most of them gone for good. Several languages (like Ruby and Python) have caught up to PHP, to an extent, but it's still an excellent language, and I think perfectly fine to learn as a starter.

    I just don't want to see new coders led astray and waste their time going through a "trial by fire" with a complex compiled language, just because someone thinks that the complexity will somehow magically make them a better coder. You know, like those developers that coded all those nifty buffer overflows and other bugs in so many popular C/C++ based application... oh wait...

  23. #48
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PHP was the first real programming language I learned. I got bored of it one day, so I went to C#. When I returned to PHP, I was better than ever.

    But that doesn't mean you should learn other languages first, it means when you think you've mastered PHP, move on, come back and fresh ideas will be in your head.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  24. #49
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With PHP, it's very easy to dive in; but it's also very easy to grasp bad practices. And it may be very hard for a novice to detect them.

    When you come from a statically typed language background, things like register_globals and magic_quotes will look inherently wrong from the start.

  25. #50
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the great posts they have helped me I am below average with PHP my main problem has been templates rather than any query, if anyone can help me with smarty and a template engine please PM me, willing to pay.


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
  •