File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes trivial program definition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "trivial program definition" Watch "trivial program definition" New topic

trivial program definition

Antoine Waugh
Ranch Hand

Joined: Jan 24, 2004
Posts: 66
hey there,
despite having my scjp, and using this term commonly, i would like to know other's definition and interpretation of a 'trivial program'
is it one in which we simply see as straight forward, or its methods are consisted of purely set and get functionality?
all comments welcome!

B.C.S.T, SCJP, Hero
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
In a lot of cases saying it's "a trivial program" is "hand waving". Usually because the speaker cannot define the problem even. Even simple problems give rise to non-trivial programs. What's trivial to you may not be trivial to me (and vice versa). Or even trivial to you again 6 months later.
I would perhaps use the term for a "throw-away" program, that is use once, use its result, and forget it:

Could do it in less using Python
[ May 12, 2004: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11817

That's the thing about trivia - if you know it, it's trivial. if you don't, it's hard, irrelevant, impossible, dumb... I got to a lot of "trivia nights", and hear this sort of thing ofter.
Java is the same way. a "helloWorld" program would not be trivial to my wife, who has no java (or any programming language) skills, but it is to me.
I know a guy who would consider implementing a database transaction manager as trivial, whereas i would have no idea where to start.
I guess my point is that i don't think there is (pardon the pun) a trivial answer to your question.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Antoine Waugh
Ranch Hand

Joined: Jan 24, 2004
Posts: 66
i completely agree with both your responses;
and i helped a friend doing his Bach Comp. Sci with a java project. It claimed that 1 of 3 classes handed in was 'trivial'; and thus he was unable to acheieve a distinction.
My argument is:
If a class/objects fulfil their criteria, and purpose, then there is no need (even in an acedemic sense) to make things more complicated than they need to be.
Understandibly if a solution is handed in which is 'trivial' for most java programmers, i.e. too simple; then i agree with the criteria limiting that person to a pass mark maximum. However, if the assigned problem is 'trivial' in the first place; there is only a degree to how complex you can make it, before breaking fundamental oop techniques and ideology.
Thanks for your responses, and i am in complete agreement. If only the University of Sydney saw the difference between a working solution and that of a 'trivial' one.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Trivial may mean not complex enough to warrant certain levels of design or object quality. Or is that throwaway?

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: trivial program definition
It's not a secret anymore!