#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    28
    Rep Power
    0

    Intro/SE to CS with PHP


    Dears,
    I'm looking for a good online course or ebook on introduction to computer science with PHP and software engineering explained by PHP code/examples. I'v found Java and Python, but I'm really looking for PHP cauz I have a basic experience and understanding of PHP.

    Thx a lot n advance,
    Ch.
  2. #2
  3. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    400
    Rep Power
    311
    you probably wont find (a good version of) what you are after.

    CS / SE uses things like java and python as they are better for it.

    PHP has a lot of, let's say "quirks" about it, for example variable scope seems to have no meaning at all. I could declare a variable in an if statement and then happily reference it outside of that and it return the value it has stored. Variables are not type safe either by default etc etc...

    When you learn languages like python and java and C++ etc etc you learn all the 'proper' ways of doing things, so you wont pick up the bad habits php inadvertently teaches you.

    To me learning software engineering is more about learning logic. Once you know one language, you can easily transfer that knowledge to other languages. For example my main areas of knowledge are C# and PHP. I've needed to write some perl and python scripts lately, which I have never used before. I know exactly how I would write this script in C# (or php), so I have the logic down, just need to do a little googling to get my head around the syntax and i can write it.

    So what I am saying is just because you do your CS thing with python or java and not php, don't think that it's not going to help you with your php later. It will, but you will also learn about a lot of stuff that you wouldn't learn if you just learned php.
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,921
    Rep Power
    1045
    Hi,

    I disagree with sir_drinxalot's claims that PHP is somehow inherently broken or unsuited for scientific applications. Actually, the "PHP quirks" he mentioned (no block scope, no perfect type safety) also apply to Python and Java respectively and many other languages

    I'm far from being a PHP fan, but the often heard statement that "Python is good for scientific applications" while other languages are not sounds like plain marketing to me. The only reason why this might be the case is because the Python community is more active in developing scientific libraries.

    The problem is that PHP simply isn't taken seriously. Many people still view it as a template language for amateurs tinkering with their home pages (which does have some truth to it). So when you want to do computer science with PHP you'll probably get the same reaction as if you say "I want to do astronomy with my Playstation!".

    So you will have to learn new languages. But isn't that exactly the point of science? Exploring different approaches? Don't stick to PHP just because it's the only language you know. Try out other languages. Try a purely object oriented language like Smalltalk or Ruby, try a functional language like Haskell or the good old Lisp. Don't just stick to the standard stuff you already know.
  6. #4
  7. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    400
    Rep Power
    311
    I think you misunderstood me a little Jacques1. I wasn't saying that php is broken etc, I was just saying in my opinion it lets you be more sloppy than other languages. That may not be a problem for OP if they want to learn php, and not software engineering (in a broader, language agnostic sense).

    I agree that php doesn't have a "beard and suspenders" image, more of a "oh look that kid is making a website" feel. I am a fairly big fan of PHP, however I also think that there are a number of languages out there which can achieve the same result. It all depends on what your needs are.

    Originally Posted by Jacques1
    So you will have to learn new languages. But isn't that exactly the point of science? Exploring different approaches? Don't stick to PHP just because it's the only language you know. Try out other languages. Try a purely object oriented language like Smalltalk or Ruby, try a functional language like Haskell or the good old Lisp. Don't just stick to the standard stuff you already know.
    I agree, and that is a much much more eloquent way of saying some of what I was trying to say.
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    28
    Rep Power
    0
    OS multithreading

    Many current language specifications, such as as for C and C++, are inadequate for multithreaded programs. This can have an impact on compilers and the correctness of code, as this problem illustrates. Consider the following declarations and function definition:
    Code:
    int global_positives= 0;
    typedef struct list {
      struct list *next;
      double val;
    }*list;
    
    void count_positives (list l)
    {
      list p;
      for (p = 1; p; p = p -> next)
       if (p -> val > 0.0)
         ++global_positives;
    }
    Now consider the case in which thread A performs
    Code:
    count_positives (<list containing only negative values>);
    while thread B performs
    Code:
    ++global_positives;
    a. What does the function do?
    b. The C language only addresses single-threaded execution. Does the use of two parallel threads create any problems or potential problems?

    Fruitful methods
    Code that appears after a return statement, or any place else where it can never be executed, is called dead code. Some compilers warn you if part of your code is dead.

    If you put return statements inside a conditional, then you have to guarantee that every possible path through the program hits a return statement. For example:
    Code:
    public static double absoluteValue(double x) {
    if (x < 0) {
    return -x;
    } else if (x > 0) {
    return x;
    } // WRONG!!
    }
    This program is not legal because if x is 0, neither condition is true and the method ends without hitting a return statement. A typical compiler message would be \return statement required in absoluteValue," which is a confusing message since there are already two of them.


    These 2 examples are coming from Intro to CS with Java (think Java) and intro to operating systems. I have other examples from intro to networking with C and SE with java.

    So, you guys are sure and you are saying there's noo way to learn these things using PHP __AT All!?! Very sad
  10. #6
  11. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,921
    Rep Power
    1045
    @chofift:

    Originally Posted by chofift
    So, you guys are sure and you are saying there's noo way to learn these things using PHP __AT All!?! Very sad
    Like we already tried to say: You have to use any language which is in the curriculum, and that's likely not PHP. The first part, for example, wouldn't even work with PHP, because PHP doesn't support multithreading.

    But again: I don't understand why you're so desparately holding on to your beloved PHP. When you do computer science, you're expected to switch between different languages, depending on which fits the problem best. If you're not willing to do that, then computer science might not be the right thing for you.



    @sir_drinxalot:

    Originally Posted by sir_drinxalot
    I wasn't saying that php is broken etc, I was just saying in my opinion it lets you be more sloppy than other languages.
    PHP is indeed rather sloppy, but the two things you mentioned also apply to Java and Python (which are considered to be "good languages" for science), so I didn't see how this proves your point. Python also has dynamic typing and no block scope, and Java also has weak typing.

    I mean, for very special applications there might very well be certain limititations within PHP which make it unsuitable for a task (the missing support for multithreading, for example). But I don't think you can generally say that one language is "good for science" and another one isn't.

    But I'm no scientist, so I might be totally wrong on this.
  12. #7
  13. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    400
    Rep Power
    311
    that's not exactly what i'm saying, although Java and PHP are not 1 in the same. There will be things that you are taught for Java which PHP simply cannot do.

    PHP is aimed at the web. Java is designed to be a robust language for pretty much any platform. Their intended purposes are completely different which means that their functionality is different.

    I personally think that you are going about this the wrong way. Do you want to learn "software engineering" or do you want to learn PHP?

    If you want to learn php, then find a good tutorial or course that will teach you PHP. If you want to learn software engineering, then do it as per whatever course material you have. You run the risk of making it way harder on yourself if you are reading a course based on Java and trying to make that work in PHP. Some of the examples in Java will pretty easily translate to PHP, others will be harder, and some may not translate to php without some serious effort.

    Again, that's just my 2 cents.
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?
  14. #8
  15. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    400
    Rep Power
    311
    Originally Posted by Jacques1
    But I don't think you can generally say that one language is "good for science" and another one isn't.

    But I'm no scientist, so I might be totally wrong on this.
    I disagree with that a little. I'm not saying that you can't use language A for science, you can only use language B. What I am saying is more of a "different strokes" kind of thing. Some languages are more geared towards certain things than others.

    Typically when you think PHP you think dynamic web applications. When you think Java you think multi platform etc.

    Also, just to clarify, I'm not saying PHP is a bad choice, more trying to say that it is not always the best choice. Again, depends on the situation. Learning PHP from a Java based course is not the best situation...
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?

IMN logo majestic logo threadwatch logo seochat tools logo