Saturday, July 31, 2004

Re: Inventory Editor

Here is what I bleieve to be the final version of my Inventory Editor.

This version is a lot more robust and will recover from a lot of painful mistakes made by the user. Made a few bug fixes too.

Dinesh.

Friday, July 30, 2004

Letter to American masses

I got this from http://fourthedition.blogspot.com/

A very sincere letter to the American masses:

"Dear Sir,

I am a senior citizen. During the Clinton Administration I had an extremely good and well paying job. I took numerous vacations and had several vacations homes.

Since President Bush took office, I have watched my entire life change for the worse: I lost my job. I lost my two sons in that terrible Iraqi War.

I lost my home.

I lost my health insurance.

As a matter of fact, I lost virtually everything and became homeless. Adding insult to injury, when the authorities found me living like an animal, instead of helping me, they arrested me.

I will do anything to insure President Bush's defeat in the next election.

I will do anything that Senator Kerry wants to insure that a Democrat is back in the White House come next year. Bush has to go.

I just thought you and your listeners would like to know how one senior citizen views the Bush Administration.

Thank you for taking the time to read my letter.

Sincerely,

Sadaam Hussein"

Re: Inventory Editor

Pretty good app.

One suggest was why not club menu items 6, 7 and 8 together. It feels a bit redundant. You can have the normal table with the end like .

Total Shopping Cost is...
Total Packing Cost ...
Total Shopping Count ..

Though I might not use it as much coz shopping is not one of my major concerns. One worry is about all the tutorials and articles etc I have downloaded. Needed something like a super Bookmark app with a good way to categorize and search. Any ideas??

Inventory Editor

Having to move to bangalore soon got me planning and generally shopping and packing my stuff. I got irritated created stupid txt files of my inventory, so I coded a small program which turned out pretty neat ;)

The file can be found here Windows: Inventory Editor

It's not great or anything but I think it can be pretty handy. Try it out. Revo, obviously this will be of more use to you. Did one cool thing in it, I used a serialization library called Eternity by Nicola Santi :D It was good fun!!

The program supports Adding, Editing and Deleting Inventory Entries. It also supports printing the Inventory to a txt file in a nice format (view the txt file in maximized window mode). No Linux version, yet!

I'll post this on my blog too later and hence the disclaimer in the zip file. Check it out and tell me how it is. I've not found any obvious errors yet, but tell me if you find any. And the Format Specifiers for output are according to my window dimensions, so it may be distorted for you.

By the way, please enter ints where ints are expected and likewise for the other fields. I haven't done any protection against such things. I thought only I'd be using the program.

Dinesh.

Saturday, July 24, 2004

Re: OOP's basics - Access

Revo, I'm not really sure what you are asking here. Are you asking how Access Control is implemented in C++ / Java? or what is Access Control?

I'll answer the second question here. Consider the following code :



#include "iostream" //replace the double quotes by < >
using namespace std;

class base
{
public:
int bval;
base(){ bval=0;}
};

class deri : public base //Note : Here it is public
{
public:
int dval;
deri(){ dval=1;}
};

class deri2 : public deri
{
public:
int dval2;
deri2(){ dval2 = 2; }
};

int main()
{
deri d1;
deri2 d2;

/* The following code is Legal when "base" is public to "deri"

d1.bval = 9; //bval is accessible because base is now a public part of deri
d2.bval = 10; // same for deri2, cause deri is public to it, which in turn makes base public

*/

/* Now when "base" is protected to "deri", the above code in red is not possible because
of the semantics of the protected key-word, which can be found in any book.
But note here that members of "base" are accessible to "deri2"'s class definition,
It's just that the objects of deri2 can't directly access it. Again all this
just pertains to the semantics of "protected".
For eg: this is legal in this context
deri2() { bval = 2; dval2 = 3; }
*/

/* And when "base" is private to "deri", "deri2" has no access to "base"'s members,
"base" just cannot be seen by "deri2".
*/

system("pause");
return 0;
}
So basically, you can say that Access Control pertains mostly to how the various classes work in Heirarchy of classes. If it's just one base and one derived class, then access control is not of much importance, because as you can see there is no difference then between "private" and "protected", only difference which can be found is between "public" and the other two.

If you are still unclear, keep posting.

Dinesh.

Thursday, July 22, 2004

OOP's basics - Access

Hrishi asked me a basic question on OOP's which I could not answer. How is access to members controlled wrt access of Classes.

I found Controlling Access to Members of a Class.

Is there a thing such as private class Gamma ? Is it the same as class Gamma ? And how does access to members change wrt to the class access ?

Thursday, July 15, 2004

Mono: More than an open source curiosity

http://news.com.com/More+than+an+open-source+curiosity/2008-7344_3-5271084.html?tag=nefd.lede

Mono has the potential to be more successful on the Linux desktop than Java. Most .NET developers are familiar with writing Windows apps. Taking that knowledge over to Linux will be quite easy now with Mono. The UI classes doesn't map one to one (with Mono using GTK#), but the model is close enough to be able to carry over.

Here's an intro to using Mono: http://arstechnica.com/etc/linux/index.html

Re: Java Issues & Directions

So what is MXML? Some eg? How different is XAML? What will be the features?

Well, MXML is what Macromedia is using for Flex. There was a slide in Eckel's presentation that showed some code. That was what I said looked quite similar to ASP.NET code. XAML is going to be for desktop based apps. MXML, like ASP .NET, is for web apps. An interesting idea is if you want to provide an "enhanced" experience for Longhorn, when you visit a website, instead of sending back HTML code, it will send back XAML code. So instead of viewing a UI within the browser, you now get a full fleged Windows app. It would be great if there is some sort of standard that can be implemented on all platforms.

There are a lot of competing technologies in the Java Community. In a way I feel this is very healthy. Ease of development I feel is a different issue. Java is not as close to the stuff like what i think MXML might be. Though tools are improving very rapidly and also the lang after Java 1.5. Btw this is how the latest SWT looks like. It doesn't look native but would you use it?

Definitely agree that the competing technologies make it healthy. Just wondering if there are any efforts in the Java world to come up with something like XAML. As in, declarative UI. This would straightaway make it really easy to build UI's.

The Eclipse app looks great. What languages does it support?

This article should explain most of the stuff. One part I noticed is that there is no EJB equivalent. Isn't ADO for database connectivity? What is COM+ ? Is it a part of .NET?

The article helped clear up some stuff. But I still couldn't figure out what exactly EJB does.

Yeah, ADO .NET is for database connectiviy... equivalant to JDBC. COM+ is stuff like Message Queueing, Transaction management etc... It was available starting with Window 2000. .NET just provides a managed layer on top of it. For ex, there is a Transaction attribute you can apply to methods, which presumably uses COM+. These are called Enterprise Services in .NET. I dunno much about this stuff. I don't really understand what it means to be an "enterprise" app.

Ya.. The video was very helpful. One part i did not understand was about was the advanced generics stuff, Factory etc.

I didn't understand the Factory stuff either. It felt like he was trying to get around the limitations of Generics. Just confused me more.

Firstly I have to say that I appreciate what Eckel had to say about Java. Those were facts and can't deny anything. Everything he said about Generics, Erasure, ease of use I could take. But Cooncurrency did really hurt. .NET has helped Java as well. I hope that things get better and fast.

I thought it was a good video. I felt it was not biased at all. Some dudes when giving talks are so biased it sickens me. He just gave a critical view of what he thought could be better in the platform.

Wednesday, July 14, 2004

Re: Java Issues & Directions

He mentioned Macromedia Flex on one slide and showed some code. I was surprised at how similar the MXML code looked to ASP .NET.I somehow feel like Flex is not going to be mainstream for web applications. It's very rare to see a web app use Flash/Shockwave for its front-end.

So what is MXML? Some eg? How different is XAML? What will be the features?

I agree that as of now we are used to HTML etc. But everyone knows that they are very limited. Personally i feel that Flash is the best alternative out there. Especially for Java as it is cross-platform. There are a lot of examples of Flash overuse, but what I saw in the stream was just amazing. Plus it can very easily put an end to all AWT vs SWT vs Swing. The only reason why Flex will not take off coz Macromedia controls it. If it will be opened further, it could become very widely used.


He said some stuff about Java's lack of acceptance on the client. AWT vs SWT vs Swing. Goes back to the easyness thing I mentioned in a previous post. There should be one standard that makes it easy for devs right out of the box

There are a lot of competing technologies in the Java Community. In a way I feel this is very healthy. Ease of development I feel is a different issue. Java is not as close to the stuff like what i think MXML might be. Though tools are improving very rapidly and also the lang after Java 1.5. Btw this is how the latest SWT looks like. It doesn't look native but would you use it?


could you explain the entire array of Java technologies that are out there. J2EE, J2SE, J2ME and how they differ from Java 1.1, Java 1.2 ... Java 1.5. Now they have Java 5.0 right? Also, what about JSP, EJB's and servelets and how are they connected to the versioning?

This article should explain most of the stuff. One part I noticed is that there is no EJB equivalent. Isn't ADO for database connectivity? What is COM+ ? Is it a part of .NET? EJB is one huge API which a lot of dev's feel is bloated and un-necessary. There are alternatives to that too, though I am not aware how they work. I wanted to know how .NET works in that layer. This might be a major advantage of .NET. Also do .NET dev's feel some std stuff needs to be changed? Any voices of dissent?

When Java 1.x is mentioned it means J2SE 1.x. Java 1.5 is now called Java 5.0 because of the major enhacements in the lang. Remember Java 1.2 was called Java 2. JSP, EJB etc are all part of J2EE. Each component has a separate versioning system and J2EE as a whole also has it's own versions. May sound a bit confusing at first. When there are major revisions to the individual componets, a new J2EE version is declared.


Rahul - Couple of slides on Metadata/Attributes - Might explain better than just reading about it.

Ya.. The video was very helpful. One part i did not understand was about was the advanced generics stuff, Factory etc. So need to lift my lazy ass and start learning soon.


During his Concurency talk, he mentioned a bug that has been in Java since the first version in "volatile".

Firstly I have to say that I appreciate what Eckel had to say about Java. Those were facts and can't deny anything. Everything he said about Generics, Erasure, ease of use I could take. But Cooncurrency did really hurt. .NET has helped Java as well. I hope that things get better and fast.

Monday, July 12, 2004

Re: Unified Type System

I posted this question on a gotdotnet forum and got a few responses.

They seem to be pointing to those base methods again. Looks like Rahul was right.

Sunday, July 11, 2004

Java Issues & Directions

Couple weeks ago our good friend Bruce Eckel gave a talk (real) regarding Java 1.5 at UC Berkley. It's quite long - about 2 hours 15 mins - but it's well worthwhile. Highly recommend it. He begins with a wide range of issues regarding what's wrong with Java and then goes on to new features in 1.5.

Some thoughts on the talk...

He mentioned Macromedia Flex on one slide and showed some code. I was surprised at how similar the MXML code looked to ASP .NET. He also compared it to what XAML is going to accomplish on Longhorn. I somehow feel like Flex is not going to be mainstream for web applications. It's very rare to see a web app use Flash/Shockwave for its front-end. As limiting as HTML, CSS and Javascript are, they will rule for a long time. Don't see anything displacing it anytime soon. We're just too used to it.

He said some stuff about Java's lack of acceptance on the client. AWT vs SWT vs Swing with different companies (ie. IBM vs Sun) supporting different API's. Goes back to the easyness thing I mentioned in a previous post. There should be one standard that makes it easy for devs right out of the box.

Rahul - could you explain the entire array of Java technologies that are out there. J2EE, J2SE, J2ME and how they differ from Java 1.1, Java 1.2 ... Java 1.5. Now they have Java 5.0 right? Also, what about JSP, EJB's and servelets and how are they connected to the versioning?

The Generics section was particularly interesting. He mentions some gripes about "Erasure" which is where Java looses the type information when compiling generic classes vs C++/C# retaining it. C#, although differening in the actual implementation of generics, is similar with Java in having constraints when declaring generic classes/methods.

Rahul - Couple of slides on Metadata/Attributes - Might explain better than just reading about it.

During his Concurency talk, he mentioned a bug that has been in Java since the first version in "volatile". I think that's a keyword. Anyway, when using these sorts of frameworks dyou trust it completely to be solid? I feel like those guys who wrote it are gods and know 2^20 times more that I do. I mean I could never for a sec imagine that if there is a bug I'm struggling with that the problem might actually be in the library.

Dinesh - He talked about the benefits of garbage collection and that the C++ committee might be tempted to include one in the next iteration of the C++ standard. Any news on this?

Re: Unified Type System

I was thinking of garbage collection myself and I do think a common base is required that keeps say two things, a count and a vector of pointers (or references) to the objects created, at the very minimum.

That very well could be one implementation. The pointers to objects created on the heap are on the stack. So, dyou think it would be economical for the garbage collector to also have pointers to those objects?

In .NET, when a collection is invoked, it walks through the roots (ie. global, static and stack pointers) recursively and creates a graph. This signifies all reachable objects. The non-reachable objects (ie. garbage) are marked. Those marked objects are deleted after the graph has been created. The others are compacted.

That mark phase... The Object base class could play a role. As I said last time, there could be some flag in Object thats set signifying that it's garbage and should be deleted. The other way could be that the collector creates a table of pointers to just the garbage objects to delete. In that case, we wouldn't need that base class with the flag.

The other reason why I feel having Object as the base class is not directly connected to garbage collection is cause MFC also has a root CObject class. I'm not very knowlegable about MFC, but if you want to "play well" with the framework and use your objects in the collections, you need to derive from CObject.

I guess Rahul might be on the right track regarding having those common methods in all objects. But I'm still not totally convinced.

Generics in C++ essentially auto-generate the classes based on type?

Yup. Templates - It's all done at compile-time. If the compiler comes across a declaration of the template with a type, it will auto-generate the class based on the type. And then that class is compiled. Dinesh can you confirm this?

What do you think happens in Java/.NET Generics? I suppose they 'fortified' the current Collections by forcing Type. This reduces Casting troubles at run-time and also provides better perf. So I think Generics are as dependent on Object.

As I understand it, in .NET, when the compiler comes across a declaration of a generic class with a value type (primitives, structs), it creates a new class definition. But it will only create one class definition for all reference types. This is because it holds references, which are the same regardless of what type it's pointing to.

So for example, if you have
ArrayList<int> intList = new ArrayList<int>();
ArrayList<double> doubleList = new ArrayList<double>();

ArrayList<string> stringList = ArrayList<string>();
ArrayList<MyClass> myClassList = ArrayList<MyClass>();

This code will create only three class definitions - One for int, one for double and one for references. The references definition will be used for both string and MyClass.

I believe Java will spit out four definitions.

You seem to have agreed with the importance of the other methods. toString( ), clone( ) and equals( ) are not the most important, but are pretty useful in many cases. Placing them in Object must have been thought over.

Actually, I just gave those methods as examples. I was talking about all of them. I realize they were thought over a lot. The guys who designed these systems are geniuses. I'm just trying to understand if that really was the reason for having a Unified Type System.

Saturday, July 10, 2004

Re: Unified Type System

I was saying because there is a hierarchy with Object being the root, the Collection classes can work with just Objects and not have to worry about other classes. Now, if they had introduced the framework with generics, you could have just done ArrayList, ArrayList, ArrayList and they would NOT need to inherit from Object. This is how it is in C++.

I'll repeat what I think you meant. Collections store pointers of type Object which can be later Cast into various Types. If this is what you meant, yipee for understanding and I see your point.

Generics in C++ essentially auto-generate the classes based on type?

What do you think happens in Java/.NET Generics? I suppose they 'fortified' the current Collections by forcing Type. This reduces Casting troubles at run-time and also provides better perf. So I think Generics are as dependent on Object.


I don't see this as an advantage

You seem to have agreed with the importance of the other methods. toString( ), clone( ) and equals( ) are not the most important, but are pretty useful in many cases. Placing them in Object must have been thought over.

Friday, July 09, 2004

Re: Unified Type System

But, I'm skeptical since there are garbage collectors out there for C++ and we all know C++ doesn't have a Unified Type System. Even Java allows for different garbage collectors. So I wouldn't think that Object would play a role in it.

The reason I said that was sometime back I had gone through some simplistic garbage collection code and I remember distinctly that the objects had to be inherited from a common base IMMObject or something, which kept track of the various objects created. This is as far as my memory serves me, cause I think this was quite some time back!!

I was thinking of garbage collection myself and I do think a common base is required that keeps say two things, a count and a vector of pointers (or references) to the objects created, at the very minimum.

Or maybe it's just a whole "everything has to be OOP's" thing. So they created a single root hierarchy.

Dinesh.

Re: Unified Type System

I was a bit confused about what you are trying to say? Do you mean simple Casting? How is C++ better at handling collections/generics w/o unified type system?

I was saying because there is a hierarchy with Object being the root, the Collection classes (just as an example) can work with just Objects and not have to worry about other classes. If they didn't have this hierarchy then you would need a StringArrayList, IntArrayList, MyClassArrayList etc... In other words, specializations for every possible class you would want to put into any collection. Now, if they had introduced the framework with generics, you could have just done ArrayList<String>, ArrayList<Int>, ArrayList<MyClass> and they would NOT need to inherit from Object. This is how it is in C++.

To notice the advantages of Object look at the class itself. Object guarantees that Thread support is provided out of the box with final classes like wait( ) notify( ). Other methods like clone( ) equals( ) getClass( ) and hashCode( ) provide features to be extended by child classes. getClass( ) is important for Reflections. hashCode( ) is important for generating hashcode indices for Collections like Map. Also finalize( ) serves as a Destructor.

I don't see this as an advantage. If your class never needs to be output to console (or whereever), you won't need the ToString() method. Similarly for Clone(), if you won't ever make a copy of yourself or Equals() if you will never be compared. C++ gives you the option. If you want to output to console (or whereever) you overload operator<<. Same for equals and clone... overload operator== and copy construtor. You are in control. There is no default overhead.

You even could argue why they didn't make CompareTo() a method in Object. Why did they choose to go for an interface Comparator (IComparator in .NET)? C++ has a similar way of doing it. Not with interfaces, but functors. If you want your object to be sorted, you create a functor, which performs the comparison, and pass it to an algorithm that sorts the collection.

I think I may have drifted quite a bit, but hey.. it is a pvt blog!! Now can any of you verify this?

Drift as much as you like... It's all good.

We discussed casting a while back. Check out the archives. It's pretty much exactly as you said it.

Do you know how it happens in C++?

I would think it's the same, except there is no Object at the top. In Java and .NET, it's ALWAYS there.

I thought this had to do in a Major way with garbage collection too

You might be right, but it would depend on implementation details. When a garbage collection is invoked, it creates a graph of all reachable objects from the roots in the application. It marks all those that are NOT reachable and destroys them. I guess this is called the mark and sweep collector. Maybe during the mark phase, an implementation would change a flag in the objects to say that it is garbage. If this were the case, then, yeah, Object would play a role.

But, I'm skeptical since there are garbage collectors out there for C++ and we all know C++ doesn't have a Unified Type System. Even Java allows for different garbage collectors. So I wouldn't think that Object would play a role in it.

Not sure though, a detailed answer by someone would be welcome.

I'm quite confused about this. I don't think any of us has hit the nail.

Thursday, July 08, 2004

Re: Unified Type System

My immediate thoughts turned to collections... Having a requirement that every class in the system implement a common interface (Object's) makes it possible for collections to be generic enough to be used with anyone.

I was a bit confused about what you are trying to say? Do you mean simple Casting? How is C++ better at handling collections/generics w/o unified type system?


Personally I do not think that Collections were a reason for Object. Object was an initial design consideration, but Collections came in at a later stage. Casting though is a very important factor.

To notice the advantages of Object look at the class itself. Object guarantees that Thread support is provided out of the box with final classes like wait( ) notify( ). Other methods like clone( ) equals( ) getClass( ) and hashCode( ) provide features to be extended by child classes. getClass( ) is important for Reflections. hashCode( ) is important for generating hashcode indices for Collections like Map. Also finalize( ) serves as a Destructor.

Actually I have this picture of how a JVM may work. I have already given you guys lots of dumb ideas and stuff before so one more. I do not know from where I got this idea or if I have mentioned it before. Anyways...

Suppose I have 3 Classes with C extending B and B extending A.
C c = new C( );

And now only one pointer is created on the stack pointing to the new C object on the heap. Something like ..
ptr-----> ((((Object)A)B)C)
stack---> heap

so if I say (B)c;
ptr is used to read data sizeof(B) and that is used to retrieve (rather reconstruct) the instance from the heap.
if I say (A)c;
the same ptr is used to read data sizeof(A) and that is used to get the instance of type A.
And in this way Casting is done.

So I would like to emphasize that one pointer is used which initially points to type Object and this can be 'extended'. In this way the JVM and Classloader have a starting point for any Class which is seems to be a benefit.

I think I may have drifted quite a bit, but hey.. it is a pvt blog!! Now can any of you verify this? Do you know how it happens in C++?

Re: Unified Type System

I thought this had to do in a Major way with garbage collection too. Not sure though, a detailed answer by someone would be welcome.

Dinesh.

Wednesday, July 07, 2004

Re: The C++ Source (C++ future)

One complaint which Java devs have of Swing (Java GUI) is that GUI components like Buttons etc have to be placed within containers and stuff. It is not possible to place components at absolute positions on the screen. Everything has to be relative to other components. How is it in .NET?

Any particular reason they've done that?

In .NET each control is independent of others. You have the option of grouping them together if you want. Each control has absolute position. Before .NET, this could cause some problems. If you expanded the windows, all the controls would stay in the same exact location - it wasn't dynamic in relation to the window size. In .NET, you can assign properties to each control in relation to the window size. You can either have it "grow" when the window resizes or just change location.

Performance of Java vs C++

http://www.idiom.com/~zilla/Computer/javaCbenchmark.html

The actual benchmark isn't the main attraction. The article has several general points that I thought were quite good.

Unified Type System

I came across this question on one software developer' blog I read: "Why is each class in Java implicitly inherited from Object?"

My immediate thoughts turned to collections. Because neither system (Java nor .NET) had generics when they were introduced, without having every class implicitly inherit from Object, it would require a specialization for every possible class to be able to put it in a collection (which is impossible). Having a requirement that every class in the system implement a common interface (Object's) makes it possible for collections to be generic enough to be used with anyone.

I can't think of any other reason. How about you?

We sort of take it for granted that Java (and .NET) has a unified type system. We rarely really think about why it is that way.

Re: The C++ Source (C++ future)

We're all borderline bums so we don't have real work.

I know that. I'm in the same category!!


Anyway, those UI's looked good. It's not impossible to come up with a good UI in Java. The question is how easy is it?

One complaint which Java devs have of Swing (Java GUI) is that GUI components like Buttons etc have to be placed within containers and stuff. It is not possible to place components at absolute positions on the screen. Everything has to be relative to other components. How is it in .NET?


I can't claim to have used many Java client apps. The only one I have used is Forte by Sun. It was an alright experience - not bad, but definitely could be better. It just felt like the app was out of place in Windows.

In Java there exists a concept called LookAndFeel (laf). laf is like a theme/skin. So a skin can be applied to a GUI like Motif, Windows, Metal. As of now Metal is the default cross platform laf. A few more lines of code have to be written to apply the native laf. In Java 1.5 the Win XP and Red Hat laf's have been added.


Is it possible to create a java desktop application that w/o any change will work on any platform?

Simple answer - YES. Any Java app is cross-platform. Unless some native libraries are used, which is very very rare.

Tuesday, July 06, 2004

A Java dev's brain

Sun does have a funny side after all. See insidejack

Sunday, July 04, 2004

Re: The C++ Source (C++ future)

If you guys have no real work; have a look at a few of the better Java desktop applications here.

We're all borderline bums so we don't have real work.

Anyway, those UI's looked good. It's not impossible to come up with a good UI in Java. The question is how easy is it? If it's not straightforward "by default" then regular joe java devs will be putting out awful interfaces. And I guess that's whats been happening. The less expected of programmers the better.

I can't claim to have used many Java client apps. The only one I have used is Forte by Sun. It was an alright experience - not bad, but definitely could be better. It just felt like the app was out of place in Windows. I feel like apps should look like they were made for "my" platform. Each platform has its own features and strengths and the apps should use that. This is the area I feel Java is limiting.

Is it possible to create a java desktop application that w/o any change will work on any platform?

Java's strengths are it's weaknesses and I suppose same for the other languages/platforms.

Can't think of a better way of putting this.

Saturday, July 03, 2004

Linux power

One of the better links from Slashdot HERE

Re: The C++ Source (C++ future)

When you think of Java, you immediately think about server-side code. It's got a bad rap on the client and I don't feel like that perception will change much... not on a large enough scale.

The java community itself has to blame for the mess on the client side. They are doing some stuff on this front but will take time. Java's UI API, Swing is a bit slow. What really caused a mess for java on the desktop is dev's making UI designs. Many crappy, user -'UN'friendly apps were made. I suppose for larger complex UI's designers should be brought in.

If you guys have no real work; have a look at a few of the better Java desktop applications here.

Java has done a commendable job in keeping itself platform independent, but the costs seem to be quite high. There is this lowest common denominator rule it has to follow.

Another valid point. Java's strengths are it's weaknesses and I suppose same for the other languages/platforms.

It's really cool how each of us stuck out for our own lang. These discussions would have been slightly boring if all of us had been on the same side.

p.s. the same side would obviously be Java :)

Open Source Paradigm Shift

Tim Oreilly's (really really long) article on Open Source

Friday, July 02, 2004

Generics v Templates

Comparing .NET Generics and C++ Templates

Good article essentially covering our discussion several months ago. As we had understood, because .NET does the specialization at run-time there is the need for "Constraints". What terminology does Java use?

Re: The C++ Source (C++ future)

Personally I feel managed code will be adopted even more in the future and at a later stage C++ will loose its hold on desktop applications. This will happen sooner in Windows especially after Longhorn. On linux this should take much more time, simply because of mistrust of Java, Sun.

On the Windows front, it's as good as done. As you say, with Longhorn the whole platform is going managed. It will be backward compatible with Win32, so it's not like your C/C++ apps won't work. It will be deprecated. This has already started with .NET. Java introduced managed code long back (and Smalltalk long before that), but only with Microsoft getting into the game will it have a major impact. They control the direction developers take on the client.

Linux on the other hand is a completely different story. I don't think managed code will be successful on non-windows platforms. Linux devs don't trust anything that is not open source. As of now, there isn't (not that I know of) a completely independent open source managed code platform. Mono is heavily associated with .NET and we all know how much the oss community loves Microsoft. C/C++ should rule here for a while.

Another question is much on dev on Win will be done using Java?

I don't see it as having much success on the desktop even with improvements they've made. When you think of Java, you immediately think about server-side code. It's got a bad rap on the client and I don't feel like that perception will change much... not on a large enough scale. If you are developing a Windows app, it wouldn't make sense NOT to choose .NET. You get performance and can access the full capabilities of Win32 if you need to.

Java has done a commendable job in keeping itself platform independent, but the costs seem to be quite high. There is this lowest common denominator rule it has to follow. All functionality has to be the same everywhere. Each platform has some capability unique to it. Java, if not prevents, discourages you from using that. So this is another big debate... Platform independence and lowest denominator or platform specific features.

Frankly, I can see why managed code is becoming such an ally to developers, but I think the most important thing to consider is the fact that there are millions and millions of lines of code in C++ already, where does that go?

This is an important point. Legacy code will always be there. Even when we move on to the next great thing and leave Java/.NET in the dust. I'm sure there's still old Fortran code hanging in some mainframe somewhere that needs to be maintained. But I don't see any new software being developed using Fortran.

I share the same feeling with you regarding C++. It's a wonderful language and will be around for a long time. I just feel like for custom apps it will eventually be displaced. I'm not talking about big applications like Office/Mozilla, system code or OS's. And I don't expect games to move over to the managed world anytime soon either (Although Vertigo manged to port Quake II to .NET and even added new features using Win Forms). I'm talking about apps IT departments develop. The complexity, when compared to .NET/Java is just too high.

They are actually reconsidering the C++ Standard and I think in the next update the Boost library will be included, lets see how far they go to actually "compete" with the others (Java et al), if at all.

I don't ever think that C++ will ever have a monolithic library akin to the Java API or the .NET framework. Having such frameworks makes it super convenient to develop applications cause you'll find more or less everything but the kitchen sink - collections, graphics, networking, threads, UI, etc... But the disadvantage is that you need your clients to have that framework installed. This goes against c++'s "culture". Even the STL (at this stage) is mostly about collections and algorithms. These are something almost all, even the most basic of applications, need. I dunno what their future plans are for extending the standard library, but I doubt it would involve anything that isn't generic.

What dyou feel?