What are OOP's Jargons and Complexities
bugbear
bugbear at trim_papermule.co.uk_trim
Fri Mar 30 04:28:36 EDT 2007
Xah Lee wrote:
> So, a simple code like this in normal languages:
>
> a = "a string";
> b = "another one";
> c = join(a,b);
> print c;
>
> or in lisp style
>
> (set a "a string")
> (set b "another one")
> (set c (join a b))
> (print c)
>
> becomes in Java:
>
> public class test {
> public static void main(String[] args) {
> String a = new String("a string");
> String b = new String("another one");
> StringBuffer c = new StringBuffer(40);
> c.append(a); c.append(b);
> System.out.println(c.toString());
> }
> }
Er. How about
public class test {
public static void main(String[] args) {
String a = "a string";
String b = "another one";
StringBuffer c = a + b;
System.out.println(c);
}
}
Alternatively I could recode your Lisp example
as badly as you coded your Java.
BugBear
More information about the Python-list
mailing list