News for hackers. Stuff that matters.
Re:Ask YC: What new technologies are you exploring? by mynameishere on Monday November 19, 2007 @04:40PM (#81663)
Well, perl is pretty new. In geological terms. Plus, I'm finding that 1000+ line java applications can be replaced with 15 lines of perl.
Re:Ask YC: What new technologies are you exploring? by SwellJoe on Monday November 19, 2007 @07:06PM (#81732)
I'm also rediscovering Perl, after a few years of mostly working in C and Python (really, I wasn't doing a lot of development during that time, so I've still done a lot more Perl work than any other language).

MJD's Higher Order Perl is a fantastic resource for "new" techniques as applied to Perl. And, I've read the latest edition of the Camel book and found that I never really understood the language when I was using it three or four years ago (at the time I had read Learning Perl, and Perl in a Nutshell). Perl is so much more powerful, concise, and pretty, than I'd realized.

Perl 5.10 and 6 are really quite nice, as well. Objects are still somewhat quirky in 5.10, but will be fixed beautifully in 6. Likewise for named function arguments. Field Hashes are neat.

Oh, and using JSON with Perl is lovely--since everything we do is passing around references to arrays and hashes and such, converting a traditional HTML UI to an advanced JavaScript one is so much easier than I expected (and because objects are hashes, it'd be possible to do something similar, even if our code were more object oriented). Really quite smooth. JSON::XS is super fast and easy to use.

Re:Ask YC: What new technologies are you exploring? by Tichy on Monday November 19, 2007 @05:19PM (#81690)
Which ones? I suppose then there are also 1000 line Perl applications that can be replaced with 15 lines of Java. There are enough bad programmers out there...
Re:Ask YC: What new technologies are you exploring? by nailer on Monday November 19, 2007 @07:11PM (#81735)
Admin wise, I find a lot of 20 line Perl applications can be replaced with bash scripts. Most Perl developers seem to think Bash is Bourne shell, and don't know how to use functions or arrays. It's unfortunately pretty common to see 20 lines of Perl invoked to do things like check a network port is listening, around 2 lines of Bash.
Re:Ask YC: What new technologies are you exploring? by vikram on Monday November 19, 2007 @05:43PM (#81701)
Doesn't it take 10 lines to say "Hello World" in Java.
Re:Ask YC: What new technologies are you exploring? by tlrobinson on Monday November 19, 2007 @11:56PM (#81828)
You were probably exaggerating, but for reference:

    public class hello {
    	public static void main(String args[]) {
    		System.out.println("Hello World");
    	}
    }
Also, I interviewed with a large company that shall remain nameless (probably not who you would expect), and one of the interviewers mentioned that their build system was a MILLION lines of Perl...
Re:Ask YC: What new technologies are you exploring? by vikram on Tuesday November 20, 2007 @02:46AM (#81856)
Yes, I am exaggerating. I would call this three lines. As there are 3 constructs here.

A million lines of Perl, was maintaining that part of the job description?

Re:Ask YC: What new technologies are you exploring? by tlrobinson on Tuesday November 20, 2007 @01:55PM (#82035)
Yes, the position was for the build team, so I assume maintaining that beast was part of the job.
Re:Ask YC: What new technologies are you exploring? by Kaizyn on Tuesday November 20, 2007 @08:03PM (#82263)
Must be HP then?
Re:Ask YC: What new technologies are you exploring? by cstejerean on Tuesday November 20, 2007 @04:30PM (#82154)
Why is that always the first point of comparison? Why does it matter how much shorter hello, world is in Lisp (or Python, Ruby, etc) vs Java?
Re:Ask YC: What new technologies are you exploring? by Zak on Wednesday November 21, 2007 @01:52AM (#82380)
Hello world shows how much boilerplate is required before you can print a message to stdout. It's one of several important factors for any language you might use for quick and dirty throwaway programs. You want it to be two tokens only - the name of the print function and the string to be printed.
Re:Ask YC: What new technologies are you exploring? by cstejerean on Thursday November 22, 2007 @01:57AM (#82686)
ah, quick and dirty throw away programs. Personally I think writing output to the console should be harder (but I'll save that for later). I'd like to see more sane comparisons, like: making a TCP connection, making a web request, encrypting and decrypting a string, computing base64, md5, etc.

And in Python, print "hello, world" is bad form. It would be proper to write (news.YC is omitting some newlines below)

def main(): print "hello, world"

if __name__ == "__main__": main()

Re:Ask YC: What new technologies are you exploring? by vikram on Thursday November 22, 2007 @07:21AM (#82727)
well we don't have to do that. Though this isn't the same test as what you propose. This guy has compared many different web frameworks. http://video.google.com/videoplay?docid=6297126166376226181

I think the reason the LOC count is significant is because it means that there is less code for one to look through to figure out what is going on. Fewer lines imply that the solution has high level abstractions. Each one of the examples you mentioned is one construct in lisp (if you use libraries).

Re:Ask YC: What new technologies are you exploring? by boucher on Thursday November 22, 2007 @09:08AM (#82747)
I think thats a bit of a fallacy (and I also think this guys video is a bit of a waste of time...).

More abstractions can be nice, but don't mistake it for less code. Its still code somewhere, and that can lead to much more subtle and hard to find problems if you don't understand exactly what's going on. Of course, some environments are bigger culprits than others, but its something to keep in mind.

Re:Ask YC: What new technologies are you exploring? by cstejerean on Friday November 23, 2007 @06:37AM (#82925)
well, a big difference in total LOC might be significant, but that's slightly different claim than saying that a difference in LOC for "hello, world" has any importance.

The reason you can get by with a shorter hello world program in most dynamic languages is because you're doing it in the "module" definition, which I think is not proper form in any non trivial programs. So any differences in LOC for hello world really mean nothing over the course of a real application.

Re:Ask YC: What new technologies are you exploring? by Tichy on Monday November 19, 2007 @07:12PM (#81737)
Depends on the formatting - you can write it in one line without any problems whatsoever.
Re:Ask YC: What new technologies are you exploring? by mynameishere on Monday November 19, 2007 @08:03PM (#81756)
Things that perl was designed for...extracting text from other text. The Mechanize library helps.
Re:Ask YC: What new technologies are you exploring? by Tichy on Tuesday November 20, 2007 @06:06AM (#81896)
I googled for it, but I only found a "Mechanize" library for Ruby. What does it do?

I actually like the way regular expressions are being handled in Java. The only problem is that "\" has to be escaped in Java Strings, so the regex patterns tend to have a lot of slashes.

Re:Ask YC: What new technologies are you exploring? by mynameishere on Tuesday November 20, 2007 @06:08PM (#82204)
http://www.google.com/search?q=Mechanize+perl

Screen scraping. I don't have any major problems with Java--it's just that it lends itself to serious over-engineering. Maybe that has more to do with business culture.