
|
View Full Version : Java losing to php in terms of penetration.
Rotwang 05-21-2005, 09:10 PM I like java servlets better than php, felt that way for years. Strong typing wins. But I always choose to write my apps in php. Even apps I write for fun.
Am I right that if you pick java, you have drastically less isp's to choose from (or move to) to host your site? I could only find one web host that offered servlets for a shared account, lunarpages.com. There are probably others. Somewhere. The point is, if I log in to any non-ms web hosting account, I can bet you a pizza that I'll have php and perl right there at my fingertips. Is that a safe bet for servlets/jsp?
rgremill 05-21-2005, 11:21 PM Even Oracle (one of the biggest Java supporters) is looking into PHP. They recently teamed up with Zend on some projects.
Burhan 05-22-2005, 02:35 AM IBM has already announced an alliance with Zend to make sure PHP runs without hiccups on their iSeries platform.
About your question regarding servlets -- it depends on your host (obviously). The company I work for, we charge a fee per month to enable servlets on our UNIX/Linux servers. Most providers do not advertise this because they are specifically targetting the "will this script that I found at ____ for free work on your server" -- and 99% of the time, these are PHP/MySQL scripts.
Ryan F 05-22-2005, 05:16 AM Yes, many people are starting to think that Java is a sinking ship. A lot of hard-core Java programmers feel that Sun f'd up J2EE.
Tomcat/Java can be a pig and yes, most providers charge extra to deal with it. If you're going to run Java in any meaningful way you really should run your own server.
Burhan 05-22-2005, 09:49 AM If you're going to run Java in any meaningful way you really should run your own server....and avoid Tomcat (which is not the best thing for a production servlet container).
Rotwang 05-22-2005, 03:16 PM This is so sad. I really want a language that has strong typing. And that's peristant, you know, stays in memory between pages. Php isn't either. And I have a philosophy that if your language doesn't do strong typing then you shouldn't do OOP with it either. OOP without strong typing = silent bugs and instability.
They say programming languages are like religions, and I'm ripe to be converted. Perl doesn't do strong typing either. Python cares about my whitespace.
Hey will perl 6 do strong typing? What else is there?
lockbull 05-22-2005, 05:50 PM I certainly don't see Java losing any popularity; the Java world is as vibrant and varied as ever IMHO. My company (primarily a Java shop that develops apps for mostly mid-market & Fortune 2000 companies) certainly isn't suffering from a lack of new work; we've had to turn away several projects recently. As enterprises have started to migrate to the next set of buzzwords (Web Services, SOA, ESB, SOBA, whatever the next acronym Gartner comes up with), you'll see plenty of work for Java & .Net programmers, as PHP doesn't have much of a role in that arena. Java has a strong enterprise presence and I don't see that changing anytime soon. Java has certainly had some missteps (overblown, overarchitected EJB implementations being the prime example), but from my perspective it seems to be recovering from that. Java is moving towards a OPJO-based unified persistence mechanism, and the EJB 3.0 spec will fix a lot of the overhead and problems with using EJBs, especially when they were previously used to do something they really shouldn't have been used for to begin with. Aside from the wide variety of commercial offerings based around Java, we see (and use) a lot of cool open source technology coming to fruition and being used to solve real business problems, things like the Spring Framework, Hibernate, the Apache Jakarta projects, the ObjectWeb projects, etc. Go to sites like the ServerSide.com, JavaLobby.com, JavaRanch.com, etc.--there certainly doesn't seem to be a lack of good technical discussion and/or people complaining about not being able to find a good job in the field.
The question is if Java can get more penetration on the low end and make things easier for less advanced programmers to effectively utilize it. Sun is trying to mimic the simplicity and GUI appeal of Microsoft's Visual Studio with it's Java Studio Creator, but it still has a ways to go. For simple apps where thinks like granular persistence of objects, sophisticated DB pooling, extensive middleware libraries, etc. aren't of any concern, PHP is probably the better choice if you want to get something done quickly.
I think there are several reasons you don't see Java installed by default by most web hosting companies, starting with the fact there is very little demand for it at the shared hosting tier. Given it's more enterprise orientation and steeper learning curve, there aren't a lot of people looking to publish their casserole recipe database on their homepage using Java on a $10/month shared hosting account. I doubt Java will ever fill the role for those that just want some simple form processing or pulling a few things from a MySQL database; it's simply too much overhead and complexity for that. I think another reason is the licensing. Although the Java J2SE and J2EE libraries are free to download, there are certain licensing restrictions that preclude Java from being included with many of the open source *nix variants, including many of the most popular flavors used by web hosting companies. If Sun can work out the details on getting Java included with more of these distros, I think you'd see more people interested in "kicking the tires" so speak and looking at what Java is and what it can do. If Tomcat/Java can get bundled with popular distros the way Apache/PHP is, I think you'd see more hobbyist interest in Java and probably more demand for it to be included by hosting companies.
error404 05-22-2005, 06:10 PM Originally posted by Rotwang
This is so sad. I really want a language that has strong typing. And that's peristant, you know, stays in memory between pages. Php isn't either. And I have a philosophy that if your language doesn't do strong typing then you shouldn't do OOP with it either. OOP without strong typing = silent bugs and instability.
They say programming languages are like religions, and I'm ripe to be converted. Perl doesn't do strong typing either. Python cares about my whitespace.
Hey will perl 6 do strong typing? What else is there?
Strong typing is the way of the past. Why you're basing your language decision on such an inconsequential (and annoying, IMO) 'feature' of a language seems silly to me. You end up with weak (and slow late-binded) typing with Java anyways when you use Object references all over the place because there's no other way to create a sane container. The only thing strong about Java's typing is that the primitives aren't objects, which IMO should be true of any real OO language. If you really, really need to implement something similar, it's pretty trivial to use introspection in a setter to make sure the object is the right type before you assign it to a member.
Perl 6 will definitely not be strongly typed.
I think it's time you lost your bias, all the neat, very cool new languages are probably going to be loosely typed. The only ones with any popularity in the web field that aren't are C# and Java. Take a look at Python and Ruby, both are very excellent languages.
As for the OP's question...I don't really see Java losing popularity...yet. It seems to be maintaining it's ground, at least for now, but I get the feeling that Sun is fighting a losing battle at least with open-source proponents. It doesn't integrate well with other OSS technology, and in the opinion of many is not well suited to web development in the first place. Java carved out a niche for itself because it was the only viable solution that did what it could do at the time (cross platform, full OO, etc). PHP was (and still is) sorely lacking in OO features, and just in general feels like a disorganized mess. Perl is even more hodge-podge, and while being well-suited to quick one-off scripts, it's a clumsy language to use for large web projects. At the time, that left you with Java and Java alone. Today, however, there are a multitude of viable choices, and many of them are probably better than Java for the task at hand. Most, even large, web projects simply don't need the weight and development overhead of using Java. PHP5, Python, Ruby, even C# will cut development time significantly, while still offering the same advantages Java does. For that reason, combined with the fact that Java is a boat and administrator's nightmare, I think we'll see a pretty large decline in Java development on the web in the next five years. In other areas, I'm not so sure, but I think a move to C# is well under way.
Sun failed, IMO.
Yeah, try ASP.NET using C#..Very cool, and easy to use (I personally do not favor strong typing though :p).
Rotwang 05-22-2005, 09:34 PM Thanks, Emil, I should've mentioned that I'm in the anti-MS camp and wouldn't spend a minute even considering anything to do with MS. But given what I wrote your suggestion makes sense.
To lockbull, you're doing what so many java guys do, you're poo-pooing php as lightweight and trite and not serious. It used to be true, it certainly started that way. But now it's getting serious. As I was informed earlier in the thread, when Oracle and IBM are starting to cater to it, it's being used for more than cooking recipes. It just proves my point: The battlefield is the web hosting companies. PHP is absolutely not as good a language/architecture as java. But that's not what matters. Windows was absolutely not as good as MacOS, but that didn't matter either. Penetration wins, popularity wins. Propagation, ubiquity. Another example is redhat. They account for what- 70% of the linux web hosting market now? I can't even name a web host that's offering linux but not offering red hat. Some offer red hat *or* some other other flavors. Is red hat the best linux flavor? probably not.
You said "The question is if Java can get more penetration on the low end and make things easier for less advanced programmers to effectively utilize it. " But see, the problem with that is cases like me. I'm plenty advanced, I'd love to use java. I'm even running dedicated, not shared. I could even figure out how to install jboss in spite of the crappy documentation for how to hook it up to apache. But I'm not going to write (or move) my company's platform to a language with such poor penetration, I'd be nuts to do so. The fact that I'm advanced enough or that I'm running dedicated is irrelevant to the decision. (And I'm not doing casserole recipes!)
The acronym "LAMP" will be what crushes java, IMO. There ain't no J in "lamp".
And to error404, we're in different universes! Strong typing is "annoying"? Why, because it catches bugs in your code! And I could count on one hand the number of times I've written a java function that passes Object data types instead of some derivative. I think you're writing some loose java code there.
prices123 05-22-2005, 10:35 PM There are benefits for using Java over PHP.
1. The language syntax is stricter to prevent common mistakes which makes complex applications with a lot of code less error prone.
2. The JVM optimizes code at runtime for the specific system for better performance.
3. You can write multithreaded applications and caching techniques to boost performance and scalability.
This means Java applications tend to be more appropriate for larger and more complex applications.
error404 05-22-2005, 11:38 PM Taking it a bit too far, of course, I'm not a fan of Java by any means. Especially annoying are a) the lack of true object-orientation (there should be no notion of a 'primitive' in an OO language) and b) the fact that the built in classes break conventions you as a programmer are forced to follow. The hardcoded-ness of some of the stuff in Java irks me. For a couple examples, look at the handling of Strings and the fact that they're non-primitive, however have operators associated with them. And ugh, event handling in Java is uggglyyyyyy. C# is superiour in every way, and while it may be created by MS, it actually has an open-source runtime, unlike Java.
Strong typing is not something I really hate, I just don't really see it catching any bugs in a properly implemented loose language. If you pass the wrong object type, and then try to manipulate it, you're going to bomb with strong typing or without it. I find very, very few of my bugs have anything to do with type errors or passing the wrong object. Maybe it's just me, but I find I just get annoyed when I code Java, having to explicitly cast references back and forth all over the class tree even to do simple things. Whenever you use a J2SE container, you're casting your reference to Object (or to/from whatever interface you're using, anywhere), which you then have to re-cast when you take it out. Containers are even worse when you're trying to store a vector of integers or whatever, and with the only way to determine the type of an object at runtime being late binding, there is no better solution. Most of these are Java shortcomings, I really just latched on to your outright statement that loosely typed languages are evil(tm). I enjoying working in C++, but far moreso in Python. Python and Ruby are the only languages I've worked in where I don't find the language and it's requirements getting in my way of just writing working code.
There is a paradigm that's sort of middle-of-the-road on the typing issue. I can't even remember what language uses it, which is quite sad...but anyway, the idea is that the object's type is defined when the variable is first assigned a value. After assignment, the type of that particular reference can't be changed. I like the idea.
Of interest may be this interview with Bill Venners (a well-known Java advocate and developer) and Guido van Rossum (the creator and design of Python) on the topic: http://www.artima.com/intv/strongweak.html
lockbull 05-23-2005, 12:14 AM Rotwang,
I'm not trying to convince you of anything except that Java certainly doesn't seem to me to be "losing to PHP in terms of penetration". I guess I just don't see it that way. Go to a job board, say Dice, HotJobs, Monster, whatever. Type in Java, .Net, Ruby, PHP, Python, whatever you want. Look at the openings in each technology and then tell me that Java has a minimal presence in the web applications market. Check the TIOBE Index and notice how Java is pretty consistently ranked the number one most popular programming language over the last several years. There has been an explosion of quality open source projects in Java over the last few years, exceeding that in any other language. In the realm I compete in I almost never see PHP or Python or Ruby. It's pretty much Java, C++ or .Net. I'm not trying to trivialize PHP--the casserole comment wasn't to say that's all it can do, just that for certain low end things Java will probably never get used (though truth be told I do probably prefer Python or Ruby for that sort of application). PHP, Python & Ruby have all been around longer than Java, and Java has never been supported by many web hosting companies (though I would guess that's probably on the upswing, not the downswing). What evidence do you have that LAMP is somehow "crushing" Java now? The Apache foundation's Jakarta group is one of the largest contributors of open source Java projects; they already have a full blown J2EE application server called Geronimo under development, and just last week they anounced they are doing an open source JVM called Harmony. RedHat already includes Java and the JONAS J2EE server with their Enterprise AS package. Certainly Java won't be viable forever, but I think that anyone who thinks that Java will somehow be a bit player in the web applications arena in the next 5 years is seriously out of touch with what is going on in the general (i.e. not just web hosting) market. If you believe all the technology prognosticators, we're at the start of an upgrade cycle where companies will be migrating their applications to more flexible service oriented architectures, and the technologies best equipped to fit those needs are Java and .Net. We actually tried doing a somewhat involved Web Services project with PHP not that long ago, and pretty much gave up because the libraries were so poor that we didn't feel comfortable rolling it out.
IBM and Oracle are supporting PHP for one reason--they want to migrate those customers to Java if they can. Here's a comment from Richard Rendell, senior director of product development at Oracle:
"Rendell said Oracle is supporting efforts to increase interoperability between PHP and the J2EE (Java 2 Enterprise Edition), and is in support of JSR (Java Specification Request) 223, which is looking to bridge the gap between scripting languages like PHP and the Java environment."
So yeah, both of them are saying we want you to run your PHP applications using DB2 or Oracle backends. But when you need to do more, we'll try to sell you on our Java application servers and Java infrastructure because we don't make money selling PHP, and by increasing interoperability we can more easily move you over to Java.
I'm sure Sun/IBM/BEA/Oracle/etc. see .Net as their main future competition, not scripting languages with (some might say misplaced) enterprise aspirations like PHP or Ruby or Python. Which isn't to say those aren't capable languages in their own right and that people don't (or shouldn't) use them. Java certainly isn't the end all be all--use whatever fits your needs. I personally think that Java will make more inroads into the middle and lower areas than something like PHP/Ruby/Python will make in the enterprise market, but that's just my (somewhat) informed opinion. The entry level web hosting market is not what I see as the battlefield--Java is certainly much more commonly taught in university level CS programs than PHP, Python or Ruby, and there are a lot of large companies that have a big stake in Java doing well. I've had several conversations with what I would call entry level programmers (which who have been in the biz a few years but who lack formal CS degrees), people who are bristling a bit at having to migrate from something like PHP4 to PHP5 or VB to VB.Net and basically having to learn an entirely new OO paradigm. I tell them those are both heavily influenced by Java and that they should just learn Java instead and get paid more :) And if you like the quick n' easy style of scripting languages, Java can accommodate you with things like Groovy, Jython, JRuby, BeanShell, Rhino, etc.
Rotwang 05-23-2005, 01:03 AM Originally posted by prices123
There are benefits for using Java over PHP.
1. The language syntax is stricter to prevent common mistakes which makes complex applications with a lot of code less error prone.
2. The JVM optimizes code at runtime for the specific system for better performance.
3. You can write multithreaded applications and caching techniques to boost performance and scalability.
This means Java applications tend to be more appropriate for larger and more complex applications.
I agree with all of that completely. Those are benefits of using java over php. (number 2 actually just got a lot better with the latest jvm update). Java is better than php. It's also losing to php.
Rotwang 05-23-2005, 01:20 AM error404, excellent url about the strong/weak python typing. I'm still reading it.
I've actually written some C#. I completely agree about the event handling (delegate as a keyword!). In fact, the syntax sugar in C# prompted sun to follow up, I think it was in the 1.5 release, they added all kinds of syntax stuff, typed arrays etc. C# is good stuff. Except that it's laced with darkness and evil and poison and an absurd license and I'd never use it ever. But still.
I'm still not with you about strong typing "If you pass the wrong object type, and then try to manipulate it, you're going to bomb with strong typing or without it.". No. I don't get it. If my function is declared to accept only XYZObject and I pass it ABCObject, it won't compile. That's the whole point of strong typing. Bug averted.
And my statement wasn't that loosely typed languages are evil, it was that loosley typed languages shouldn't do OOP. But close enough. Languages not doing oop is kind of evil in itself, so I'll go along.
I'd like to get into Python and Ruby were it not for the whitespace thing. All my geek friends are pushing python on me since they know I'm loosing my religion with php and java, I'm very convertable right now. You can lead a horse to water...
error404 05-23-2005, 02:05 AM Well, eventually that object you're passing into the function is going to be used somewhere, and when you call a nonexistant method or try to manipulate some data, you'll get a nice runtime error, full stack trace and state information, and probably a good idea of why you ran into the error in the first place. A compiler error doesn't help much; it tells you something is wrong, but rarely much beyond that at all. Knowing that I'm trying to pass the wrong object type into a function doesn't help me figure out where I'm casting an Object or interface reference to the wrong type or something similar. The call tree really does help a *lot* with bugs where you've got weird data floating around.
It's a lot more work in a lot of situations, and I just don't see that it's worth the marginal benefit. Quite a bit of code is dedicated just to massaging references and similar such things, especially in GUI programming, and I firmly believe that the more lines of code you have, the higher chance that there are bugs in it, regardless of language. If I can write a 200 line Python application that performs the same task as a 1000 line Java program, I suspect the Python version has a few less bugs that are much more difficult to track down; errors in the algorithms and whatnot. The Python code would be much easier to read, faster to code, and less-likely overall to have catastrophic bugs in it.
And why so averse to the whitespace thing? It's just one of those things you get used to, like C-style syntax. It actually ends up being less typing, and forces you to organize your code nicely (provided you use a proper editor). Hopefully you intent your control structures anyway? :P Ruby doesn't depend on whitespace either. It uses 'end' to signify the end of a control structure.
Rotwang 05-23-2005, 02:17 AM lockbull,
The TIOBE index (as well as the fact that there are lots of jobs for java techs) might indicate the success of the language overall. But if you're looking at the rankings and your only thinking web app penetration, you have to remember that PHP is a web-only language, pretty much. Every percent of PHP's score on the TIOBE index is measuring the penetration in the web applications sector. I mean, example: perl is up there pretty high too, but we both know perl has been on the decline for web app development for years. It's perl's other uses that are propping it up in the ranking. Well, or heck, C is the top of the list.
I have no evidence "that LAMP is somehow 'crushing' Java now". (And actually, I said "will crush java", not "is crushing". Hard to have evidence of the future, eh?) But the fact that open source is unifying into something which leaves java out ought to be a bad omen.
Really I think I'd be with you, my main gripe about what Sun (and you java guys) are thinking about java is your statement "for certain low end things Java will probably never get used". Why not? I don't understand how that thinking is a good strategy for Sun. I'm the guy on the sidelines watching the java tream freely giving this ground to other languages with little concern and without really even putting up a struggle to gain it. something like: "Oh that's just low-end stuff, they can have it".
Java more and more seems like an ivory tower language, used in the universities, by financial, by medical. While php and company are scrappy, down-to-earth and realistic, growing like a swarm. It's like the elites vs the masses. The elite language is better, no question. And beta was better than vhs... macos better than windows...
Anyway we'll remember this thread 5 years from now!
What do you mean by "penetration" and exactly how does that relate back to the language?
Obviously if you want to release an application, doing it in PHP/mySQL would benefit you the most because you can reach the widest audience with the product for the time spent on it..But other than that, if the application you are writing is in-house, or not intended for a wide release then choosing something like Java has its advantages (the "elite", enterprise features etc.).
One problem that I had with Java is all the names and technologies (servlets, containers, Java this, Java that, Java Debugger JDB, JDBC, J2EE, JavaBeans, JSP, Sun Java studio Enterprise)..Honestly, I just got sick of hearing J, Java, and Sun :eek:
Rotwang 05-23-2005, 06:20 PM Originally posted by error404
Well, eventually that object you're passing into the function is going to be used somewhere, and when you call a nonexistant method or try to manipulate some data, you'll get a nice runtime error, full stack trace and state information, and probably a good idea of why you ran into the error in the first place. A compiler error doesn't help much; it tells you something is wrong, but rarely much beyond that at all. Knowing that I'm trying to pass the wrong object type into a function doesn't help me figure out where I'm casting an Object or interface reference to the wrong type or something similar. The call tree really does help a *lot* with bugs where you've got weird data floating around.
You're arguing that run-time errors are easier for the programmer to debug.
I'm arguing that I'd rather my program throws a compile time error that's harder to debug than a runtime error that's easier to debug.
We agree on what we disagree about?
EDIT: here, top paragraph of this page: http://www.artima.com/intv/strongweak4.html
(and btw python can take my whitespace from my cold dead hands :look: )
lockbull 05-23-2005, 07:42 PM Rotwang,
As far as open source is concerned, I see a richness and variety in Java open source projects that I simply don't see in other languages. You have your choice of everything from multiple servlet containers, full blown J2EE application servers, frameworks, IDEs, code generators, middleware, etc. The constant bashing of Java by Eric Raymond and Richard Stallman doesn't seem to be slowing down the open source momentum behind it, and as I mentioned the Apache Foundation is working on an open source JVM so at that point they won't even have that issue. Open source technologies like Hibernate have made a significant impact in the persistence mechanism/OR mapping space, and that's being rewarded with it's author being asked to be on the JCP subcommittee to help draft the EJB 3.0 spec. I could list off dozens of quality open source technologies we've used in our projects.
With power comes complexity (and Java is simply inelegant in some ways, which I'm sure we can all agree on), and there's no doubt that Java has a ways to go to be as easy to use as some other environments. Try using either Sun Java Studio Creator or the NetBeans IDE; while I won't argue that they are quite as polished as something like VisualStudio, for the beginner you could certainly do a lot worse. And if all you want to do is quick n' easy scripting for simple apps, as I mentioned in a previous post Java can accommodate that as well. That approach isn't particularly popular, but it's certainly possible. If you like Ruby or Ruby on Rails, there's JRuby and Trails. Pretty much every framework in PHP is self-admittedly a copy of a Java framework. And I think that's part of Java's main problem--it has so much to offer, and so many different approaches to the same problems, that it's hard to get a handle on it. Just think of something like the data access tier. Within that space alone, I can either chose to use JDBC, OR mapping (which includes Hibernate, iBatis, SQLMaps, TopLink, JDO, FireStorm, to name just a few), EJB, some custom inhouse solution, and god knows what else. And it doesnt' help that Sun's blueprints previously included some of the worst ways to develop Java applications, which was pretty much to use EJB everywhere.
I totally agree with Emil...Java has WAY too many acronyms and terminology floating around, and it's certainly bewildering to a programmer just getting into Java. I suggest to those just getting involved to check something like Matt Raible's AppFuse (https://appfuse.dev.java.net/), which collects together some popular open source frameworks and tools and bundles them together as one JAR, along with some sample applications to work through. It's a nice intro to some of the concepts of J2EE and the tools that can make coding in Java significantly easier and more robust (Spring, Hibernate, Velocity, etc.).
I'm gonna stay out of the whole strong vs. loosely typed argument, except to say that there are several issues at play here, including semantics. The issue gets muddied when people confuse typing with binding and/or coupling. I really don't have a strong preference either way, except that as someone who routinely manages 10-20 developers working on a project, strong typing can be an advantage in keeping things in line and organized. In the so called "enterprise" world, I know there is some concern regarding the security implications of loosely typed languages, but I'm not fluent enough in that argument to really discuss it with any sort of depth.
Rotwang 05-23-2005, 08:07 PM First of all I don't know why your pushing IDE's on me. Have I spent any time talking about java being hard to use for the beginner? And by the way, I'm not a java beginner. But if you want to talk bout beginners, ok, sure,
The problem is not that java is hard to use and hard to learn. For the kind of stuff php does, the learning curve for jsp or the servlet api is comparable. The problem is it's hard to set up in a web hosting environment, (and here's the important part: ) and Sun apparently doesn't care, has spent no energy whatsoever in the past 5 years doing anything about the problem, except tangentially, indirectly, accidentally.
The reason Java is "hard to get a handle on" isn't because there's so many acronyms and "so much going on", nor the "complexity that comes with it's power". My whole point in two sentences: The reason you don't see a lot of beginners using java isn't that java is too hard to use nor that it's "too powerful" for what they need. The reason is that java is unavailable.
error404 05-23-2005, 09:38 PM Compared to PHP, Java is hard to use, though. Merely by forcing everything to be OO, it introduces an entire other layer to the learning curve. Instead of starting out by dropping a couple functions into your HTML here and there, you need to basically go from nothing to using full OO -- that's a steep curve. This is without a doubt a good thing for computer science people, and those that have a background in programming, but for amateurs it'll just turn them off the language. Even if Java were easy to set up and administer, I don't think we'd see any large-scale migration from PHP for low-end and amateur web development. It would definitely be nice for people trying to learn things though, to be able to 'graduate' to Java at some point, without shelling out the bucks for a VPS and learning how to administer a box (and go through the pain of trying to get an app server running properly).
Combined, these two issues are what's holding Java back among the majority of small-scale web projects. If we're going to venture into the enterprise market, Java has a strong foothold, if not a leading position at the moment. There are clearly lots of jobs, a large available class library, and lots of further development in the works. .NET has it's place too, thanks largely to C#'s superiourity and Microsoft's viral marketing. I just don't think there's the same third-party codebase out there, and it's certainly the new kid on the block compared to Java. Python and Ruby are getting lots of press, and at least Python developers are actually in pretty high demand. Yahoo and Google are both using Python pretty heavily, and I think it'll be gaining on the others due to developer loyalty and the ease with which it's used. Ruby -- well, Rails is just amazing, but I'm still not totally sure how it'll fare in an enterprise setting, I haven't really seen any large-scale uses of it yet. It's a very promising framework though, and I wouldn't be surprised to see it gain market quickly. PHP -- well, it's PHP, it'll hold onto it's share for a long time to come, and probably gain some on Java once PHP5 is embraced by more people.
Anyway, in short, I don't see anywhere for Java to go but down. And I don't mean that there'll be less Java code or less Java jobs (surely there will be more, the market is exploding again), but that their share of the market is only going to shrink. There are many technologies breaching the market right now that are clearly superiour, and given time to build a good free code repository comparable to Java's, I think one of them will probably emerge as the premier web technology in the next 5 years or so. Five years is a long time, an eternity in this business. Think; five years ago yesterday PHP4 was first released. Prior to that, PHP3 didn't have a significant marketshare of Perl/CGI. Look at the marketplace now; Perl/CGI is almost nonexistant and PHP4 has a large portion of it.
Something will unseat Java; it was the first real viable solution of it's kind, and it has it's problems. There are better solutions that are viable today, and I don't think the industry will be blind to that.
For strong typing you could choose a language of your choice and use CGI.
Rotwang 05-24-2005, 03:39 PM Can java run as a cgi?
Anyway, cgi is like insanely slow and non-scalable. But thanks anyway for the idea, I'm desperate.
Well, it's not insanely slow, those are just rumors mainly. I know you've heard a lot of rumors about CGI.. but the sad thing is I've seen a lot of test that show php is slow vs cgi.
Perl and PHP versions of CGI are a bit slower possibly, in comparison to the MOD_ versions...yes. CGI calls the interpreter and puts it into a process every time. But: A compiled Pascal or C or C++ application is extremely fast.
There are benchmarks which may show CGI as slightly slower, but many that show it's fast too.
For languages like Pascal and C++, cgi shows to be faster than PHP. Php has to call on about 12MB of libraries sometimes on each simple web request.. a cgi application might only be 300KB)
Also, Ebay still uses CGI and look how huge they are...They seem to also use other things too along with CGI.
For a strongly typed language, use Pascal or any language you can compile for CGI ;-) It's really flexible.. maybe not for Java, I'm not sure.. haven't looked into that.
Well, it depends what you have had experience with. If you only know Java for your strongly typed language you wish to use, then maybe CGI wouldn't work.
But the rumors you have heard about cgi being slow is just that, rumors. >mainly Perl cgi applications are slow because they put the entire Perl interpreter in the memory as a process, but then again I've seen benchmarks showing Perl cgi is fast to for larger applications.
That's because to some extent a separate process can have advantages. But php is forked really the same way a CGI application is.. it's not as if one php interpreter instance handles 200 users at once.
For scale-ability... I'm not sure.. what I'm experiencing right now is that my CGI applications in Pascal are scalable.. because every time I use PHP on a different server, someone always has different php.ini settings, you know? Magic quotes, and all sorts of other things.. that I really don't have control over some times.Whereas my CGI app works on any server that has CGI access, and I control my OWN ini files based on when I want to call them! Plus you can do remote CGI calls from different servers and many more things.
I like a strongly typed language myself.. it's really a matter of taste. I see advantages of dynamic and static and strongly typed languages, and I see disadvantages too. I prefer though, as a matter of taste, a strongly typed language which is readable, elegant, clear, precise.
There is also something called fastCGI, but I haven't even had time to look into that, because my plain CGI applications are fast enough.
Here's one benchmark, but I'm looking for more.
wrensoft.com/zoom/benchmarks.html#large1
ilyash 05-24-2005, 07:21 PM Java hosting is all over, you just have to look for it.
I have been with http://www.kgbinternet.com for a while now, and I must say, they are definetely worth it. [Note: not affiliated with them in any way, just a customer.]
Rotwang 05-24-2005, 09:06 PM No, PHP hosting is "all over". Java you "have to look for it". :buck:
Thanks for the recommendation.
nnormal 05-27-2005, 12:02 PM great debate here guys - very relevent!
(it does boggle that java writes web scripters as a non-target)
ubernostrum 05-29-2005, 04:52 AM My problem with Java as compared to other web-development platforms is that its development cycles tend to be unbearably slow. One can generally run through three or four full cycles in a Ruby or Python project (and probably two or three in PHP) in the time it takes to do one iteration in Java.
allaccess 05-29-2005, 03:44 PM you are comparing apples to oranges here. I dont think java serlets were made for public web sites anyway. I have seen some very robust java apps and i know many huge compaines that rely on these but still do all there websites in asp or php.
pnorilsk 05-29-2005, 09:23 PM With few exceptions this thread demonstrates ones again the complete ignorance and technical incompetence of many participants on this forum. I feel really bad for your clients and customers.
Now, about excessive coding in Java - as of few years, we (in Java space) prefer to generate code not to write it. Why, because we are mainly people with more than 10 years of programming experience and we are tired to write it. I repeat again, I will take your list of product descriptions and with XML file and one keystroke I will generate data base with all tables, code and after compilation - my application is ready. Try to do it in PHP.
About popularity - check dice.com. I tried, PHP keyword get 500+ entries, Java - 11000+. Just to put it in prospective.
Peter Kinev.
nnormal 05-31-2005, 10:37 AM I will take your list of product descriptions and with XML file and one keystroke I will generate data base with all tables, code and after compilation
what if the site reqs dont fit in to your magic xml template? and i certianly wouldnt want to hire someone whos motto is "we are tired". not to mention the fact that you missed the whole point of the argument :roll:
ubernostrum 05-31-2005, 10:40 AM Originally posted by pnorilsk
I repeat again, I will take your list of product descriptions and with XML file and one keystroke I will generate data base with all tables, code and after compilation - my application is ready.
Then why are there still programmers? If all you have to do is press a button and a magical Enterprise Java Application is completely and fully formed with no other interaction, there's no need for you; the manager can fire you, press the magic button himself, and take the profits as a bonus.
mikaelhg 05-31-2005, 02:42 PM Religion is for children. Unless you make your language choices on rational grounds, taking into account a sufficient amount of variables, it's useless to try to have a rational discussion about the alternatives.
Myself, I've found that it's best to prototype large applications with weakly typed scripting languages such as Ruby, Python or PHP and actually implement them in strongly typed general purpose languages, such as Java.
Currently, it's not responsible to recommend PHP or Python development in environments which require Oracle and LDAP integration, as the integration libraries provided are of extremely poor quality.
daveisme 07-29-2005, 07:38 PM Java and PHP are very different beasts.
Java ( and C# (asp) ) provides you with a strongly typed language with a ton of libraries to allow you to achieve just about anything no matter how complex or fast the application.
PHP is useful for fast development of websites that aren't too complex - but it does that very very well.
The downside with Java is that you have to know exactly what you're doing and need years of experience to be able to do it as fast as php.
The downside with PHP is you might find that your website is written as well as it could be in PHP but it still doesn't do everything you want to.
Java is inherently faster if you know Exactly what you're doing. However, there are far more people in this world that think they know what they're doing than ones that actually do - hence its reputation for being slow - you can also screw up far more spectacurly if you get it wrong (i.e take the server down).
gogocode 07-29-2005, 10:52 PM Originally posted by daveisme
PHP is useful for fast development of websites that aren't too complex
...
The downside with PHP is you might find that your website is written as well as it could be in PHP but it still doesn't do everything you want to.
FUD, complete and utter FUD. Tell me one thing that you could write for the end user to use in Java that you could not do in PHP.
I've never heard such a silly statement.
One possible problem with PHP is you can't reuse all your existing code that you use for offline development. Unless of course you do develop offline applications in PHP (I heard there are some php compilers/bindings out there)
The idea for me is: offline apps sometimes turn into online apps. I don't want to use PHP online, and then some other language for offline. I don't beleive in learning English, Japanese, German, French, and juggling them. I don't want to use Python on FreeBSD and then Perl on Linux. I want to use one language everywhere, if the language can handle it. Otherwise you just waste the time porting languageA code to languageB code, when you could have been doing something productive.
So if there are php compilers or php offline software development methods, good.. then it's just a matter of language preference and taste.
gogocode 07-30-2005, 06:16 AM Unless of course you do develop offline applications in PHP (I heard there are some php compilers/bindings out there)
You can, there are bindings for popular gui toolkits, and of course you can write command line apps just fine. It's not the right tool for the job. But you can if you want to. I would say that Python is a better choice there though. RIGHT TOOL FOR THE RIGHT JOB, you don't take a hammer and try to use it as a screwdriver.
This isn't the statement that "daveisme" made though, he said
The downside with PHP is you might find that your website is written as well as it could be in PHP but it still doesn't do everything you want to.
which is nothing to do with offline applications.
daveisme 07-30-2005, 11:15 AM Originally posted by gogocode
This isn't the statement that "daveisme" made though, he said
which is nothing to do with offline applications.
I had to think for a bit to remember where I'd hit a brick wall with PHP :rolleyes:
) I wanted a very large grid of data displayed in a webpage with an expandable outline and with sorting and dynamic filters.
) I wanted to build a very rich functionality on-line webpage editor for a community website.
) I found my php website which started out as just a few pages soon had a ton of pages and I needed to design it without it taking me a few weeks.
) I could not guarantee there were no bugs/breaks in the website.
) I wanted to create an Excel Spreadsheet on the fly for downloading.
) I wanted to create an online game but couldn't find a way to do 3d graphics.
) I wanted to track visitors paths through the site by storing the path in memory instead of waiting for a write to the damn database.
) I'm fed up waiting for the damn database to be accessed - why not just keep everything useful in memory.
) I wanted to do step through some code in a debugger that I didn't have to buy.
) I wanted to carry out Test Driven Development, but couldn't find any good php test frameworks.
I do believe that PHP is definitely the best and fastest solution for your average website. However it has limitations. I bet some expert PHP programmers do know good solutions to some of the above, but I doubt they're half as easy to do or well known as the alternatives in Java and ASP (c#.net).
I could go on forever, but most people will say you don't need that stuff in your average website, but I don't do 'average' websites.
Rotwang 07-30-2005, 02:49 PM Originally posted by z505
One possible problem with PHP is you can't reuse all your existing code that you use for offline development.
That is an excellent point.
Originally posted by z505
I want to use one language everywhere, if the language can handle it. Otherwise you just waste the time porting languageA code to languageB code, when you could have been doing something productive.
But wait, from that last paragraph, I think you're strengthening my point. The reason I use PHP (and advocate the use of PHP) instead of java, is because "I want to use one language everywhere, if the language can handle it. Otherwise you just waste the time porting languageA code to languageB code, when you could have been doing something productive."
When it comes to web apps, PHP is very clearly the language that's everywhere, and java very clearly isn't.
So far I've never had a web app turn into a desktop app. But if it started happening to me a lot, I could see the case for writing web apps in java instead of PHP.
Rotwang 07-30-2005, 03:09 PM Originally posted by daveisme
) I wanted a very large grid of data displayed in a webpage with an expandable outline and with sorting and dynamic filters.
) I wanted to build a very rich functionality on-line webpage editor for a community website.
Are you talking more about applets than servlets? I don't think anyone advocates using php to replace applets.
) I found my php website which started out as just a few pages soon had a ton of pages and I needed to design it without it taking me a few weeks.
I don't follow this. What was the php limitation here? I can redesign my sites in exactly 2 minutes after I think up the design and write the html template (once).
) I could not guarantee there were no bugs/breaks in the website.
If you have ever said, in your entire life, that you could "gurantee there were no bugs in the website", about any computer program that had more than just 1000 lines of code, then you are self-deluded and you should switch professions before you do any further damage. And if you respond to this by talking about unit testing, then I'd like to ask why you listed unit testing again later on your list? Just fattening the list?
) I wanted to create an Excel Spreadsheet on the fly for downloading.
) I wanted to create an online game but couldn't find a way to do 3d graphics.
) I wanted to track visitors paths through the site by storing the path in memory instead of waiting for a write to the damn database.
All good compaints. Java is definately better than php. Except that java is usually not installed. Hence the point of this thread.
) I'm fed up waiting for the damn database to be accessed - why not just keep everything useful in memory.
Actually you can do persistent mysql connections in php, I think. There's a seperate function call in the mysql php api if my memory serves me.
) I wanted to do step through some code in a debugger that I didn't have to buy.
Well, except that many/(most?) ISP's charge you extra to run java, or require a dedicated server.
) I wanted to carry out Test Driven Development, but couldn't find any good php test frameworks.
http://simpletest.sourceforge.net/
It even does Mock objects. (In fairness, you may have hit that wall in PHP a few years ago for all I know, before simpletest).
leefig 07-30-2005, 07:19 PM I basically think that it comes down to a combination of productivity and ease of use. J2EE web enabled applications take longer to develop than php/mysql. JSP pages have made a difference but developers find the entire J2EE concept difficult to learn.
gogocode 07-30-2005, 11:55 PM Originally posted by daveisme
) I wanted a very large grid of data displayed in a webpage with an expandable outline and with sorting and dynamic filters.
How exactly does PHP not allow you to do this. Unless you're talking about applets rather than servlets. Which is a completely different kettle of fish.
) I wanted to build a very rich functionality on-line webpage editor for a community website.
Huh? Again, how does PHP stop you doing this?
) I found my php website which started out as just a few pages soon had a ton of pages and I needed to design it without it taking me a few weeks.
Again, nothing to do with PHP - your problem there was BAD DESIGN. Jeez, just because you can program doesn't mean you can design an application.
) I could not guarantee there were no bugs/breaks in the website.
Oh yea, I forgot about the "no bugs guaranteed in the software you write" version of Java :rolleyes:
) I wanted to create an Excel Spreadsheet on the fly for downloading.
Again, how does PHP stop you from doing this?
) I wanted to create an online game but couldn't find a way to do 3d graphics.
Huh? I think you're confusing applets with servlets again. Or maybe you're talking about rendering 3d images on the fly - in which case pick any of the 3d libraries available and write bindings to php for it, should be an easy task if you pick a well designed 3d library. For isometric 3d there is already http://freshmeat.net/projects/imageisometric/
Ineither case neither JAVA nor PHP are the right language to be doign complex 3d graphic rendering, the VM will introduce too much CPU wastage, much better to get closer to the hardware in C - which by binding a C/C++ library to PHP is exactly what you do.
) I wanted to track visitors paths through the site by storing the path in memory instead of waiting for a write to the damn database.
Soo.. never heard of asynchronous inserts (INSERT DELAYED)?
) I'm fed up waiting for the damn database to be accessed - why not just keep everything useful in memory.
Umm, because memory is expensive and disk is cheap. Anyway, if you can afford to blow memory then you could always just use shared memory in PHP.
) I wanted to do step through some code in a debugger that I didn't have to buy.
I'll gve you that, there is no good debugger for PHP. Then again, debugging any web application can be tricky.
) I wanted to carry out Test Driven Development, but couldn't find any good php test frameworks.
http://www.google.co.nz/search?hs=WsO&hl=en&safe=off&c2coff=1&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&q=php+unit+testing&btnG=Search&meta=
or write your own to get exactly what you want.
You said:
The downside with PHP is you might find that your website is written as well as it could be in PHP but it still doesn't do everything you want to.
of the points you give above, of which the only one that remotely holds water is debugging, none of them provide any backing to that quote.
kuato 07-31-2005, 12:57 AM You are all crazy :eek: It's a hell of a lot easier developing java webapps today than it was five years ago. My first exposure to it was a nightmare back in '99. Think back when you had EJB2, no servlet filters, no JSTL, no Hibernate, no Spring, no Lucene, no Acegi and tons of classloading problems with the first generation app servers. Anyone remember what a nightmare it was configuring Apache JServ? Nowadays it's a no brainer to setup Tomcat and Resin and I can't wait to see Geronimo. If anything I see Java getting stronger over the next 5 years.
Java webapps have never been as easy as PHP and never will be but that certainly doesn't mean it will "get crushed" by LAMP as one person said.
I bet you in 5 years PHP and J2EE(or whatever the hell they end up renaming it) will be going as strong as ever.
xelhosting 07-31-2005, 01:28 AM Originally posted by z505
One possible problem with PHP is you can't reuse all your existing code that you use for offline development. Unless of course you do develop offline applications in PHP (I heard there are some php compilers/bindings out there)
you can run your php program on command line by "php code.php".
you can even make the php excutable by putting
#!/usr/bin/php
(if that's your php path) on the first line. Then excute it like shell or perl script.
You still have to use <? ?> for php code just like online.
So php is perfectly OK for offline development, just like perl and python.
daveisme 08-01-2005, 09:40 PM Oh good - A FIGHT :emlaugh:
Originally posted by gogocode
How exactly does PHP not allow you to do this. Unless you're talking about applets rather than servlets. Which is a completely different kettle of fish.
Well, I wanted a solution to displaying a very large grid of sortable, filterable data without the latency of roundtrips to the server. YOu can accomplish this easily using embedded .net web components or java swing controls, php cannot do this.
Huh? Again, how does PHP stop you doing this?
PHP makes it very awkward to develop rich functionality clients, see point above. The technology just doesn't support client side processing.
Again, nothing to do with PHP - your problem there was BAD DESIGN. Jeez, just because you can program doesn't mean you can design an application.
Have you never had an application which grew beyond the size it was designed to and had to refactor it? In PHP this is an absolute pig. Struts or JSF is a dream. Even JSP or ASP is better by comparison.
Oh yea, I forgot about the "no bugs guaranteed in the software you write" version of Java :rolleyes:
There are no good editors for PHP and certainly no good editor with integrated code style checking, refactoring and compile time checking not to mention integrated testing frameworks. It just takes too long to detect and sort out bugs in a complex php app even if it is well desinged.
Again, how does PHP stop you from doing this?
PHP has no libraries which support the microsoft ole format (including excel format, word etc..). Theres a dodgy COM bridge but thats a cop out.
Huh? I think you're confusing applets with servlets again. Or maybe you're talking about rendering 3d images on the fly - in which case pick any of the 3d libraries available and write bindings to php for it, should be an easy task if you pick a well designed 3d library. For isometric 3d there is already
And how would you get this working within the browser if you were using PHP? This is back to the first point about no client-side functionality.
Ineither case neither JAVA nor PHP are the right language to be doign complex 3d graphic rendering, the VM will introduce too much CPU wastage, much better to get closer to the hardware in C - which by binding a C/C++ library to PHP is exactly what you do.
Jeez, ever heard of native IO buffers in Java? You've probably even played some games written in Java. Normally graphics are dealt with by the GPU on your graphics card not the CPU, so why would Java on the CPU make the GPU slow?
Soo.. never heard of asynchronous inserts (INSERT DELAYED)?
Ok, you got me. I was having a dumb moment.
Umm, because memory is expensive and disk is cheap. Anyway, if you can afford to blow memory then you could always just use shared memory in PHP.
Since when is using shared memory natural or 'nice' in PHP? It's just not designed to do things that way. Where are the threading libraries???
I'll gve you that, there is no good debugger for PHP. Then again, debugging any web application can be tricky.
Rubbish. Absolute FUD. You just right click on the line you want your Java or .net program to stop on and set a break point. I don't normally even touch a line of code without a debugger stopped in the area I'm altering to let me see the state of all the variables and objects. PHP is completely deficient in this area - you have to run it and PRAY. maybe we should all go back to 20 year old ascii editors, like the ones for php, huh?
or write your own to get exactly what you want.
Write my own test framework solution? Are you mad? I expect a test framework built into my editor. And of course with Java or .net you've got them as standard, where is the one for PHP?
You said:
of the points you give above, of which the only one that remotely holds water is debugging, none of them provide any backing to that quote.
The debugging problem in particular is the biggest issue - not being able to alter code on the fly as its running and rewind etc.. it's like living in the dark ages. The lack of rich client side functionlity, the lack of a proper editor with code style checking, refactoring, compile time checking, debugging, or a test framework, the lack of proper shared memory or threading support, nothing like JSF or Winforms or Struts, and the complete lack of support for ms office documents are also kind of important if you're thinking of doing a serious web application, aren't they?
Of course, if you live in the PHP world you probably don't see these as a disadvantage because you wouldn't consider coding anything that would need these functionalities.
I bet there are some half baked libraries coming along to make a half arsed attempt at filling some of the holes, but like the 'tacked on' object support I wouldn't bet the farm on them.
PHP will still let you get your average website up and running faster than anything else, but thats about all its good for. As an analogy: I could climb a mountain with a toothpick instead of a pick axe, but that'd be daft.
Rotwang 08-01-2005, 11:11 PM It looks like you (conveniently) missed my post. I'm not saying that because you didn't respond, I'm saying that because of how you responded to gogocode.
In any case, I for one agree that java is better. And I'll continue to write PHP. PHP is installed and java usually isn't. More younger developers are learning PHP than java.
But since you're trying to glaze over your earlier mistakes, I'm going to refresh everyone's memory. Here is what you originally said in your earlier post:
) I could not guarantee there were no bugs/breaks in the website [ with PHP ]
Your subsequent glazing attempt:
There are no good editors for PHP and certainly no good editor with integrated code style checking, refactoring and compile time checking not to mention integrated testing frameworks. It just takes too long to detect and sort out bugs in a complex php app even if it is well desinged.
It's a poor attempt. Your new paragraph is not a categorization of the earlier statement. You plainly said "guarantee there were no bugs/breaks in the website". There's no ambiguity there.
You are someone who:
A) Writes serious web apps. (So serious that lowly php will not suffice.)
B) Made the absurd statement that you could (using your preferred language/IDE) "guarantee there were no bugs/breaks in the website", and that you couldn't do that with PHP.
C) Passed on the oportunity (your followup post) to revoke that absurd statement, after someone pointed it out. (Well, two of us pointed it out to you, actually, but clearly you didn't read my post, so I'll only charge you with the one offense.)
Are you going to stand by your absurdity for a third round when you respond to this? :rolleyes:
Finally I must point out that the fact that seeing A and B in the same human scares me. Or I guess it should scare your boss at least. And shareholders.
gilbert 08-01-2005, 11:45 PM i think phps so good cause it comes standard with apache
gogocode 08-02-2005, 01:40 AM Originally posted by daveisme
[B]
Well, I wanted a solution to displaying a very large grid of sortable, filterable data without the latency of roundtrips to the server. YOu can accomplish this easily using embedded .net web components or java swing controls, php cannot do this.
Sigh. Firstly, Swing implies you are talking about an APPLET. Repeat after me - "applets are not servlets". Secondly, never heard of XMLHTTPRequest? Or iframe piping if you want to get all old school.
PHP makes it very awkward to develop rich functionality clients, see point above. The technology just doesn't support client side processing.
Javascript + DOM + CSS + XMLHTTPRequest = all the client side goodness you want.
Have you never had an application which grew beyond the size it was designed to and had to refactor it? In PHP this is an absolute pig. Struts or JSF is a dream. Even JSP or ASP is better by comparison.
Design your architecture so that it is extensible in the first place.
There are no good editors for PHP
There are many many editors. You just havn't looked.
and certainly no good editor with integrated code style checking
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.
PHP has no libraries which support the microsoft ole format (including excel format, word etc..). Theres a dodgy COM bridge but thats a cop out.
Wrong tool for the job. Invoke a tool designed to do the non-web-related work you want, send the results. Job done.
And how would you get this working within the browser if you were using PHP? This is back to the first point about no client-side functionality.
And again, you're confusing applets and servlets. Repeat after me.. "Javascript (which is in no way relates to Java) is client side, PHP is server side".
Jeez, ever heard of native IO buffers in Java? You've probably even played some games written in Java. Normally graphics are dealt with by the GPU on your graphics card not the CPU, so why would Java on the CPU make the GPU slow?
And again, what are you on about. This is in no way relevant to the discussion. Why would you render in real time on the server and then transmit to the client, nice way to kill your server performance. Move the processing to the client via a browser plugin.
Since when is using shared memory natural or 'nice' in PHP? It's just not designed to do things that way. Where are the threading libraries???
PHP is not threaded. But you see, THIS IS WEB STUFF, it should be simple, take data from client, process it, return data to client. There isn't even any statefulness to worry about.
You just right click on the line you want your Java or .net program to stop on and set a break point. I don't normally even touch a line of code without a
Like I said, I'll give you that PHP does not have an adequate debugger API such that it could interface with either your editor or gdb etc.
I think most the problem in your understanding is that you are very likely writing APPLETS and in your bain you've got some whacked up reasoning like "huh, can't write applets in php, he he he, what a sux0r language, JAVA is teh l33t".
Ryan F 08-07-2005, 11:48 PM 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.
Froggy 08-08-2005, 12:28 AM 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?
error404 08-09-2005, 08:35 PM 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.
Froggy 08-09-2005, 09:17 PM 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.
error404 08-09-2005, 10:51 PM 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:
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.
Froggy 08-09-2005, 11:44 PM 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.
error404 08-10-2005, 04:17 AM 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).
Froggy 08-10-2005, 10:55 AM 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.
error404 08-10-2005, 04:00 PM 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.
Froggy 08-10-2005, 06:20 PM 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.
error404 08-10-2005, 08:02 PM 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.
Froggy 08-10-2005, 08:25 PM 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.
gogocode 08-10-2005, 11:46 PM Originally posted by Froggy
Perl, Php and python are not typed languages
In PHP (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 (http://www.cosc.canterbury.ac.nz/), 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.
Froggy 08-11-2005, 01:14 AM "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?
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).
gogocode 08-11-2005, 05:33 AM 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.
Rotwang 08-11-2005, 12:56 PM 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.
Froggy 08-11-2005, 04:34 PM 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.
sergio 08-13-2005, 07:12 AM 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.
|