Page 3 of 3 FirstFirst 123
Results 51 to 69 of 69
  1. #51
    Join Date
    Oct 2002
    Posts
    227
    Originally posted by Rotwang
    More younger developers are learning PHP than java.
    Maybe in their parent's basements they are. At universities Java is still king.

  2. #52
    Join Date
    Aug 2005
    Posts
    438
    Yeah I find it odd that when talking about learning how to program on WHT you rarely hear people say "Start with java", yet this is what most of the major universities now do....and for good reason.

    Its hard for me to understand how someone could even code well if all they know is some sort of scripting language. Do these people have any notion of a data-structure, etc?

  3. #53
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    Originally posted by Froggy
    Yeah I find it odd that when talking about learning how to program on WHT you rarely hear people say "Start with java", yet this is what most of the major universities now do....and for good reason.

    Its hard for me to understand how someone could even code well if all they know is some sort of scripting language. Do these people have any notion of a data-structure, etc?
    Java is an absolutely terrible language to start with. It forces you to learn pretty much everything you're going to have to get good at over the next 4 years before you can even do something useful with the language. For someone with no idea what flow-control is, or how to cause commands to be executed in the order they need, forcing the entirity of the OO methodology upon them is absolutely stupid. The only reason universities teach Java first is because its what everyone else is doing. My school (a community college) recently switched to teaching Java in the first semester too (from C++). I spoke with all of the senior profs in CoSci, and every single one thinks it was a bad idea. The reason the dept. head made the decision was because the local universities are doing it. They didn't do any sort of research, pilot courses or anything...they didn't even listen to their senior teaching staff's opinions.

    There's nothing wrong with Java, and its definitely a language that anyone with a Comp Sci diploma/degree should know, but starting with it is a pretty bad idea because it doesn't allow you to learn only bits and pieces of what you need to know at a time. Consider both introductory Java courses that I've taken where students are asking 'whats this extends about' and similar questions with the prof going 'well, well get to that later in the course once you understand what an object is'. It's just silly. Teach functional abstraction and the basics of flow control with a language that makes it simple -- Python, C++, even Pascal. Then you can get into OO and things like access specification, polymorphism, inheritance and all the other things that you have to teach with it.

    One of my (and others) biggest complaints about Java is that its over-engineered in a lot of places. To do something simple you often have to instantiate a few objects that you never even manipulate (consider reading text from stdin, something first-year CoSci students will be doing a lot of -- it requires at least two objects and a static class member). Of course, the JVM is optimized for lots of quickly-discarded objects, but the fact that you have to instantiate them makes it overly complicated for a first language. You don't need an uber-strict strongly typed language to learn the methodology and how to apply it. IMO CoSci should be taught using a single language that allows any paradigm to be explored easily (such as Python or Ruby, which can easily be used for procedural, functional or object-oriented programming) with specific language features being explored later in the program.

  4. #54
    Join Date
    Aug 2005
    Posts
    438
    Suggesting they they use java because "everyone else is doing it" is a bit silly....certainly someone had to start? And why did they start?
    Please state what you'll be learning over 4 years that java forces?
    OO design? You're suppose to know about that after your freshman year, you don't spend your whole time getting a BS in CS learning about it. In fact once you are a junior you usually don't even touch java anymore.

    Community colleges have different goals and a different student base than universities, so your experience there says little about major universities. I say this in the nicest possible way...but the people that go to CCs tend not to be the brightest bunch . Rather basic things take much longer to teach there, then they do at universities. By this I don't mean that everyone at CC is an idiot, but rather the "average" is lower at them. It may be the case that CC classes should start with something else, but at universities? No. They use java so they can go into the important theoretical issues (data-structures, algorithm design etc) in the freshman year, its very hard to do that with C/C++ as you get bogged down in memory management etc.

    Using a language like Ruby or Python would be a horrible idea (and in fact isn't done...and will never be done). Now they may be useful to introduce people to very basic computing concepts (such as the ones you mentioned)..but they cannot be used for any sort of theoretical work. You can't teach a course in data-structures or algorithm design efficiently with languages like Ruby and Python. How many implements of say splay trees do you see writen in Python? ALthough you could do it...it would be very slow and hard to read/write.

    Additionaly you think C++ makes it simple? WHen you say this...this makes me think your experience with C++ has been extremely small.
    C++ is a more complicated language than Java, sure reading things from stardard in are a bit easier, but that is trivial stuff and that is where the 'simpleness' of the language ends. Try working with a large project in C++ and one in Java and then tell me which one 'makes it simple'. Also with the stdin issue, blame your teacher its rather trivial to write a class that makes it easy to read from stdin. In fact many intros to java have a small set of classes they use to deal with some of these issues, by the time the class is over they are able to understand these classes.

    Universities use to use C++ as the first language though, why they changed:

    1. You have to deal with memory management which takes a lot of time students could be spending learning about fundamental theoretical issues in CS.

    2. The tools for java are freely available for any platform.

    3. It forces (more so than C++) OO design.

    Usually universities teach C as part of a systems course that is a pre-req for a course in Operating systems. And some of the better ones will also teach a functional language like ML to show case things like inductive definitions, recursive functions etc.

    Anyhow, Which language you use for learning..depends on which concepts you want to show case, in the first 1-2 years of CS, this is things like data-structures which can be done very nicely in java.

  5. #55
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    I'm talking about the very basic concepts that you do learn in your freshman year. You're talking like everyone goes to university already knowing how to write simple code, while that's just patently false. A lot of people (mostly in the past though, post dot-bomb) go to university for CoSci with very little knowledge about the field they're going to be studying. And that's exactly the point. Starting with Java just overcomplicates those things. I never said that advanced courses should be taught in Python etc. (though implementing all sorts of trees is ridiculously simple compared to Java or C++ implementations -- a simple BST could probably be done in under 50 LOC). I just don't see the point in learning Java first; it just adds nothing of use in introductory computer science, while being heavily over complicated for such tasks. Consider Hello World:
    Code:
    print "Hello, world!"
    
    vs.
    
    #include <iostream>
    int main(int argc, char *argv[])
    {
       std::cout << "Hello, world!" << endl;
    }
    
    vs
    
    public class HelloWorld
    {
       public static void main(String[] args)
       {
          System.println("Hello, world!");
       }
    }
    It's not really about lines of code, but more about new concepts. The Python example contains nothing extraneous whatsoever. In the C++ example, the only non-trivial things are the std namespace (which can be avoided using the legacy standard library) and the pointer/array notation (which can be safely ommited in most compilers anyway; int main() will usually compile). In the Java example, there are two major OO concepts to deal with: access control and the idea of a 'class'. I just don't think students should be thrown into developing classes before they understand what a function is, and I don't think they should be writing functions before they understand flow control.

    Theoretical issues come after the basic skills are already there. It doesn't really matter what language you learn the basic first-year stuff in; once you understand the language constructs it is largely trivial to learn a new language. The point is that using a more flexible language lets the concepts being taught stand alone without being complicated by the language. The fact that Java forces OO is a bad thing because it leads to too many cases of people not having any idea what they're doing, and doing it only because it was the only way they could get their code to compile. It might even be correct, but they don't understand why it's correct. Why do you need a language to force something on you when you're learning? The whole point is that with feedback from the professor, students will learn to do the right thing on their own, not because the language forces them to. I don't really think it matters what language is used for introductory Comp Sci as long as it allows code to be written that can be fully explained without delving into more advanced topics. And Java fails far worse than most other popular languages in that respect. It may only be useful in a first-semester course, but I don't see why avoiding spending a couple lectures explaining Java syntax in a later course is worth sacrificing many weeks of student understanding in the first half (at least) of an introductory course.

    Your analysis of Python and Ruby is also flawed. Does performance matter one iota when learning data structures? How big is your test data likely to be? Maybe a couple thousand elements at most, and during development probably less than a hundred to ease debugging. Maybe your test suite will do a couple hundred operations. It doesn't really matter what language you use for this; it's going to easily be done in under a second. Do you count compile and JVM startup time when using Java, because that will likely make it significantly slower. And in fact, being recursive by definition, trees are implemented easily in Python due to its flexibility and ability to operate as a functional language. This is much closer to the theoretical ideal definition of a tree than a class with a bunch of reference passing. Other graphs can also be relatively easily implemented because of superiour list handling. Your arguments may be good for a production langauge, but I really don't see where you're coming from when the point is to understand the theoretical basis of things, where it seems to me a more flexible language allows a lot more to be 'showcased' in its simplest, most clear form. With that understanding, it shouldn't be hard for an intelligent person to box it into a Java (or whatever) class.

    I don't know what the situation is in the US, but here in Canada, colleges are generally a better choice for the first 2-years of a degree program where the program is block-transferrable later. It's cheaper, the classes are smaller and more practically-oriented, and the material is much more broad in scope. Attack my intelligence all you like, but out of two universities and two local colleges I was accepted at, I chose to attend college based on personal experience of several friends. The problem is that they're just slaves to the university programs. A Scheme course was dropped from both local university's programs recently, and within a semester was also dropped from the college. These sorts of things are disappointing, but actually having access to the professor, doing hands-on work in the hardware field, saving about $6,000 a year, and actually knowing most of my fellow students is well worth it. If I decide that I need specialized skills, I can transfer my diploma easily. We're talking about college and university students here too, not random WHT members that on a whim decide that learning a programming language will make their webpage do cool things.

    Java is a good, well-designed, popular language, but from a teaching standpoint I really don't think its a good choice for much beyond a strict OO or MVC course.

  6. #56
    Join Date
    Aug 2005
    Posts
    438
    1. At any good university you go into theoretical issues in the FIRST year. Furthermore, the people going to them generally have experience with comptuers before they go, this is particularly true for the top universities in CS. The sort of concepts you are talking about are TRIVIAL and don't take more than a couple of weeks to teach to an audience that isn't completely retarded.

    2. Real courses do NOT use kiddie examples that only take one second to process. The whole point of data-structures is the relative costs of using one over the other given a particular sort of data.
    You can't see this if you are using small data sets. When I took courses in data-structures we dealt with very large data sets, in fact the smallest one was ALL of shakespears works, for a project where we were required to make a shakespear generator. So, if a course in data-structures is using small and uninteresting data sets...then the course is going to be cheap and uninteresting. Anyhow...its about more than spend though.

    3. You have a clear bias... "I think students should be taught about functions first" why? Is there some study that shows that is a better way of teaching? Or is it just that you tend to think in terms of them? Why do you suppose the notion of a function is more simple and easier to undersatnd than a class?

    4. You talk about list handling being better? eerr? In what sense? But more importantly, who cares, a list is one particular data-structure the point of a course in data-structures is to learn others AND how to implement things like lists!. Using lists to implement other data-structurs is just silly.
    Also the structure of a tree is inductive not "functional", none of the languages being talked about allow you to in a natural way define a data-type inductively, that is the beautify of languages like ML. Python is not in any sense a functional programming language.

    Also languages like Python etc lack typing...which makes them as a first language very bad. I see the sort of stupid things people do when they don't understand typing, and under the hood python etc has to deal with types. Types are a fundamental notion, that are lacking in these languages. Now people that understand what typing is etc can program in perl etc just fine, but the ones that don't...its just bad. I forgot to mention this too...another reason why a language like java is used is that it allows talk of software engineering much easier. And these are things that you talk about from day one.

    Anyhow, the CCs in Canada don't sound much different than in the US. I don't think CCs are very good, but they have their function at least in the US, but that isn't the issue here. Regardless the point is...as the school you go to gets worse so does what you can expect from the average student. I'm open to the idea that doing python or something like that at CCs may be an affective way of teaching. I totally reject such a claim about universities...and pretty much every single major universities seems to agree. But again why? Because they have done research...they have stats that show that the students learn best with Java. If you think the top schools in CS are irrationally using java because "everyone else is doing it"...I don't know what to say.


    The choice of which language that should be used should be based on research not...what feels right to some particular person. For me I like *true* functional languages best, but that is because my background is in math/logic and it feels the most natural to me. But I realize this is due to my background one that most peopel in CS do not share.

    PS. I said nothing about your intelligence, I said something about CCs in general.

  7. #57
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    Writing in this little box makes me a bit incoherent. I will concede that Java is probably a good choice for a data structures course, but I don't really see the use of Python as a problem either. My point is that it makes more sense to me that the same language be used throughout the introductory portion of the program, to teach such fundamentals, and specialized languages be used later when their specialization is necessary (graphics, OS work, architecture & hardware courses, AI, etc.).

    Real courses use real-world examples, where the dataset is a function of the problem. While the final solution may have a runtime of 20 minutes and a massive dataset, you'd not develop and debug using the full dataset; in most cases a small subset of the data will work exactly as well. If your dataset is large, the time to completion matters less and less. If it mattered enough to influence the decision, you'd be advocating C++.

    As a method is a component of a class, it stands to reason that they should be understood first. There are more places to screw up, and more ambiguity as to what the correct course of action is. I will admit, though, that I am biased against Java. In the past few years it seems that it's being pushed into every possible market, with little thought to whether it's appropriate or not. It's good for a lot of things, but it's also very heavy.

    Convenient list handling just makes implementation of more advanced structures a lot simpler (an ordered set, not necessarily a linked list). For example, a binary tree node can easily be represented as a three-element list or tuple (with two three-element lists and a value - this is what you would do in Scheme, and while I don't know ML, I believe the constructs are similar), and manipulated as such very trivially, in comparison to creating an entire class and accessor methods just to encapsulate each node. Other graphs can be implemented in a similar fashion, though they'll probably need a container object. While the data itself is not recurisve, trees are accessed most intuitively in a recursive fashion. Many sorts can be more elegantly defined using Python's list handling features (mostly list comprehensions).

    I never claimed that Python is a functional language, however it provides significant portions (if not most) of the functionality of a functional language. Lambda functions are available (though crippled slightly) and can be nested, and higher-order functions are easily implemented (and can accept both normally-defined and lambda functions). List comprehensions allow functional list manipulation. Generators allow large datasets to be manipulated in a functional fashion without having the entire data in memory at once. These features are very powerful, and all of them are borrowed from functional languages like Haskell and Scheme. Tail recursion isn't optimized though, which does indeed greatly lessen its usefulness. Ruby also has many features borrowed from functional languages, but I don't know it very well so I won't elaborate here.

    Soft Eng is pretty language agnostic. I'm really unclear why Java is an advantage here.

    Python and etc. do not necessarily lack typing, though they may not be strictly typed. Python, for example, doesn't do any implicitly type massaging as languages like PHP do. For example, "5" * 5 evaluates to '55555'. Trying to use an object, such as a performing a string operation on an integer, in a context that it doesn't naturally work in will result in an exception. Further, one of my personal biggest annoyances about Java doesn't exist in either Python or Ruby: these languages are truly object oriented -- everything, including primitives and methods, is an object. Python supports multiple inheritance; Ruby has built-in support for singleton methods.

    The biggest advantage as I see it is that the two languages I've mentioned are both painfully predictable. If you think something will work, it probably will. The language rules are rarely, if ever, broken, and the built-in functions and libraries are very consistent. Java isn't as bad as PHP in that respect, but I believe it's worse than C++ (why do String objects get special handling that's not accessible to the programmer? why are primitives not objects? why can containers not contain primitives [related to the last one..]?, etc..).

    I don't necessarily think the top schools are being irrational -- they're the trendsetters, and they switched languages several years ago. I'm definitely with you on choosing Java over C++ (though I personally prefer C++, at least for data-structures work), or pretty much any of the other mature, accessible languages that would've been options at the time. Java was essentially the first successful designed-for-OO language, and I just don't think it's the technology leader when it comes to language features anymore. Would a study of Java vs. Python for the first couple years of Comp Sci choose Java? I don't really know, though I suspect not. I highly doubt, however, that any such studies have been done (a quick Google turned up nothing; I'd be interested to read anything like that).

  8. #58
    Join Date
    Aug 2005
    Posts
    438
    I would suggest using C++ if I was understand the mistaken impression that C++ was much faster than java in these issues. Java performance comes very close to C++ now, particularly for this sort of thing. Remember Java does hot compilation and has done so for a bit now. But doing things in like implementing data-structures in python is very slow, it just wasn't made to do things like that. Python has some data-structures that you can use that are fast, when you make your own they are painfully slow.

    Also, I say it again you just don't implement other data-structures using lists, there is no point, as you are then forced into the weakness of lists. I also don't get how lists in python are some how better than lists in java. Java has many different list implements....each with different weakness and strengths..what does python have? One...I'm not even sure what they did under the hood for it either.

    Regarding your points on java:
    1. I'm not even sure what you mean here about the String object. You are suppose to hide the details of the class from the user, that is the whole point. Also the String object in java is just another class you are free to make your own. Not really sure what "special handling" you're refering to is either.

    2. Yes that is a small problem that has been dealt with in java 1.5. This has never bugged me once though.

    3. Not sure what you mean here, why can containers not contain primitves? By container you mean? I don't think you mean a container in the sense of a GUI component...so then what?

    Also python isn't typed language, and as far as I know it doesn't allow you to use types at all...but again of course under the hood it is dealing with types. You have to remember "is this thing a string or int"...but this is what is so silly. Its obviously there so why isn't explicit in the language? And...types are fundamental to understanding how things like compilers work, another reason why you shouldn't use a typeless language. From my experience people that are good at languages like python are people that learned languages like java or C/C++ first.

  9. #59
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    Implementing data structures in Python is largely unnecessary for most real-world programming, but I don't see why you'd lose any extra performance because 'its not made for that sort of thing.' Neither is Java. Both are general-purpose languages; Java having a more advanced VM and more limitations makes it slightly faster, but I doubt for most data structures (where the majority of the work is moving references around) there would be a major difference. Python is slower because it has to do more runtime type resolving, overflow resolution and etc. Not slow enough to be a major issue, IMO. It's still more than fast enough for most tasks.

    In the context of Python, a list is basically a resizable array (a tuple is an immutable one). Java has several classes that implement arrays, and the built in strongly-typed array. With generics it provides typed array objects as well. It doesn't seem like you've spent much time actually working with advanced scripting languages like Python (mostly since you don't seem to really understand my points). Being able to access lists as a builtin in the language with simple and powerful access semantics is hugely simpler than calling object methods to do the same. It's also a lot more clear to write newlist = 1, 2, 3 than it is to write

    newlist = new ArrayList();
    newlist.add(new Integer(1));
    newlist.add(new Integer(2));
    newlist.add(new Integer(3));

    If you need a linked list structure, you can just do x = (1, (2,None)), and using the list operators easily shuffle things around.

    As lists are basically just arrays, they're used in all sorts of data structure implementations. I really don't know what you're talking about. Because the syntax is so accessible, it's often a lot easier to use a simple list to hold or pass around data, rather than encapsulating it in a class that serves no purpose other than storing data.

    The String object in Java has operator overloading that isn't accessible to the programmer. toString() is implicitly called, while adding this functionality for other types is not accessible to the programmer. The language shouldn't break it's own rules.

    Boxing of primitives is a pain, come on, you have to at least admit that. I'm glad they've finally done something about it, but it's still a bit of a hack. Autoboxing solves the major usability issue with Java's primitives, but it doesn't exactly fix the 'primitives arent actually objects' issue that violates OO priniciples.

    Containers in a general context, not a Java/Swing context. As in lists, arrays, hashtables, etc. etc. Objects that exist to contain other objects. Because primitives don't descend from Objects, you can't use polymorphism to implement generalized containers for them. You've got to do it using overloading of every primitive type, and then box the objects manually within your container class. Personally I'd rather not write an additional 100+ methods for every container I implement; and further, extend the built-in class library to do so, just so that the language can handle having an int and a String in the same data set. The alternative is manually boxing the primitives before you put them in, and then checking for and unboxing them as necessary when you take them out. Neither is a good solution. I understand why the decision to do this was made, but its just silly considering how fast computers are these days. It is definitely not beyond our means to have a fast, true OO language.

    Python isn't strongly typed, meaning that any variable can be assigned any data type. It's stronger than many languages as it doesn't implicitly cast objects like Perl or PHP. If you have a string, it stays a string. If you have an integer and try to append it to the string, you'll get an exception. The concept of types is very explitily there in the language. The concept of forcing a certain variable to only accept a certain type is not, however. Every object has a type though, that the programmer can determine, and can actually find out a lot more about the type than in Java (introspection and reflection is one of the biggest advantages of modern scripting languages). Which is better is as big a debate as emacs vs. vi, so I'm not going to go there. If you understand the limitations of each, you can easily write equally good code in both styles. It'd be interesting to see the same language with both strong and weakly typed objects.

    This argument is going nowhere.

  10. #60
    Join Date
    Aug 2005
    Posts
    438
    I agree implementing data structures in Python is largely not necessary, but why? Because you don't use Python for big projects that are going to require a lot of computation (you know things like automated theorem provers, compilers etc).
    My point about Python is that it wasn't writen in a way that would make writing new data-structures efficient, Java is done in a way where it is. This wasn't important for Python.

    I know what a list is in Python..what I don't know is how its implement under the hood. Your issues about the syntax...are your perference so I'm not going to say anything about them. You find that more natural...ok (I don't...). Instead of telling me what I do not know about you should actually state what it is..that you think I don't know. If what you're talking about here is the syntax and how you think its simpler...than that is a bit silly. You prefer a particular syntax, that I do not, this does not imply I do not know about "advanced scripting languages". If you were refering to something else please stated what it is.

    Lists are not basically arrays. An Array is a block of memory. A list is an abstract notion with various implementations some of which have nothing to do with Arrays.

    Ok you mean containers in that sense..and yes you can't directly add primitives to them. I find it sorta funny that this issues gets so much attention, when its rarely an issue. I've coded in java for many years...and its comes up so rarely that I actually forget about it. But yeah its an issue.

    Now your last paragrah..............it was just bad.

    Python is NOT typed.....the language does not support types. THe fact that the RUNTIME system deals with types does NOT imply that the language is typed. When you say a language is typed that means the language itself deals with types. In Python you get RUNTIME errors about typing, in languages with types you get COMPILE TIME errors about typing.

    If you think:

    introspection and reflection is one of the biggest advantages of modern scripting languages

    I don't know what to say to you....umm..you know that these things have existed in java for ages right? This was not something that started in scripting languages, it was something that was copied from other languages.
    Reflection is rarely necessary in java though which is maybe why you never noticed it..that is because its typed = ) Its used more in scripting languages because they aren't typed.

    Anyhow, my point is not that Python sucks..it has its uses...its that it shouldn't be used for education at the University level.

  11. #61
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    Vector, array and list are synonyms in computer science; it's an abstract type, and the implementation details are not implicated by which word is used. In the general sense, they are all ordered sets allowing duplicate elements. In C or Java there is a difference between an array (a language construct) and a list or vector (part of a library). Java is more effecient in terms of execution time, and I never said otherwise. It's also more cumbersome and time-consuming to implement most commonly-used data structures with it. Avoiding jumping through all of Java's hoops is a benefit when runtime really doesn't matter at all.

    You think my paragraph is bad, and then you claim that a fully-OO language doesn't support types? I'm sorry, but that's just silly. The notion of any language having no concept of types is silly, and the only example I can think of is Assembly - and even there, some primitive type handling is provided. Well I guess languages like Brain**** and Whitespace don't really have types either, but they're not exactly 'useful'. While the compiler doesn't enforce the type of every reference, it's type obviously affects what the object can and can't do, what data it contains and etc. Static typing vs. dynamic typing is an age-old argument with good arguments for both sides. Saying that dynamic typing equates to 'not supporting types' is stupid. Every object instance in any modern language has a type associated with it; whether type-checking is done at compile time, runtime or manually by the programmer is another issue entirey (and a whole 'nother kettle of fish). The way I see the issue with regards to Java is embodied in the existence of a static cast operation in the language. If static typing were the one true way, it would be possible to remove the static cast from the language. It's absolutely necessary for developing most projects, and thus shows that in many cases you have to use dynamic typing to develop software. Strict OO design takes you close, but not close enough. So, Java does runtime type checking as well. To do so, you have to create interfaces or objects to cast your references to at all sorts of levels of functionality depending on where you need to dereference them. Additionally complexity again...

    The Java language specification doesn't include anything whatsoever to do with introspection or reflection. If they were, they'd be accessed via Object methods, or language keywords. As it is, Java has good support for both introspection and reflection via the class library; and as most things Java, in a cumbersome and overly-complicated way. You're right though, using them in a statically typed language isn't really particularly useful - you'd have to cast the object to call any methods or whatnot you discover. It certainly makes writing modular systems trivial in comparison, though.

    I don't really see your point, though. Java is a heavy, complicated language. How that makes it better for education is beyond me. It's great for large projects with months of development time and a large development group, but all the features that make it good for those uses end up creating tons of extra work and complication for smaller, more clearly defined problems.

  12. #62
    Join Date
    Aug 2005
    Posts
    438
    Vector, array and list are not synonyms in computer science, not really sure why you said so. Ironically you on to say that they are different in C/Java. But yeah lists are an abstraction, I said that.

    Your paragraph is bad because its grossly incorrect. You seem not to get what a typed language is. Perl, Php and python are not typed languages, are you seriously suggesting otherwise? To be fair php 5 has added a bit of support for typing. I have said more than once that Python deals with types under the hood. But would you please note the difference between what the Language does and what the intrepreter for the languages is doing? The LANGUAGE does not support types...where as Java does. The whole point of typed languages is to bring typing INTO the language so things like the compiler can deal with typing. All of what you are saying is about the Python interpreter not the language, I'm talking about the Language. I repeat Python...the language does not deal with types, it does not support typing at all. Also Java actually has weak typing not strong, this is one thing I dislike about java. Although java 1.5 offers stronger typing. Casting is only needed in java because it has weak typing, Casting is used much less in java 1.5 In strongly typed languages like ML you never need to cast anything.

    Again you're just wrong here about java and reflection. Furthermore its pathetically easy to in java. I've never done reflection in Python so maybe python does it better...but I know its no easier to do in php than in Java.
    I can say though I've used reflection in java once, its generally only needed if you're doing things like serialization and making IDEs etc.

    I've already given many reasons why Java is a good language to learn at first. And ok its beyond you...but maybe you should think why all the top schools in CS are using it..maybe they are on to something you aren't privy too?

    Lastly, I agree that using languages like Python make sense for various tasks, those tasks aren't the sort of things you are doing when getting a degree in CS. If I had many gigs of files I had to search through for various info...I would no doubt use Perl to do it...because it would take me less time. But this isn't the sort of stuff they are teaching you to do as a CS student..they are teaching you theory.

  13. #63
    Join Date
    Mar 2004
    Location
    New Zealand
    Posts
    532
    Originally posted by Froggy
    Perl, Php and python are not typed languages
    In PHP
    Code:
    (int) "0" !== "0"
    . PHP is dynamically typed, but has support for casting between the internal types. In no way is PHP "not typed".

    I've already given many reasons why Java is a good language to learn at first. And ok its beyond you...but maybe you should think why all the top schools in CS are using it..maybe they are on to something you aren't privy too?
    I have a degree in CS, all I can say is that Modula-II, HUGS, C, C++, SmallTalk, Simula, Scheme, Prolog, PASCAL, CCS, RISC Assembly, and a myriad of other languages served me just fine, and that the students who came along after me that I tutored had much more trouble getting started when Java was introduced to first years. There is much to be said for K.I.S.S.

  14. #64
    Join Date
    Aug 2005
    Posts
    438
    "Php is dynamically typed, but has support for casting between the INTERNAL types", in other words the language itself is not typed. What happens in the zend engine is independent of the language in itself. I am talking about the languages in themselves, but when you say "Language X is typed" it is only meant to refer to the language.

    But in my post I did say that php 5 has added some optional typing in the language. Its still far from being a typed language.

    Also thats great that those languages served you well, but tons of research shows that Java serves students as a first language well, and this is why they use it. Also the students may have more trouble getting started, I don't know....I'd have to see a study on it. But regardless this doesn't say much about it not being useful as a first language. Ok so it may take an extra 2-3 weeks to introduce...but so what?

  15. #65
    Originally posted by gogocode


    I have a degree in CS, all I can say is that Modula-II, HUGS, C, C++, SmallTalk, Simula, Scheme, Prolog, PASCAL, CCS, RISC Assembly, and a myriad of other languages served me just fine, and that the students who came along after me that I tutored had much more trouble getting started when Java was introduced to first years. There is much to be said for K.I.S.S. [/B]
    I noticed that all of the beginning (and some advanced) programming classes at my college are taught in java also. I have a minor in CS and I used java to learn about data structures and the other concepts that were taught to me. I have not learned php yet (in the middle of it) and I find that java's strict syntax guidelines help me out in any language I've learned or am trying to learn. But reading the posts, I'd say php is a good language, but java does have its purposes (and seems widely used).

  16. #66
    Join Date
    Mar 2004
    Location
    New Zealand
    Posts
    532
    Originally posted by Froggy
    "Php is dynamically typed, but has support for casting between the INTERNAL types", in other words the language itself is not typed. What happens in the zend engine is independent of the language in itself. I am talking about the languages in themselves, but when you say "Language X is typed" it is only meant to refer to the language.
    you miss the point, my point is that the language, and engine, in PHP are dynamically typed. They are not typeless, either of them.

    In PHP

    $a = "1"
    $b = 1
    and
    $a !== $b

    in a language devoid of type, this would be incorrect, 1 and "1" represent the same data so they would be the same type. In PHP, 1 is an int, and "1" is a string. The language will dynamically cast type for you if required, or you can specifically tell it to cast, or not to cast as the case may be.

    But this is all realy, really off topic now.

  17. #67
    I just want to say, I HATE it when people use that string casting example in any discussion about typed languages. Every article and usenet post I see about strong-typing vs weak-typing uses that lame string to int example. How about an example using a object type? How about casting one class to another?

    Basically what happened here is this: Froggy said perl and php are "not typed", and that's is mostly, 90%, true. So you jumped on the nit-picky details that are irrelevant to the greater argument here. You're exploiting his hyperbole.

    So yea, yea, php has some weak-typing, fine. It's definately not strong-typed. Is everybody back on track now?

    So how about this: When java CS students leave college and make their personal homepages with their resumes and weblogs on them, are they going to write them in java? I'll bet a burrito they'll learn php instead. Because their hosting provided won't hava java installed on their server. Or they'll charge more for it. This is the quiet victory for PHP's ubiquity. And from there, every personal project they build will be a PHP project. And then those personal projects turn into businesses, and they've written php codebases, and meanwhile php is becoming more enterprise-able, etc, etc, etc. The java community doesn't get this, hasn't for the past 5 years.

  18. #68
    Join Date
    Aug 2005
    Posts
    438
    gogo and you miss my point, I'm not talking about the engine I'm talking about the language and only the language. The language is not typed, although php 5 has added a bit of typing, but its totally optional. I know perfectly well that php deals with types under the hood in the engine, but that isn't the point. THe point again is that the language does not deal with them.

    And my point in general is languages with types are much better to learn in, and they make using languages like php much easier. Once you know about typing using a language like php that for the most part lacks them, is not hard at all.


    To the thing about the java community, I don't know..at least from the two schools I"ve been to php didn't seem to be popoular, they would do things in perl or python, both of which are still widely available on hosts. But I only know about the places I've been to.

  19. #69
    Originally posted by gogocode

    There are many many editors. You just havn't looked.
    Do you know any php editor with refactoring? (I would really like to find one)
    Style checking?! How is this even relevant to wether PHP is a good language or not. Aycarumba, so you havn't seen an editor that will slap your hands if you try and write poorly styled code, yep, PHP must be a crappy language then.
    I think he meant syntax checking, while there are a lot of php editors with syntax coloring I know few of them with "on the fly" syntax checking. Also navigation might be improved - I would like to press come keyboard on the function (Ctrl+B for example) and go automatically to its definition, same thing with classes and variables.
    Also I would like to easily find usage of some function, and only that function, not all the strings which have its name as substring.
    Until then I'm more productive in Java, although in some cases I will have to write more code, but this code is much more manageable than php code.
    All generalizations are false, including this one.

Page 3 of 3 FirstFirst 123

Posting Permissions

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