Linked by Thom Holwerda on Thu 14th May 2009 15:39 UTC
Java This article explains how to develop and implement trees in the Standard Widget Toolkit. Learn how an SWT tree is created and populated with data, how columns can be used to categorize data, how a tree can be extended to support row sorting, and how the tree's content can be searched.
Order by: Score:
Article in time,
by boulabiar on Thu 14th May 2009 16:43 UTC
boulabiar
Member since:
2009-04-18

I opened it because this night I should implement trees.

But seeing that it deal with Java SWT, Beeuuuu :-*

I will implement it in Qt anyway, this night and in C++.
(maybe python who knows !)

Reply Score: 0

RE: Article in time,
by marcelkoopman on Thu 14th May 2009 17:29 UTC in reply to "Article in time,"
marcelkoopman Member since:
2007-03-23

I opened it because this night I should implement trees.

But seeing that it deal with Java SWT, Beeuuuu :-*

I will implement it in Qt anyway, this night and in C++.
(maybe python who knows !)


So whats wrong with Java according to you?
Or you just want to show off that you can hack something in C++?

Reply Score: 1

RE[2]: Article in time,
by boulabiar on Thu 14th May 2009 17:52 UTC in reply to "RE: Article in time,"
boulabiar Member since:
2009-04-18

show what ?

Anyway, I don't like Java and its speed disaster.
Some years I heard about an OS written in Java, still alive ? XD

C++ is for robust things, Python is for prototyping this is the best combination !

Reply Score: 1

RE[3]: Article in time,
by FunkyELF on Thu 14th May 2009 18:01 UTC in reply to "RE[2]: Article in time,"
FunkyELF Member since:
2006-07-26

show what ?

Anyway, I don't like Java and its speed disaster.
Some years I heard about an OS written in Java, still alive ? XD

C++ is for robust things, Python is for prototyping this is the best combination !


Look at Jython. They have an excellent tree example. I wrote jython viewer that connects to a database with hierarchical information in like 10 lines (clean and clear) of code. It just showed me the tree structure and printed information when you selected a node.

Reply Score: 2

RE[3]: Article in time,
by marcelkoopman on Thu 14th May 2009 19:32 UTC in reply to "RE[2]: Article in time,"
marcelkoopman Member since:
2007-03-23

show what ?

Anyway, I don't like Java and its speed disaster.
Some years I heard about an OS written in Java, still alive ? XD

C++ is for robust things, Python is for prototyping this is the best combination !

Speed disaster? Come on, please be correct. Java was slow in the beginning of its release. Current JIT compilers are as fast as C++ / native code or even faster in some cases.
Why do you think NASA is using Java instead of C++? Because of pointer bugs. Its not reliable enough.

Reply Score: 0

RE[4]: Article in time,
by boulabiar on Thu 14th May 2009 21:24 UTC in reply to "RE[3]: Article in time,"
boulabiar Member since:
2009-04-18

[q]show what ?
Speed disaster? Come on, please be correct. Java was slow in the beginning of its release. Current JIT compilers are as fast as C++ / native code or even faster in some cases.[q]


So that's why OpenOffice is too fast, and Eclipse is too fast, and netbeans is too fast and JavaEE apps are tooooooooo fast

Reply Score: 1

RE[5]: Article in time,
by Matzon on Thu 14th May 2009 22:14 UTC in reply to "RE[4]: Article in time,"
Matzon Member since:
2005-07-06

dude, OOo is C++!

You are mentioning HIGHLY complex and dynamic applications. QT Creator doesn't even skim the surface of the capabilities of Eclipse & Netbeans.

Stop trolling and get back into your cave, you've obviously been sleeping in it for the last 5 years.

Reply Score: 2

RE[5]: Article in time,
by Savior on Fri 15th May 2009 00:45 UTC in reply to "RE[4]: Article in time,"
Savior Member since:
2006-09-02

Except OpenOffice is written in C++ ;) And Eclipse was waaay faster than KDevelop when I last checked it...

Reply Score: 1

RE[5]: Article in time,
by pmarin on Fri 15th May 2009 07:01 UTC in reply to "RE[4]: Article in time,"
pmarin Member since:
2006-12-30

Probably your computer is toooooooo fast also ;)

Reply Score: 1

RE[6]: Article in time,
by boulabiar on Fri 15th May 2009 07:41 UTC in reply to "RE[5]: Article in time,"
boulabiar Member since:
2009-04-18

OK OK, Java is Faaaaaasst (Forward)

Why there is no java made OS ?
why they use C ?

Reply Score: 1

RE[7]: Article in time,
by Matzon on Fri 15th May 2009 08:55 UTC in reply to "RE[6]: Article in time,"
Matzon Member since:
2005-07-06

come on - read up on things!

There is no pure C/C++ OS either - they all need (some) ASM (I am not aware of register level access from within C - but I could easily be wrong).

Java has no way to execute asm code directly, however it can execute native code via JNI.

Thus you need a VM + JNI to create a Java OS - which is done by the JNode project: http://www.jnode.org/

However, all this aside - creating an OS in a language is not a requirement to prove its performance.

Java IS slower than C/C++ - however, it all depends on the compiler. Java has Hotspot which can do RUNTIME (jit) optimization whereas C/C++ has Ahead of Time compilers/optimizers. This means that c/c++ code will typically be optimized from the beginning whereas java needs some investigations to create the optimum path. This means that during an applications life-span it should (and often do) perform faster in Java.

This is basically what the LLVM project is doing for c/c++ - which means that c/c++ should get much faster, and gain some of the Java-jit benefits.

Reply Score: 3

RE[7]: Article in time,
by giddie on Fri 15th May 2009 09:06 UTC in reply to "RE[6]: Article in time,"
giddie Member since:
2008-04-29

Why there is no java made OS ?
why they use C ?


Don't you think that's a little petty?

* C is a relatively low-level language, which makes it ideal for OS internals.
* C++ is a middle-level language, but inherits all the low-level bits from C.
* Java is a pure middle-level language that completely abstracts away OS details.

We need to accept that different languages are useful for different things. Personally, I don't like Java at all, but I must accept that it has its uses!

Edited 2009-05-15 09:11 UTC

Reply Score: 1

RE[7]: Article in time,
by marcelkoopman on Sat 16th May 2009 08:26 UTC in reply to "RE[6]: Article in time,"
marcelkoopman Member since:
2007-03-23

OK OK, Java is Faaaaaasst (Forward)

Why there is no java made OS ?
why they use C ?

Java OS is jNode.
http://jnode.org/

Reply Score: 1

RE[4]: Article in time,
by adkilla on Fri 15th May 2009 09:44 UTC in reply to "RE[3]: Article in time,"
adkilla Member since:
2005-07-07

The major problem with Java/.Net (or most VMs for that matter) is not its speed, but rather the high memory requirements for initial JIT compiling of bytcodes whenever they are loaded and the GC tuning that is required to develop performance apps with it. A way around the JIT memory requirement is to do AOT. This would however not solve the GC problem and make your Java app non WORA.

The J2ME JVMs tend to interpret code when there isn't enough RAM to JIT compile classes. Some J2ME VMs, like the IBM J9, can accept AOT compiled classes that do not have the JIT overheads, but would only run on CPUs they were targeted for.

-Ad

Reply Score: 1

RE[4]: Article in time,
by l3v1 on Mon 18th May 2009 12:29 UTC in reply to "RE[3]: Article in time,"
l3v1 Member since:
2005-07-06

Current JIT compilers are as fast as C++ / native code or even faster in some cases.


So that's why I hear chantings and chorus performances and whole concertos about JNI in the back of my head whenever I need to code a cpu-hungry algorithm.

Reply Score: 2

v RE[3]: Article in time,
by Bill Shooter of Bul on Thu 14th May 2009 20:17 UTC in reply to "RE[2]: Article in time,"
RE[4]: Article in time,
by boulabiar on Thu 14th May 2009 21:01 UTC in reply to "RE[3]: Article in time,"
boulabiar Member since:
2009-04-18

What's the relation between Win95 and C++ ???

Robust app means app that are written after prototyping phase

Reply Score: 2

RE[5]: Article in time,
by Bill Shooter of Bul on Thu 14th May 2009 22:16 UTC in reply to "RE[4]: Article in time,"
Bill Shooter of Bul Member since:
2006-07-14

No, thats not what "robust" means.

http://en.wiktionary.org/wiki/robust

My point is that in the same way you would not want your heart and lung machine to run an operating system known for its crashes and instability. You would not want to write anything you needed to be robust written in c++.

The robust requirement is a large reason why enterprises switched from cobol to java and never considered c++.

Reply Score: 2

RE[6]: Article in time,
by adkilla on Fri 15th May 2009 09:48 UTC in reply to "RE[5]: Article in time,"
adkilla Member since:
2005-07-07

FYI, there are still many enterprises using COBOL though the mainstream development has moved on to other languages.

Also, critical embedded applications are mostly written in C, not Java or any VM language for that matter.

-Ad

Edited 2009-05-15 09:56 UTC

Reply Score: 1

RE[5]: Article in time,
by Savior on Fri 15th May 2009 00:48 UTC in reply to "RE[4]: Article in time,"
Savior Member since:
2006-09-02

Since when? "Robust" means something that does not break easily. Not one of C's or C++'s strength. When talking about robust, languages like Erlang come into mind...

Reply Score: 1

RE[3]: Article in time,
by dimosd on Fri 15th May 2009 08:06 UTC in reply to "RE[2]: Article in time,"
dimosd Member since:
2006-02-10

C++ is for robust things, Python is for prototyping this is the best combination !


Let me correct a typo, you meant Ruby there, right ;-)

Reply Score: 2

RE[4]: Article in time,
by boulabiar on Fri 15th May 2009 12:04 UTC in reply to "RE[3]: Article in time,"
boulabiar Member since:
2009-04-18

Ruby ?
I don't know much about it ! sorry !

But I know that google uses alot of Python inside

Reply Score: 1

RE[2]: Article in time,
by giddie on Fri 15th May 2009 09:00 UTC in reply to "RE: Article in time,"
giddie Member since:
2008-04-29

There's no point going into a Java vs C++ argument here -- the question is one of toolkit design. Qt is an exceptionally well-designed toolkit (and has Java bindings, remember), but not everyone is fortunate enough to be in a position to use it, and in some situations it may not be appropriate.

Personally, I disliked the design of both the SWT and Swing toolkits when we studied them at university, but if I were required to write something using SWT, this article would be useful, so good job!

Now how about a series of articles comparing widget toolkits -- Qt, GTK, wxWidgets, FLTK, etc...?

Reply Score: 2

RE: Article in time,
by -oblio- on Sun 17th May 2009 20:10 UTC in reply to "Article in time,"
-oblio- Member since:
2008-05-27

Someone is wrong on the Internet!

Dude, think in terms of Economics - what is the added value of your comments? 0 or less ;)

This article is interesting for Java developers. Not interested, skip it.

Reply Score: 1

Article contribution
by adkilla on Fri 15th May 2009 09:27 UTC
adkilla
Member since:
2005-07-07

I would like to contribute articles on writing Qt apps. How do I that? I don't see a contribute link anywhere on this site.

-Ad

Reply Score: 1

RE: Article contribution
by dexter11 on Fri 15th May 2009 10:12 UTC in reply to "Article contribution"
dexter11 Member since:
2008-01-11

Click on "Contact".

Reply Score: 1

RE[2]: Article contribution
by weildish on Sat 16th May 2009 18:58 UTC in reply to "RE: Article contribution"
weildish Member since:
2008-12-06

Either contact one of the editors as suggested, or you may click "Submit News." It's in the top right corner.

Reply Score: 1

...
by Hiev on Fri 15th May 2009 13:42 UTC
Hiev
Member since:
2005-09-27
RE: ...
by adkilla on Fri 15th May 2009 13:56 UTC in reply to "..."
adkilla Member since:
2005-07-07

Every programming language has its warts. None of the them is utter crap.

You might wanna spend some time learning InterCal to appreciate what utter crap would be like!

-Ad

Reply Score: 2

RE: ...
by cb_osn on Fri 15th May 2009 19:01 UTC in reply to "..."
cb_osn Member since:
2006-02-26


C++ is not for everything, nor is it for everyone-- especially with the proliferation of "Java Schools" that pump out graduates who have never heard the word 'pointer' and couldn't write a linked list if their lives depended on it.

But if you take the time and effort required to learn and understand C++, it's a very powerful tool to have at your disposal for those times when it is the best tool for the job.

Reply Score: 2

RE[2]: ...
by Hiev on Fri 15th May 2009 19:47 UTC in reply to "RE: ..."
Hiev Member since:
2005-09-27

I can say C++ is utter crap because I use it and I hate it.

Linked list with pointers? is this 19th century or what?

Reply Score: 2

RE[3]: ...
by cb_osn on Fri 15th May 2009 21:12 UTC in reply to "RE[2]: ..."
cb_osn Member since:
2006-02-26

I can say C++ is utter crap because I use it and I hate it.

And there are plenty of us that also use it daily, and don't find it to be utter crap. Though I am not aware of your situation, so you may have a job that requires you to use C++ in areas where it's not the best option. In that case, I can understand why it would be painful. I get to decide which tools I use, and lately, I tend to prefer C++ for the low level bits, C# for the application level, and Python/Lua for scripting on top of that. This makes the easy things simple and the hard things possible. Taking C++ out of that mix would only cause me more trouble, so I find it to be a useful tool.

Linked list with pointers? is this 19th century or what?

No, but I would expect that anyone graduating with a degree in Computer Science would have some familiarity with the fundamentals of programming, and those would include pointers and basic data structures and algorithms. Unfortunately, this doesn't seem to be the case for a good portion of graduates anymore.

Reply Score: 4

RE[4]: ...
by Doc Pain on Sat 16th May 2009 08:01 UTC in reply to "RE[3]: ..."
Doc Pain Member since:
2006-10-08

"Linked list with pointers? is this 19th century or what?

No, but I would expect that anyone graduating with a degree in Computer Science would have some familiarity with the fundamentals of programming, and those would include pointers and basic data structures and algorithms. Unfortunately, this doesn't seem to be the case for a good portion of graduates anymore.
"

You're right. Take into mind the word "algorithm" - it's much older than the 19th century, but it's essential to understand what is meant by it when you're doing serious programming work. As well as concepts - linked list, stacks, trees, enumerations, arrays, even pointers and memory addresses - that are important, it may be possible that a programmer never has to implement something such basic on his own, but it's neccessary that he understands what's going on "under the hood", so if problems occur (and they usually will), he has a clue about how to solve them. Surely, this is often considered "old-fashioned" or "unmodern" by many novice programmers who know how to click in "Visual BASIC" and consider themselves geniuses. But when you need to optimize code, you're thinking in "old-fashioned" categories like exponential complexity, iteration loops or memory layout.

Furthermore, I agree with your consideration that today's educational concepts in computer science don't seem to put much emphasize on teaching basic concepts. But finally, it's these basics that enable you to understand how things work. But if you're just keen on a BA, MA, Dipl.-Inf. or some other degree that you can show around, while treating your PC as a worse typewriter, it should be sufficient. :-)

Reply Score: 2

RE[5]: ...
by cb_osn on Sat 16th May 2009 09:15 UTC in reply to "RE[4]: ..."
cb_osn Member since:
2006-02-26

it may be possible that a programmer never has to implement something such basic on his own, but it's neccessary that he understands what's going on "under the hood", so if problems occur (and they usually will), he has a clue about how to solve them.

Right. The higher level abstractions provided by languages like Java and C# are useful, but you still need an understanding of what's going on underneath. Otherwise, how do you choose between structures like HashMap and TreeMap or ArrayList and LinkedList?

Surely, this is often considered "old-fashioned" or "unmodern" by many novice programmers who know how to click in "Visual BASIC" and consider themselves geniuses.

Except that today, the "disease" is carried by Java, and it's even worse because the whole thing has been institutionalized by the educational system. I don't blame Java itself-- it's a perfectly fine language if that's your cup of tea, but it is the current tool being used to train an army of programmers who are completely unable to see behind the abstraction.

But if you're just keen on a BA, MA, Dipl.-Inf. or some other degree that you can show around, while treating your PC as a worse typewriter, it should be sufficient. :-)

The only problem with this is that a Computer Science degree has become completely irrelevant as an indicator of someone's level of knowledge in the subject. Not that it was ever perfect, but it did, at one point, suggest some minimal training and understanding of the basic concepts.

Reply Score: 2

RE[6]: ...
by marcelkoopman on Sat 16th May 2009 10:01 UTC in reply to "RE[5]: ..."
marcelkoopman Member since:
2007-03-23

"it may be possible that a programmer never has to implement something such basic on his own, but it's neccessary that he understands what's going on "under the hood", so if problems occur (and they usually will), he has a clue about how to solve them.

Right. The higher level abstractions provided by languages like Java and C# are useful, but you still need an understanding of what's going on underneath. Otherwise, how do you choose between structures like HashMap and TreeMap or ArrayList and LinkedList?

Surely, this is often considered "old-fashioned" or "unmodern" by many novice programmers who know how to click in "Visual BASIC" and consider themselves geniuses.

Except that today, the "disease" is carried by Java, and it's even worse because the whole thing has been institutionalized by the educational system. I don't blame Java itself-- it's a perfectly fine language if that's your cup of tea, but it is the current tool being used to train an army of programmers who are completely unable to see behind the abstraction.

But if you're just keen on a BA, MA, Dipl.-Inf. or some other degree that you can show around, while treating your PC as a worse typewriter, it should be sufficient. :-)

The only problem with this is that a Computer Science degree has become completely irrelevant as an indicator of someone's level of knowledge in the subject. Not that it was ever perfect, but it did, at one point, suggest some minimal training and understanding of the basic concepts.
"

This is complete BS. So Java programmers dont know whats underneath? Come on, the Java API is know by most programmers. Ever thought of Certifications? I'm a Sun Certified Programmer and Web Component Developer. Dont tell me I dont know when I need a HashMap or a TreeMap. I've got a Bachelor degree in Software Engineering, but I also do my certifications so what are you talking about? Also 10 years of experience helps to develop yourself as a programmer.

Reply Score: 1

RE[7]: ...
by cb_osn on Sat 16th May 2009 20:00 UTC in reply to "RE[6]: ..."
cb_osn Member since:
2006-02-26

This is complete BS. So Java programmers dont know whats underneath? Come on, the Java API is know by most programmers. Ever thought of Certifications? I'm a Sun Certified Programmer and Web Component Developer. Dont tell me I dont know when I need a HashMap or a TreeMap. I've got a Bachelor degree in Software Engineering, but I also do my certifications so what are you talking about? Also 10 years of experience helps to develop yourself as a programmer.

It would be helpful if you were to respond to something that I actually wrote.

The fact that I condemn using Java in an educational setting as a means to avoid the difficulties of teaching low level concepts does not in any way imply that I think all Java programmers are incompetent.

More specifically, if you can look at a piece of Java code and understand what's going on underneath, then I wasn't talking about you.

Reply Score: 2

RE[4]: ...
by Denbish on Mon 18th May 2009 17:07 UTC in reply to "RE[3]: ..."
Denbish Member since:
2009-03-25

See that's funny, because if you asked Stroustrup, only using C++ to replace what you'd otherwise be using C for is a huge waste of the immense featureset that C++ provides.

You know what's worse than a Java programmer who doesn't know how to program? A C++ programmer who doesn't know how to program. The usual assumption is that bad programmers won't cut it in C++, but personal experience has taught me that bad C++ programmers are quite plentiful. The sheer destructive power of the bad C++ programmer is unmatched in the world of software engineering.

The other dirty little secret is that unless you're a bonafide expert with years of experience, you're probably a bad C++ programmer.

Reply Score: 1

RE[5]: ...
by cb_osn on Mon 18th May 2009 22:22 UTC in reply to "RE[4]: ..."
cb_osn Member since:
2006-02-26

See that's funny, because if you asked Stroustrup, only using C++ to replace what you'd otherwise be using C for is a huge waste of the immense featureset that C++ provides.

Indeed, it is. There is no reason not to take advantage of function and operator overloading, classes, templates, RAII, the STL, and even the fantastic Boost libraries. In fact, Stroustrup even suggests that the only reason to use C over C++ is when you're faced with the lack of a good C++ compiler.

You know what's worse than a Java programmer who doesn't know how to program? A C++ programmer who doesn't know how to program. The usual assumption is that bad programmers won't cut it in C++, but personal experience has taught me that bad C++ programmers are quite plentiful. The sheer destructive power of the bad C++ programmer is unmatched in the world of software engineering.

Bad programmers are plentiful in every language. That is unavoidable. What I find disturbing is that universities, due mainly to retention and budget problems, have institutionalized the act of creating bad programmers.

The other dirty little secret is that unless you're a bonafide expert with years of experience, you're probably a bad C++ programmer.

It is a large and complex language. I'd say it takes at least a decade of experience with C++, working with it full time on a variety of different projects at different technical levels before you can call yourself a good C++ programmer. And of course, any good C++ programmer has copies of the Scott Meyers books and D&E on their bookshelf.

Edited 2009-05-18 22:29 UTC

Reply Score: 2

RE[3]: ...
by l3v1 on Mon 18th May 2009 12:41 UTC in reply to "RE[2]: ..."
l3v1 Member since:
2005-07-06

Linked list with pointers? is this 19th century or what?


I'd say they'd need to do linked lists with pointers (and somesuch) exactly because it's not the 19th century. Languages - and teaching of them - drives new coders away from basic knowledge, also de-emphasizing knowledge of basic algorithms. The result is a bit frustrating - for me at least it is - since I feel (I work in a research institute with connections to universities) the handicaps they sometimes have because of this, and they don't even know the cause.

And FYI, just recently I had to create a tree structure with pointer node interlinks from the ground up, since no preexisting ones I could use would produce the preformance I wanted, it took me a few hours and it works great. It's not what I do every day, but if the knowledge is there, than it's no problem. If the knowledge is not there, well let me put it this way, sometimes you can't tolerate a few hours of work to go on for days and produce inferior results just because the coder doesn't have the necessary basic algorithmic and coding knowledge.

Reply Score: 2

java
by gfx1 on Sun 17th May 2009 07:41 UTC
gfx1
Member since:
2006-01-20

Problem with java and c++ is that it to complex or the learning curve to steep. Things that are simple in basic
take a long time to implement in java, looked at it for a while to write a little program for my mobile phone, but it is just annoying...

Edited 2009-05-17 07:42 UTC

Reply Score: 1