POV-Ray : Newsgroups : povray.off-topic : A tale of two cities Server Time
30 Jul 2024 02:28:00 EDT (-0400)
  A tale of two cities (Message 16 to 25 of 105)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: nemesis
Subject: Re: A tale of two cities
Date: 13 Mar 2012 17:24:34
Message: <4f5fbb12$1@news.povray.org>
Orchid Win7 v1 escreveu:
>>>> ah, children from the 90's...
>>>
>>> I wish. :-P
>>
>> ok, old fart.
> 
> Thanks for making me feel better. :-P

I'm even older than you (not by much actually) but have a far better 
sense of humor.  Better now? :)

>>> Seriously. Visual Studio manages to be responsive enough, and not eat
>>> half my RAM. NetBeans can't. IMHO, that makes NetBeans inferior.
>>
>> Windows comes with the .NET libraries used by VS. It's also a native
>> program, rather than one running on a VM.
> 
> You know, people say "oh, Java isn't slow". And then this happens...

It's one of the fastest languages on the shootout game.

> Also, about this "Windows comes with the .NET libraries". If that's so, 
> then why did I have to wait 20 minutes for it to download .NET when I 
> installed it?

older Windows?  anyway, .NET does not count when looking at the memory 
statistcs of a program that uses it.  It's "part" of Windows.  That's 
why you look at VS and it looks fine.  That's why you look at Firefox or 
Netbeans or some other foreign app and it looks like it's sucking all 
your memory:  their particular libs are alien to Windows and thus are 
taken into account when showing statistcs.  Not so with microsoft libs, 
so VS and IE look pretty lightweight.

they play dirty.

>>> (x -> y -> z) -> x -> (j -> y) -> y -> z
>>
>> haha, you already new that from the haskellwiki. :p
> 
> Erm, no... It's a simple question of type inference.

I prefer to leave that to the compiler or interpreter.  Better yet, I 
prefer not to think of types. :)

> I mean, c'mon, it's 
> not exactly a complicated code fragment. It's two function calls.

two function calls that take other functions and return other functions 
and ... well, you get the idea.

>>> That's not even parsable. (Indentation is significant, remember?)
>>
>> ah, seems indentation is lost (too bad for haskell). But nice style on
>> giving up.
> 
> Well, yeah, because even if I could understand it, that wouldn't prove 
> anything to anyone.

BTW, I looked up my post and indentation was fine.  But anyway, it's the 
pidigits haskell program at the shootout:

http://shootout.alioth.debian.org/u64q/benchmark.php?test=pidigits&lang=ghc

>>>>> Yes, Java /still/ sucks. :-P
>>>>
>>>> Yes and that is a feature by design.
>>>
>>> O RLY?
>>
>> Yes, so that your hired slaves can't cut the pulses and get free.
> 
> Wuh?

well, they do try to cut their pulses, but the language doesn't afford 
that.  Nor shooting on the foot.

>>> Ha! If only... They don't say "write once, test everywhere" for
>>> nothing. ;-)
>>
>> seems like most of the thousands of open-source java libs are well
>> tested already.
> 
> Wait - there are open-source Java libs now?
> 
> (Last time I looked at Java, all anyone ever used it for was pointless 
> Tic-Tac-Toe applets. Nobody ever wrote actual large applications with 
> it, just small toy examples.)

Earth to Andrew, Earth to Andrew!  An import message has been delivered: 
  this is not 1964 anymore.

Hint:  Apache once was a (patchy) http server.  Now it's one huge java shop.

After Microsoft shoved Java away from the desktop, it hid on the server 
(where it shoved Perl away).

>>>> BTW, Ant is yet another example of XML-madness: it's basically a 
>>>> verbose
>>>> XML makefile for java.
>>>
>>> Oh well. At least you don't need tab characters. :-P
>>
>> says the haskell programmer... :p
> 
> What? Tab characters are explicitly disallowed in Haskell. :-P

except where needed.

I prefer proper free-form parentheses. :)

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: clipka
Subject: Re: A tale of two cities
Date: 14 Mar 2012 00:32:46
Message: <4f601f6e@news.povray.org>
Am 13.03.2012 11:11, schrieb Invisible:

> The real sticking point was when I started trying to use abstract
> classes. It seems that you cannot have a variable of an abstract class.
> (Because creating that variable would require creating an instance of an
> abstract class, which is illegal.) You can only have a variable that
> /points to/ such a value. (Because then what it points to can actually
> be some concrete subclass.)
>
> That's all fine and logical and everything, but there's a nasty snag:
> Now you have to care about memory management. And there's no way around it.

Forget all you know about classic C pointers; instead, try the C++11 
(aka C++0x) shared pointers - they'll take care of all the disposing 
stuff. (If C++0x is not an option, use the boost library; C++0x took 
them right from there).

Instead of e.g.

     MyVirtualClass* o1 = new MySubClass(...);
     MyVirtualClass* o2 = o1;
     o1->doThis();
     o2->doThat();
     dispose o2; o1 = null; o2 = null;

you'd write

     shared_ptr<MyVirtualClass> o1(new MySubClass(...));
     shared_ptr<MyVirtualClass> o2(o1);
     o1->doThis();
     o2->doThat();
     o1 = null;
     o2 = null;

Note that the dispose is gone for good. Shared pointers use reference 
counters to accomplish this feat.

To save you some typing, you may want to use

     typedef shared_ptr<MyVirtualClass> MyVirtualClassPtr;

(Caveat: Assignments of shared pointers are a little tricky, as the 
assignment operator "o1 = o2;" is actually implemented as a swap 
operation; you'll need to use "o1 = shared_ptr<MyVirtualClass>(o2);" 
instead to clone a pointer.)

There is also a complementary weak_ptr, which allows the referenced 
object to be destroyed. To try to access the object, get a shared_ptr 
from the weak_ptr, verify that the shared_ptr is non-null and access the 
object.

> Like VS, asking NetBeans for a basic project generates a plateful of
> useless code that you then have to waste time deleting. (Apparently
> there's an Ant script somewhere too... whatever the hell that is.) It
> also sets the tab depth far, far too deep. But unlike VS, it also seems
> to /insist/ on incorrectly putting the open bracket on the same line as
> the declaration it begins. (This incorrect practise is also common in
> C++, and yet I didn't seem to have this problem with VS.) It's easy
> enough to manually fix, I suppose.

There's nothing "incorrect" about that way of placing braces, even in 
C++. It's syntactically correct, so say what you will.

As for Java, it's actually /the/ official curly braces convention, as 
recommended by Sun and later Oracle.

> So there we are. I doubt I'd remember much about the AWT (although,
> didn't they deprecate that in favour of Swing?),

The JAVA API has a rich history of deprecating interfaces, deprecating 
interfaces designed to replace deprecated interfaces, and un-deprecating 
deprecated interfaces. I wouldn't be surprised if AWT was among the latter.

> but I can certainly
> still write algorithmic code in Java without much ado. Maybe today I'll
> try something more ambitious with it. If I can avoid throwing the IDE
> out of a window.

Try Eclipse. Somehow it seems to be the unofficial standard IDE. (Never 
tried it myself in depth though; it has that very special 
Open-Software-Project air about it that somehow makes my skin crawl ever 
since I tried OpenOffice for real.)

> (Is it just me? "Net Beans"? It's an IDE. What the /hell/ does that have
> to do with networking? The "beans" part I kinda get; everything
> Java-related has to be themed on coffee or coffee beans. But why "net"?)

Maybe because "The NetBeans project consists of an open-source IDE and 
an application platform that enable developers to rapidly create web, 
enterprise, desktop, and mobile applications using the Java platform [...]"?


Anyway, I personally stick to IDEs developed by software development 
companies (and I mean companies that develop other stuff besides 
programming languages and IDEs). So far the best IDE experience has been 
Visual Studio for C#. One might snarl at the company's marketing 
strategies, but they seem to know what helps software developers to be 
productive.


Post a reply to this message

From: clipka
Subject: Re: A tale of two cities
Date: 14 Mar 2012 00:47:00
Message: <4f6022c4@news.povray.org>
Am 13.03.2012 20:40, schrieb Orchid Win7 v1:

>> import System.Environment
>>
>> foo n = 0 % (0 # (1,0,1)) where
>> i%ds
>> | i >= n = []
>> | True = (concat h ++ "\t:" ++ show j ++ "\n") ++ j%t
>> where k = i+10; j = min n k
>> (h,t) | k > n = (take (n`mod`10) ds ++ replicate (k-n) " ",[])
>> | True = splitAt 10 ds
>> j # s | n>a || r+n>=d = k # t
>> | True = show q : k # (n*10,(a-(q*d))*10,d)
>> where k = j+1; t@(n,a,d)=k&s; (q,r)=(n*3+a)`divMod`d
>> j&(n,a,d) = (n*j,(a+n*2)*y,d*y) where y=(j*2+1)
>>
>> main = putStr.foo.read.head =<< getArgs
>
> That's not even parsable. (Indentation is significant, remember?)

Yuck - I hate it when languages do that.

> Darren claims they committed to a feature freeze too soon. I don't know
> about the low-level details of the JVM. But I gather that, say, adding
> Java generics required lots of ugly hacks so it didn't break compatibility.

Guess how many ugly hacks C++ relies on to not break compatibility with 
classic library formats...

> I hear there are other languages that target the JVM. Presumably you
> still can't use any of the existing libraries though. (Not that any of
> them are much good.)

The fun is that you can. The bane is that you might have to.

> Oh, Haskell? Yeah, I gather a few people have tried to target the JVM
> with it. Nothing production-grade currently exists, however.

Is there any such thing as a production-grade Haskell implementation?


Post a reply to this message

From: clipka
Subject: Re: A tale of two cities
Date: 14 Mar 2012 00:53:26
Message: <4f602446@news.povray.org>
Am 13.03.2012 21:37, schrieb Orchid Win7 v1:

> Wait - there are open-source Java libs now?
>
> (Last time I looked at Java, all anyone ever used it for was pointless
> Tic-Tac-Toe applets. Nobody ever wrote actual large applications with
> it, just small toy examples.)

You've never heard of Java enterprise application servers, have you?


Post a reply to this message

From: clipka
Subject: Re: A tale of two cities
Date: 14 Mar 2012 01:48:36
Message: <4f603134@news.povray.org>
Am 13.03.2012 20:41, schrieb Orchid Win7 v1:

> (I'm also fuzzy on what happens when
> you try to delete a pointer - does it know what the "real" size of the
> object is, or does it use the declared type of the pointer?)

Just like free() in C, the delete operator in C++ frees whatever memory 
was originally allocated to the object, so you don't need to worry about 
/that/.

What you /should/ worry about, however, is which destructor will be 
called: Make sure to equip all of your virtual classes with a virtual 
destructor, otherwise the C++ standard guarantees for nothing.

(For non-virtual classes it is good practice to define a protected 
non-virtual destructor instead, just to be sure.)


Post a reply to this message

From: Darren New
Subject: Re: A tale of two cities
Date: 14 Mar 2012 03:14:07
Message: <4f60453f$1@news.povray.org>
On 3/13/2012 3:11, Invisible wrote:
> just runs the downloader for the /real/ installation program.

At least MS gives you a choice. They do that because you can pick to 
download C++, C#, the IDE, and the SQL server, and it'll download just the 
parts you need without duplicating them. Plus it downloads the right version 
for your OS, etc.

> business. Now, I'm not saying NetBeans is /inefficient/, but swallowing
> 200MB of RAM just because I double-clicked the icon to open the IDE does
> seem /just a tad excessive/ to me.

Only 200? I think the Eclipse at work takes 550M to 600M to start up.

> trying to actually /do/ stuff, the IDE seemed unacceptably unresponsive.

Try Eclipse. Try pasting a comment from one part of the file to the other 
making it go "unresponsive" long enough that Gnome asks if you want to kill it.

>  (Apparently there's an Ant
> script somewhere too... whatever the hell that is.)

It's an attempt at improving Make without actually fixing the major problems 
with Make.

> Or rather, I'm impressed at the IDE. Implementing array copying as a static
> method on a general utility class? Yeah, /that/ sounds like fantastic OO
> library design! :-P

Wait until you get into the generics, where you do things like turn a list 
of Freds into an array of Freds by invoking

   fredList.toArray(new Fred[]{});

i.e., by passing an empty array of Freds to the function in order to pick 
the right generic to return. Yes, you actually put an empty array on the 
heap simply to pass compile-time type data to pick the right method in a 
language that supports generics. Because there's no syntax for
    fredList.toArray<Fred>();

> the program. VS did all of this and more. :-P

Over the weekend, I wrote a program to take a couple CSV files, munge them, 
and stick them into some XML I could pull into the tax authority's forms, in 
C#.   It was like surfacing from under quicksand to use VS instead of 
Eclipse. I hadn't realized just *how* much Eclipse kills me at work compared 
to something designed by CHI experts instead of hackers.

I have a big text file with all my Eclipse hates on my desktop, just keeping 
track for a good rant some day.

> So there we are. I doubt I'd remember much about the AWT (although, didn't
> they deprecate that in favour of Swing?),

Yes, in spite of promising on day 1 that they'd never do that.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Darren New
Subject: Re: A tale of two cities
Date: 14 Mar 2012 03:20:10
Message: <4f6046aa@news.povray.org>
On 3/13/2012 14:24, nemesis wrote:
> older Windows? anyway, .NET does not count when looking at the memory
> statistcs of a program that uses it. It's "part" of Windows. That's why you
> look at VS and it looks fine.

I'm pretty sure that's not true. What *is* true is that .NET DLLs load as 
shard DLLs, and java .class files can't do that, since they're data.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Darren New
Subject: Re: A tale of two cities
Date: 14 Mar 2012 03:30:57
Message: <4f604931$1@news.povray.org>
On 3/13/2012 21:32, clipka wrote:
> Try Eclipse. Somehow it seems to be the unofficial standard IDE. (Never
> tried it myself in depth though; it has that very special
> Open-Software-Project air about it that somehow makes my skin crawl ever
> since I tried OpenOffice for real.)

It's not only that, but it's also a whole plug-in mentality.

You go to the project explorer with the tree view of your project's classes. 
You double-click a class to open it. You type Ctrl-F and start typing the 
name of the method you're looking for. What do you think happens? If you 
answer "Well, the focus was left on the project explorer because Eclipse is 
so modular it doesn't know where to put the focus, so your search string is 
in the wrong window", give yourself a cigar. If you continued "... and so 
you now have to click *three times* in the class window to change focus, 
once to close the search box in the project window, once to put the focus in 
the class window, and once to put it in the edit pane of the class window, 
and *now* you can type Ctrl-F", you may light your cigar.

> Anyway, I personally stick to IDEs developed by software development
> companies (and I mean companies that develop other stuff besides programming
> languages and IDEs). So far the best IDE experience has been Visual Studio
> for C#. One might snarl at the company's marketing strategies, but they seem
> to know what helps software developers to be productive.

Indeed. Or use an IDE by a group that actually has a CHI/UI expert on board.


-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Invisible
Subject: Re: A tale of two cities
Date: 14 Mar 2012 05:20:44
Message: <4f6062ec$1@news.povray.org>
>> You know, people say "oh, Java isn't slow". And then this happens...
>
> It's one of the fastest languages on the shootout game.

1. Micro-benchmarks are one thing. Large applications are another.

2. It seems the fastest is actually Fortran. (?!) Followed by C++. 
Followed by C. Followed by ATS and ADA. Only then do we get to Java, at 
70% slower.

(Mind you, Haskell is sitting there at 180% slower, so...)

>> Also, about this "Windows comes with the .NET libraries". If that's
>> so, then why did I have to wait 20 minutes for it to download .NET
>> when I installed it?
>
> older Windows? anyway, .NET does not count when looking at the memory
> statistcs of a program that uses it. It's "part" of Windows.

> they play dirty.

No, I'm pretty sure that's not correct.

The .NET libraries probably show up as shared RAM rather than private 
RAM, but they do still show up.

>>>> (x -> y -> z) -> x -> (j -> y) -> y -> z
>>>
>>> haha, you already new that from the haskellwiki. :p
>>
>> Erm, no... It's a simple question of type inference.
>
> I prefer to leave that to the compiler or interpreter.

Alrighty then.

http://tryhaskell.org/

 > :t ((.)$(.))

:: (a -> b -> c) -> a -> (a1 -> b) -> a1 -> c

Easy.

> Better yet, I prefer not to think of types. :)

A Haskell programmer not thinking about types is like an assembly 
programmer not thinking about processor registers. It is nonsensical.

>> I mean, c'mon, it's not exactly a complicated code fragment. It's two
>> function calls.
>
> two function calls that take other functions and return other functions
> and ... well, you get the idea.

Quite. I'm still waiting on the "who the hell writes code like this 
anyway?" part.

> BTW, I looked up my post and indentation was fine. But anyway, it's the
> pidigits haskell program at the shootout:

Ah yes. The great language shootout. An elaborate benchmark for 
measuring how many hackers are available to work on each programming 
language. ;-)

>> Wait - there are open-source Java libs now?
>>
>> (Last time I looked at Java, all anyone ever used it for was pointless
>> Tic-Tac-Toe applets. Nobody ever wrote actual large applications with
>> it, just small toy examples.)
>
> Earth to Andrew, Earth to Andrew! An import message has been delivered:
> this is not 1964 anymore.

Well, given that Java 1.0 dates to 1995, nobody would be arguing about 
Java back in the 60s. :-P

> Hint: Apache once was a (patchy) http server. Now it's one huge java shop.

Hint: When anybody says "Apache", they almost always mean "the Apache 
web server". Few people seem to realise that the Apache foundation even 
/make/ anything else. That's how popular their other stuff is.

> After Microsoft shoved Java away from the desktop, it hid on the server
> (where it shoved Perl away).

It is also news to me that Perl has gone anywhere but up. :-P

>>>> Oh well. At least you don't need tab characters. :-P
>>>
>>> says the haskell programmer... :p
>>
>> What? Tab characters are explicitly disallowed in Haskell. :-P
>
> except where needed.

Um, no. If your source file contains any tab characters, the compiler 
spits out an error message and refuses to compile it.

> I prefer proper free-form parentheses. :)

OK. So turn off the layout rule. :-P


Post a reply to this message

From: Invisible
Subject: Re: A tale of two cities
Date: 14 Mar 2012 05:25:59
Message: <4f606427@news.povray.org>
On 14/03/2012 04:53 AM, clipka wrote:
> Am 13.03.2012 21:37, schrieb Orchid Win7 v1:
>
>> Wait - there are open-source Java libs now?
>>
>> (Last time I looked at Java, all anyone ever used it for was pointless
>> Tic-Tac-Toe applets. Nobody ever wrote actual large applications with
>> it, just small toy examples.)
>
> You've never heard of Java enterprise application servers, have you?

I've heard of them - but I have no idea what the hell they are. Last 
time I checked, "enterprise" refers either to NCC-1701-D, a galaxy-class 
starship of the United Federation of Planets, or to a piece of software 
which is pointlessly over-engineered, over-complex, over-priced, and 
sold by pushy over-paid salesmen in bad suits.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.