Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Java vs Perl

FortKnox (169099) writes | more than 10 years ago

Programming 60

I made a comment in CyranoVR's journal (summing up bltzu's comment), and thought it was a lot of my opinion put into a couple sentences:

Programming is 20% design, 10% implementation, 5% testing, 65% maintainence.

Perl makes 10% of it cake.
Java makes 65% of it cake.

Now take your pick ;-)
I made a comment in CyranoVR's journal (summing up bltzu's comment), and thought it was a lot of my opinion put into a couple sentences:

Programming is 20% design, 10% implementation, 5% testing, 65% maintainence.

Perl makes 10% of it cake.
Java makes 65% of it cake.

Now take your pick ;-)

That being said, Perl is great for small project, and Java is much better suited for major/large projects (where maintanence is much more of an aspect).


I'll use /. as an example. It was written in perl, because it was a little college project, but it grew into this massive project. Now maintanence is a bear (find bugs on Wednesday deliveries!), and (I believe) if it was rewritten in Java, using fancy technologies (struts, hibernate, Xdoclet, etc...) it wouldn't be nearly as difficult to manage.
Feel free to discuss/argue (you know you want to) ;-)

cancel ×

60 comments

Sorry! There are no comments related to the filter you selected.

bah! (1)

eglamkowski (631706) | more than 10 years ago | (#8792143)

Machine language rewlz!

j/k

While I agree Perl is best for small, quick and dirty, one-shot throw away programs, I would not choose Java for anything, no matter what the size.
*shudder*

Re:bah! (1)

FortKnox (169099) | more than 10 years ago | (#8792210)

Have you ever tried it?

Re:bah! (1)

eglamkowski (631706) | more than 10 years ago | (#8792791)

machine language or java? :-)

Actually never written machine language, but I've done a little bit of java. Enough to know that I prefer C or even C++ (and I have more than a few complaints about C++...).

I'm one of those people who despises garbage collection, for example. And while I appreciate good (informative) variable and function names, tradition in java demands names that are absurd. The whole module structure thing is horrific. And how can you possibly do anything interesting without pointers without putting yourself through the most painful contortions? Scope is all messed up. Inline functions? The string class sucks (I'd rather have no string class and use char arrays than have a sucky string class, and I have yet to see a string class I've liked in any language...). Multiple inheritence? typedef? Why do I have to create an entirely new class for a primitive data type when typedef could trivially accomplish the same thing without any hassle? Macros? The whole Exception Hierarchy thing is appalling (not that I even like exceptions in the first place, though I have found occassional good uses for them, though rarely related to actual error handling...).

The list goes on and on. Java is just a pain in the ass to program in for far too many reasons. In C, if I want to do something, I just do it. In java I have to jump through a million stupid and arbitrary hoops.
Fah!

C: JUST DO IT!
Java: Don't just do it.

Re:bah! (1)

btlzu2 (99039) | more than 10 years ago | (#8793054)

You sound like me 2 years ago. I've seen the light since then.... :)

Garbage collection is the only way--it has improved tremendously and is so unobtrusive, you forget about it (as you should). You can actually concentrate on better implementation instead of mallocs and deletes.

What do you really need multiple inheritance for?

Character arrays are pure evil.

Buffer overflows are bye-bye.

Exceptions are powerful if handled correctly. They also remove a lot of shit like:
if (error) {
...
}
else {
...
if (!do_something()) {
error = 1;
}
else {
...
}
}
//on and on ad nauseum...
C is showing its age. I love it, but gimme Java for safer, better looking, maintainable code any day.

Java has solved a lot of problems with C/C++, it's just a matter of learning how to leverage it. Yes, you can do anything in C, but can you a) do it safely with ease b) maintain it as well as Java code?

Re:bah! (1)

FortKnox (169099) | more than 10 years ago | (#8793090)

I'll argue for the sake of arguing. I know I cannot convince you, but at least lemmie breakdown your complaints ;-)

java demands names that are absurd
There are no real 'demands' on the names. The rules for names are pretty much the same as in C.
And how can you possibly do anything interesting without pointers
This is a common misconception. In java, EVERYTHING is a pointer. It just knows when you are refering to the pointer, and when you are refering to the value. You are just passing around references, not values.
without putting yourself through the most painful contortions
You mean, not having to worry if you are destructing the pointer (have a memory leak) and have more time worrying about the actual functionality?
Scope is all messed up
Scope in Java works the same as in C. I don't see any problems. Perhaps you can explain this better?
Inline functions
Any small static function is inlined by the compiler. I don't know the specific rules, but its pretty intelligent on what to inline and what not to.
Multiple inheritence?
Multiple inheritence (I'm using the definition of 1 class having 2 concrete object parents) is faulty by design. It isn't truely OO, and is just the bastard child of C++.
Why do I have to create an entirely new class for a primitive data type when typedef could trivially accomplish the same thing without any hassle?
I don't know really if there is any disadvantage to not having typedefs. You can create an anonymous class or a quick one-line class if you need to. Its the same amount of code as a typedef and does pretty much the same thing.
Macros?
Its been a while, but Macros are run during the preprocessor, right? If so, Java has no preprocessor. Else, its just an inline. There are tricks to making something macro-esque, but its really simple Macros that it can mimic.
The whole Exception Hierarchy thing is appalling
Actually, exception handling with the hierarchy I've found to be quite elegant. Really allows you to handle exceptions the right way, and ignore checking for things in the middle of business logic.

Re:bah! (1)

blinder (153117) | more than 10 years ago | (#8793996)

Multiple inheritence?
Multiple inheritence (I'm using the definition of 1 class having 2 concrete object parents) is faulty by design. It isn't truely OO, and is just the bastard child of C++.


here here!

Actually, exception handling with the hierarchy I've found to be quite elegant. Really allows you to handle exceptions the right way, and ignore checking for things in the middle of business logic.

Again, exactly. I like to know what I'm catching and deciding whether or not I need to throw it back to the client/caller/whoever. Its all about typing!

Scope is all messed up

Um, no it isn't "messed up." I believe it to be very clear. Class member variables, static variables, method variables. Pretty simple really.

Re:bah! (1)

leviramsey (248057) | more than 10 years ago | (#8797673)

There are no real 'demands' on the names. The rules for names are pretty much the same as in C.

Syntactically, you're correct.

Culturally, you're dead wrong. Java culture (ie every Java programmer I've encountered production code from) demands absurdly long and descriptive variable names. In my experience, every Java programmer I've encountered has to contort their mind to get around the brevity of C-style variable names. Thus, since it's likely that at least some portion of the code maintenance will be done by someone well-versed in Java culture, using anything but verbose variable names will decrease maintainability.

This is a common misconception. In java, EVERYTHING is a pointer. It just knows when you are refering to the pointer, and when you are refering to the value. You are just passing around references, not values.

Java doesn't know whether you're referring to the value or the pointer. It makes a shot-in-the-dark guess.

This is easy (1)

ellem (147712) | more than 10 years ago | (#8792238)

I have books:

Learn Java In 21 Days purchased in say 1996

Learning Perl purchased in say 1997

I can program in Perl, and I still can't program in Java.

Perl wins.

Oh and as a (Windows) Sys Admin I hate Java and all it stands for.

Re:This is easy (1)

TechnoLust (528463) | more than 10 years ago | (#8792547)

I'm a (Windows) Sys Admin and I program in Java. I'm trying to pull several different types of systems together (Mainframes, old webapps, OpenSource databases, and windows stuff) into one easy to use webapps, and servlets great for that. There are hundreds of free connectors out there for many different things, and Java was close enough to C++ (which I already knew) that it was easy for me to learn. Ditch the learn in X days Java book, and either take a course at Sun, or get a thick tome that says something about Java REFERENCE on it and comes with workind code. The best way to learn any language is code in it. If you are interested, I've posted (quick and dirty, no OO) Java code in my journal before.

Re:This is easy (1, Informative)

FortKnox (169099) | more than 10 years ago | (#8792694)

"Thinking in Java" by Bruce Eckels. Live it, learn it, love it. Its free on the net and is the best learning Java book there is.

Re:This is easy (1)

ellem (147712) | more than 10 years ago | (#8792720)

No, no. Too late. Perl Uber Alles. Besides Java and its spawn bring evil upon my users. ;)

My brain doesn't work for programming. I'm supposed to be teaching History for chris'sake! I use Perl to get shit done once. It takes a little longer (thie first time) but then it's all easy.

I actually tried Mastering Java, and Thinking in Java [is-a-geek.org] but it turns out I can't think in Java [is-a-geek.org] at all. I (seriously) have trouble ordering Java at Starbucks.

Java (1)

blinder (153117) | more than 10 years ago | (#8792289)

well, seeing as though i earn my keep by designing/engineering large complex enterprise-ish systems using java (and doing it rather well, thank you) I would always turn to java.

i've been messing with java, well since the 1.0 days, out of simple curiosity (i was just getting up to speed with Perl -- heh, funny eh?).

I love perl, its my first language I ever learned. its fun, expressive and enables some very cool things, especially when you make it look like an OO language :)

I have found in my experience, that those that "hate" java are the one's who understand it the least. When pressed why someone hates java, it usually comes down to "its slow" or "the classpath"

well, every language is slow -- if you write your program poorly. The classpath? puhleeeze! The classpath is probably java's greatest things, yes it can be unruley to manage -- but that's why god invented Eclipse :)

The classpath means never having to say you are sorry (yeah, statically or dynamically linking libraries??? oh gawd, the pain).

Java is fast, java is effecient, java does its job, and when you couple it with the fun of j2ee and a head full of skillz... then you can make a very complex, high-use system that is a piece of cake to maintain. I know, I've done it.

Now, if IBM would just adopt 1.5 in the near future (so generics can be mine!!!) I'd be all set!

Re:Java (1)

sielwolf (246764) | more than 10 years ago | (#8793775)

What is the difference between the classpath and LD_LIBRARY_PATH anyway (other than the obvious "specification of jars instead of dirs" thing)? And what makes either any less or more difficult to set with ENV VARs?

Shit, most of those who complain about the classpath don't even know what LD_LIBRARY_PATH is. They probably think that binaries automagically find their non-local code.

Of course if they again wrote any real code (i.e. large enterprise projects) they would run into some hassles of SE project management. But, hey, what would /. be without dipshits pontificating on a topic they know shit about?

1.5 also has me hyped. Generics look cool. There's something else on there I see an immediate benefit for. Can't remember though.

I'm a Jikes man.

Re:Java (1)

FortKnox (169099) | more than 10 years ago | (#8793861)

asserts? The new loop syntaxes (honestly, I don't like these, but it just be my resistance to change)?

Generics and asserts will change the way I code :-)

Re:Java (1)

sielwolf (246764) | more than 10 years ago | (#8793969)

That sounds right. I'm mixed on enums (since that's a little too preprocessor and thus anti-OO for me). I think the caching on the interpreter will be a nice boost too.

Are you kidding me? (1)

Ayanami Rei (621112) | more than 10 years ago | (#8865439)

enums have nothing to do with the preprocessor and are very OO. They are how you describe non-continous sets with distinct elements. Apple, Orange, and Banana. I mean come on, so they'll implement it with final statics internally, big deal.
Java handles the symbol table wrangling, and encourages descriptive identifiers, so why not abuse it!?

My attitude is... (1)

Ethelred Unraed (32954) | more than 10 years ago | (#8792369)

...if it can't be done in PHP, it doesn't need to be done.

*ducks*

Actually, I would say that about Apple BASIC.

*ducksagain*

Cheers,

Ethelred

slight correction (1)

Abm0raz (668337) | more than 10 years ago | (#8792838)

just to nitpick ... it's AppleSOFT Basic. :)

-Ab

Re:slight correction (1)

Ethelred Unraed (32954) | more than 10 years ago | (#8792929)

just to nitpick ... it's AppleSOFT Basic. :)

Yeesh! [myoldcomputers.com]

10 NEW
20 PRINT "D'OH"
30 GOTO 10

;-)

Cheers,

Ethelred

Re:slight correction (1)

MobyTurbo (537363) | more than 10 years ago | (#8801024)

it's AppleSOFT Basic.
AppleSOFT BASIC, which had floating point and other goodies, was only available on ROM later on in Apple's history, though older Apples could always run they had a "language card" that essentially bank-switched 16K of ROM. (This functionality and hardware was built-in to the Apple IIe.) I always prefered loading "Integer BASIC", not because it wasn't MS, Fear and Loathing of MS happened later, but because then you had a mini-assembler mode that made it easier for me to write 6502 assembler.

Re:My attitude is... (1)

btlzu2 (99039) | more than 10 years ago | (#8792914)

(Aiming low) *SMACK* (right between the eyes!)

PHP sounds like a drug or something.

Java rules the wasteland! Standing proud, not ducking...take your best shot. ;)

Re:My attitude is... (1)

Ethelred Unraed (32954) | more than 10 years ago | (#8792958)

PHP sounds like a drug or something.

And that's exactly what it is. Toke up, baby! PHHHHHHP!

Java rules the wasteland!

It made the wasteland!

Cheers,

Ethelred

Re:My attitude is... (1)

trmj (579410) | more than 10 years ago | (#8793257)

Three cheers for PHP

..and those too lazy to just learn perl!

Implementation derives Maintanence (1)

sielwolf (246764) | more than 10 years ago | (#8792375)

I'm currently in a project where we are getting a hand-over Java project. The problem is, some of their implementation choices are ass.

From this we want to develop a new system but the central parser engine we don't want to touch. It would be great if it could just be cut and pasted into our CVS module.

Problem are those implementation choices. They didn't leverage the power of OO in a project with many sibling classes. No factories for shared global distributed functions, stylistic changes from one kin to the next.

Oh, and little to no documentation. I think they worked on it and it faulted and faulted and faulted. And just when they got it to work... they stopped working on it. They could've spent an extra week to organize and streamline it. Instead they just left it juryrigged with ducttape and spit.

I think that this plays into Perl as well since those 10% implementation choices can kill you on revs. One line super script? Great... until the boss wants to expand functionality or you would like to add some debugging. Then you gotta find a way to modularize something inherently singleton.

Folks used Java. And we like that. Too bad they just used their same old idioms in it. And at least we have the benefit of slowly rebuilding it, reusing objects, encapsulating away their wierd API.

Re:Implementation derives Maintanence (1)

FortKnox (169099) | more than 10 years ago | (#8792509)

That's my current assignment. Guy on a project for 6 months. Does more harm than good. Fired. Me contracted in. Have 4 weeks to take shitty code and fix it into something that works. Its 6 months worth of work. Its almost done. It may be worth it for project #2 (someone from my company is architecting it, so it'll be designed well. I'd step in as business analyst and senior developer).

Hey! I know the answer to this one! (1)

metlin (258108) | more than 10 years ago | (#8792994)

Java sucks, Perl rocks.

End of argument :-p

Re:Hey! I know the answer to this one! (1)

SamTheButcher (574069) | more than 10 years ago | (#8793074)

vi!

my answer to everything. :)

Re:Hey! I know the answer to this one! (1)

sielwolf (246764) | more than 10 years ago | (#8794085)

Funny story. I was in a lab where I was trying to set up a source repository. Because I don't have admin rights there, I was going to need to use VSS instead of CVS (which is strange since it's a Java project). While fiddling with it I asked a guy a question.

"What IDE are you using?" he asked.

"Vim."

"Like the text editor?"

"Vim is an IDE."

"Why would you use that?"

"Can your IDE do regex with your fingers on the homekeys and fit on a 1.44 floppy?"

And I wasn't being facetious. There's a reason why you :set makeprg=javac % (of course the best thing to do is download the ant.vim script. Gives you full blown Apache Ant compiling functionality with hotkeys and targets. *drool*)

Re:Hey! I know the answer to this one! (1)

btlzu2 (99039) | more than 10 years ago | (#8794241)

I'm AOL-ing again, but ditto. Vim is incredible. I've finally shown my friend/co-worker the light. He was using Eclipse, Visual Studio, blah blah blah. I would be fine having a couple xterms open using VIM and ant.vim.

He tried it for a week and uninstalled all that other garbage shortly after.

Re:Hey! I know the answer to this one! (1)

metlin (258108) | more than 10 years ago | (#8826583)

Emacs :-p it comes with the power of e-LISP!

Bwahahahahaaa

(yes, I do use it. no, it is not my preferred editor - I use notepad [tm])

Re:Hey! I know the answer to this one! (1)

SamTheButcher (574069) | more than 10 years ago | (#8826752)

When I'm stuck on Vinders, I use notepad too.

Viva la Notepad!

Re:Hey! I know the answer to this one! (1)

FortKnox (169099) | more than 10 years ago | (#8793113)

Your sig says you are interested in AI.

Every written a neural network in Java? Then did feedback looping and such to it?

Having a single 'neuron' object, and just mapping it around with managers and controllers makes Neural Nets fun and easy in java.

Re:Hey! I know the answer to this one! (1)

metlin (258108) | more than 10 years ago | (#8826576)

I do know that Java is better than Perl for any AI stuff - its just that for any little thing that I have to do, I have to go to such lengths to get it done.

As an example - we're building a system that resides on PDAs (connected to tiny GPSes) to adapt to user schedule and calendar based on the position - to even get the basic thing up and running, there is so much that I have to do - that I'm better off using something simpler like C and reinventing the wheel.

Do not get me wrong - I think Java is a great language (as much as I do not like some aspects of it) - its just that for simpler tasks its easier accomplished using something like Perl.

A lot of times, you want to try out little things in AI - nifty optimizations and the like. But if I have to go through so much of pain for each of these, it defeats the purpose. I would much rather use shell scripting + Perl, because it does the job and its faster.

Ofcourse, if you are talking about commercial applications, we are talking of a whole different ballgame. But I do hope you can see where I'm coming from :)

Python (1)

Sloppy (14984) | more than 10 years ago | (#8793034)

Python wipes the floor with both of them. It's easy to learn, easy to write, easy to read, and easy to maintain.

Python, Monty (1)

Ethelred Unraed (32954) | more than 10 years ago | (#8793078)

No! COBOL!

Er...Smalltalk!

Uhm...Forth!

Actually, I don't have a flying fuck of a clue what I'm talking about (being a PHP monkey and all), but a true geek would never admit that. So PYTHON IS TEH SUCK d00d!!!1!11!!!

Cheers,

Ethelred

Re:Python, Monty (1)

btlzu2 (99039) | more than 10 years ago | (#8795869)

You're a web monkey...you never tried Tomcat with JSP & servlets? I would think with ur sk1llz you'd rock out with a *good* web development platform! :)

I love these techno-religious battles. They're so meaningless, yet if everyone just listened to me, the world would be in a lot better shape.

Re:Python, Monty (1)

FortKnox (169099) | more than 10 years ago | (#8796459)

JSPs and Servlets? Quit living in the past, man. Its all about the struts [apache.org] , baby!

Re:Python, Monty (1)

btlzu2 (99039) | more than 10 years ago | (#8796569)

Haven't used struts. I got the impression that Struts was a crutch as opposed to a useful tool. I wanna write my own MVC--it's not hard!!!

I should research it more instead of hearing about it second hand. Our prof in OO Web Development was none too fond of Struts--he loved Tomcat though.

In that class, I wrote my own MVC app without learning what MVC was yet! That was the only time in my entire life that I re-invented the wheel.... :)

Re:Python, Monty (1)

jawtheshark (198669) | more than 10 years ago | (#8803997)

Let's say that stuts has the advantage of being there. No company is going to pay you to build your own MVC environment (even if you think you can do it better than struts). So, after getting used to struts it just works and you rarely have to touch any struts things once the whole project is correctly outlined.

I won't say it's the best thing around, but we (read as: people who earn their money with Java and are on limited budgets, like me and FortKnox) do with the tools we get.

Re:Python, Monty (1)

btlzu2 (99039) | more than 10 years ago | (#8804688)

That sounds good to me. I think I'll look into it further since you clarified it for me.

Just wasn't really sure if it was useful or not....

More and more, I'm earning my money from Java too--which is fine be me. I could be stuck somewhere, like some middle aged guy, writing mainframe assembler or COBOL. :)

Re:Python, Monty (1)

jawtheshark (198669) | more than 10 years ago | (#8804898)

Trust me, I was sceptical too. Let's just say that struts will take about the whole navigation of your jsp vs. controllers away and do it for you. Nice... And "debugging" struts-config.xml can be really a pain. Well, I was lucky, when I didn't find out, our architect was there to hold my hand ;-)

Don't diss mainframe assembler or COBOL. These guys will still have *better paid* jobs when the Java guys are begging for quarters on the street. It might not be the most interesting job, but some of these guys make more money than I can dream off. (Okay, perhaps this is only in banking environments where these guys are more important than anything else to keep the mission critical mainframes alive)

Re:Python, Monty (1)

btlzu2 (99039) | more than 10 years ago | (#8805116)

The way I'd look at it, I'd rather be happy with what I'm doing making less money and surviving than making tons of money and being miserable. Of course, begging for quarters on the street is not for me and I'd learn COBOL if that was the only choice! :)

However....

I don't really see a dearth of good paying Java positions either, to be honest, and I see COBOL and mainframe assembler slipping more and more away to obscurity. Eventually there will be no need at all for that type of programming someday as systems get swapped out. At least that's what I think. Good Java programmers are NOT a dime a dozen as far as I can tell.

So, are you home now or at work? I wish I was in Europe right now so work would be over for the day. :)

Re:Python, Monty (1)

jawtheshark (198669) | more than 10 years ago | (#8806316)

At least that's what I think.

Think again: banks are fond of their mainframes. Mainframes will still be treating your financial transaction in 25 years. You can trust me on that.

Good Java programmers are NOT a dime a dozen as far as I can tell.

Well, I hope I am one of the good ones :-)

So, are you home now or at work? I wish I was in Europe right now so work would be over for the day. :)

Last post I was at work on dial-up with my iBook. Now I'm at my parents on the machine I'm installing for my sister. I need to leave soon, SmilingGirl will be at my place in half an hour.

Re:Python (1)

FortKnox (169099) | more than 10 years ago | (#8793159)

I have the learning python book. I need to delve into it better. Was going to learn it after perl, but my job 'forced' me to learn java, and here I am ;-)

Re:Python (1)

gmhowell (26755) | more than 10 years ago | (#8795537)

Damn, beat me to it.

Simple (1)

M.C. Hampster (541262) | more than 10 years ago | (#8794280)


C# and the .NET Platform make it 100% easy. Double-plus good.

;-)

Re:Simple (1)

Hi_2k (567317) | more than 10 years ago | (#8799773)

C#? The .net platform, yes, but C# was acuratley described in a discussion of the name of the # symbol. # == rap as in C#. I'd love to love it, but I just find its annoying.

Re:Simple (1)

M.C. Hampster (541262) | more than 10 years ago | (#8803328)


I'm sorry, but I don't follow you exactly. What do you find annoying about C#? The name? Or something in the language? If it is the language, what is it specifically you don't like?

Java good. (1)

wheany (460585) | more than 10 years ago | (#8794555)

I love Java. Don't know Perl. I think that programming skill has nothing to do with what languages you know.

That said, when I think of Perl, I think of Slashdot. In a non-positive way.

Java is not a cool language. C, C++ and Perl are cool. I've heard good things about Python, but sometimes it feels it's just the BSD of programming languages, for people who think perl (Linux) is too mainstream.

What I most like about Java is that you have to be explicit. There isn't a lot that is just assumed, implied or done automatically.

Re:Java good. (1)

eglamkowski (631706) | more than 10 years ago | (#8796551)

You'd hate Perl then - everything is assumed, implied or done automatically.

Reference an array index that is out of bounds? Not a problem, Perl grows the array out to the size of what you tried to reference!

Use a number in a string context? Not a problem - Perl converts it on fly to be used as a string!

Forgot a parameter for a function? Not a problem - just about every standard function has a default variable to be used for function arguments!

Then again, Java probably does more stuff automagically than you realize. Garbage collection is just done automatically, for example, so you never need to think about freeing memory. All language have their little things like that. Perl just happens to have lots of them...

PHP (1)

leviramsey (248057) | more than 10 years ago | (#8797761)

The abstraction power of Perl with C/C++/Java syntax. The best of both worlds.

Perl is a generally excellent language with an excellent implementation, but has the misfortune of having a far too low ratio of real programmers to webmonkeys and garden-variety sysadmins.

Java is a pretty damn good language (especially in 1.5) with what has generally been crappy implementation, but it's almost exclusively used by real programmers.

I'd put PHP in between Java and Perl in all respects. I like balance and all that.

What does PHP stand for? (1)

Ayanami Rei (621112) | more than 10 years ago | (#8865489)

Personal Home Pages...

I've never gotten past how HTML/CGI/template-processing oriented the whole idea seems. Change my derelict views! I am but a system programmer.

In that same respect, imagine the laughs I get when I suggest to people that javascript (well ECMAscript) would be a kick-ass replacement for perl or python as a system programming/scripting language. (But really, I mean, imagine Ruby, only less awkward and more intuitive)

Is the same stigma/reality relationship true for PHP?

Re:What does PHP stand for? (1)

leviramsey (248057) | more than 10 years ago | (#8866927)

Actually, it stands for PHP Hypertext Preprocessor, though it is based on a series of Perl scripts devised by the original author called Personal Home Pages.

I'd say that PHP has that stigma. And indeed, its roots are (as mentioned above) as an HTML-embeddable language (and indeed, as far as I know, the language explicitly requires that all code be contained inside <?php ?>). But that leads me to what I view as its greatest feature: the fact that it is oriented towards templated output (though it's far from exclusively useful in that area). There's a large body of applications (webapps being but one of them) where the output should be in essence built on a particular template, and the specification basically is this template. An example would be a log-parsing program, where the next step in the chain requires that the input be formatted a certain way. Perl can accomplish this sort of stuff (use a long string with internal variables, possibly doing substitutions along the way), but that method seems kludgey to me.

The fact that PHP has grown outside of simple template-processing can be seen in the list of PEAR packages, including various graphical and console output modules (zero utility to the webmonkey). Furthermore, PHP is, AFAIK, the only platform independent language that allows inlining of C code within a script (the interpreter compiles the C locally on the first run and caches the resulting binary), which is pretty damn cool if you ask me (and reinforces my view of PHP as interpreted C).

Testing 5%? (1)

COBOL/MVS (196516) | more than 10 years ago | (#8799447)

It doesn't matter what tool you use, you should test it before it goes to production (something lost on Taco et. al). Testing reveals bugs. JUnit makes java testing easy and in some sick sense, a game.

I've been "promoted" (quoted because I'm still not sure if it is meant to be a promotion) to a job where my responsibility is managing testing efforts on a project. When we build the schedule, I make sure that 40% of the budgeted hours go to testing (some for planning, some for execution--depends on the project). I've been on projects that implemented applications in Java, C, COBOL and Perl. So far, the projects that actually made it to implementation that I've overseen have had the fewest post-implementation defects. Why? Testing.

Re:Testing 5%? (1)

FortKnox (169099) | more than 10 years ago | (#8804518)

Don't get me wrong, testing is just as important as design and coding, however, I was only including 'user testing' in the 5%. I consider unit testing to be a part of development/implementation.

Re:Testing 5%? (1)

COBOL/MVS (196516) | more than 10 years ago | (#8809869)

One of the efforts I'm on right now is spending the majority of their time in user testing. Let me try to explain it.

We have a large system in a financial services company that is going through some small, but significant changes, i.e. the changes in the code are small relative to the impact it will have to the business. This system is a large legacy beast that crosses all lines of business in our division and interfaces with systems (some new some legacy) in other parts of the enterprise. There is some new functionality that is being developed and that testing is nearly done (about 2/3 through 400 test cases).

One of the requirements of these changes was that even though we are adding new business, it should be transparent to old business. Thus, the majority of our test cases (about 4000 in total) are regression testing.

This legacy system expects people to enter their data and not see the results until the next day (overnight batch jobs run reports and stuff). Needless to say, my test executioners and business analysts are very busy entering transactions and reviewing reports (not to mention logging the results of each test case).

Unit and integration testing comprised only a small part of the overall testing. Implementation testing is handled by someone else (whew!). User acceptance testing will end up lasting 4.5 months in the end (when you factor in that this is a 12 month effort, that's a considerable chunk of time).

To me, user testing is about the most important thing you can do in a project. If the user won't accept the changes, then what? They're going to be pissed off that they spent a lot of time and money on something that wasn't going to pan out. I take my users very seriously and I want to give them as much time as they need to (a) get comfortable with the changes and (b) make sure they like it (job security).

I don't want to discount testing done before user testing. That's something that I also take very seriously. On my projects, I want as many defects found and corrected as possible in the lower levels of test. The defects found during user testing will most likely be due to the test environment (someone forgot to run a job or someone forgot to turn on a message queue or something like that) and not due to the code.

PS-someone else handles the test environment, I merely try to get time for my projects to use it...

Hmm Interesting (1)

KMAPSRULE (639889) | more than 10 years ago | (#8800370)

Commentary from all sides, couple of comments that stood out were

I think that programming skill has nothing to do with what languages you know.
I would tend to agree with this with the exception of Assembly Language, We have 2 guys here that Know assembly inside and out and they can out program the rest of us in any language they might choose to, it has inspired me to start picking at learning assembly in my spare time, I had several classes in College where we had to do a smattering of Motorola Assembly for some of there programable chips but I never learned PC Assembly...I kick myself for it.

It doesn't matter what tool you use, you should test it before it goes to production Right, use the language that makes the most sense for your programmers skill sets and project/application model, but stress writing good , clean, maintanable code that has been well architected and tested into submission!

We all have our Favorite languages,God help me but Mine is Ada95, Most of the Guys here prefer C. I think Perl is a good Glue Language, I/We use it all the time here to automate building/testing and annoying repetative tasks and report generation. Java is a good language for business apps but I wouldnt use it to do a hard real time Simulation of an F18's internals. Instead of this language war stuff we need to focus on Programming with emphasis on the language just being the tool to accomplish the goal at hand.

As Adages Go... (0)

Cliff (4114) | more than 10 years ago | (#8805310)

Perl makes 10% of it cake. Java makes 65% of it cake.
Isn't necessarily true. Good Perl should be almost as easy to maintain as Good Java. It's more the programmer and the infrastructure they used than it is the language, although the language can help or hinder in certain cases.

Let's make this clear: I love Perl. I don't know Java. I've tried to deal with Java several times but just couldn't deal with the verbose syntax, especially after having several near meltdowns dealing with MFC. I picked up Perl in a matter of days and proceeded to refine my skills over the next several years. I could probably take the time to learn Java now and have it stick, but like most folks, it will probably take A Job to get me out of my rut to do it.

This doesn't change the fact that I've seen bad Java, and bad Perl. To say that one language makes one part easy and the other hard is nonsense considering that it doesn't take into account the skill with which the programmer crafts his code.

Hell, I've seen decent Pascal and exceptional C. I'd be able to maintain them all without much trouble.

Caveat: I have yet to see COBOL that didn't make me want to run away screaming. But that's neither here nor there.

So while I prefer to use Perl, I won't begruge someone to work with a program in Java, but I've heard from several directions how easier it was when taking a project done in one language and converting it to another to achieve better performance and ease of maintenance. It all boils down with what you are familiar with and any bad experiences you've had in the past.

ANYONE who takes down a working Perl installation of several thousand kLOCs just to convert it to Java (or vice versa) needs a cluebat to the skull.

My point is, you can use the best language for the Job. Many people use a particular language and it becomes their hammer and every problem, their nail. It's a credit to any language when you can use it to solve a wide variety of problems. This includes Java, and it definitely includes Perl. Length of the code doesn't factor into it. The skill of the design DOES.

Re:As Adages Go... (1)

COBOL/MVS (196516) | more than 10 years ago | (#8809937)

Do I make you want to run away screaming? =)

COBOL is the best tool for back end business processing hands down. Java is a close second.

Every tool has its uses. You wouldn't use a hammer as a vise just as you would probably not want to use COBOL to run a large-scale website on the front end (although you may want it to handle back end data retrieval and manipulation, but that's another discussion altogether).

You'd be surprised at what can be done with COBOL on the good old mainframe these days (as long as you have a TCP/IP stack on and C runtime libraries installed)...

SET CLIFF-P TO OWNZOR-D (0)

Cliff (4114) | more than 10 years ago | (#8811001)

Do I make you want to run away screaming? =)
D'oh! I had to go and open my mouth wide enough to stick my foot in it.

For what it's worth, my mother was a COBOL programmer. It's the language that gives me migranes, not the people that use it. Again, like I've already said -- the best tool for the best job. If your problem is a screw, and COBOL is a screwdriver, then use it! =)
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>