0

I'm still in university at the moment, and I'll likely either try to get security or programming job. My first programming course used a custom library that came with the book. It replaced and added many of the basics of Java like Arrays, completely custom math functions, input (scanner), Hashmaps, Queues and Stacks.

If I did land a programming gig, is it considered unprofessional to use a given custom library such as the one above? Either way, I've pretty much weaned myself off of 75% of the custom classes in favor of standard Java classes/objects, but I wanted to know if slipping in a premade class from a textbook is frowned upon. Thanks guys.

rice2007
  • 115
  • 12
  • So long as you don't base all your code on some random's library (which you may not be legaly allowed to use for commercial purposes) then in most cases you should go ahead and use them. Sometimes however you may not even have control over what libraries get included in a project and be limited to an specific package or set of classes you can touch. Also as chrylis said, you should check if the functionality provided by those libraries isn't already provided by some large popular API which does the job much better – 0x6C38 Sep 04 '13 at 00:51

2 Answers2

3

"Custom library" is too broad a category to be useful. Libraries that reimplement functionality that's standard in the JRE, such as the Collections API, are almost certainly useless, and probably did more harm than help in an educational setting. However, there are a large number of tools, particularly Google Guava (enhanced collections like multisets and bimaps), the Apache Commons tools (including string parsing, hashCode building, and the like), slf4j/log4j for logging, and runtime environments such as Spring that are basically standard in the industry.

The general principle is "don't reinvent the wheel". If you have an example class out of a textbook that gets a basic job done that isn't in the standard API or one of the de facto standard third-party libraries, by all means use it, but don't prefer some professor's half-baked and untested implementation to ones that have been in use by thousands of developers for years.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
  • Ah, I see. Thanks. The javadoc leaves something to be desired, so I'm guessing it would be good form to edit the javadoc (provided that it is allowed by the publisher) so that if it is used, it is readily understood. – rice2007 Sep 04 '13 at 01:42
  • Especially make sure that it's not reimplementing something that has an industry standard. For example, if there's a standard interface (such as one of the Collections interfaces, `List`, `Map`, and so on), then all of the tools out there will be expecting the standard one and not your non-standard linked-list API. – chrylis -cautiouslyoptimistic- Sep 04 '13 at 03:47
0

Good programmers write good code, excellent programmers find excellent code.

If your library is any good I suspect it's more a case of everyone grabbing a copy.

Chris
  • 342
  • 1
  • 5
  • "Good artists copy great artists steal" – 0x6C38 Sep 04 '13 at 00:44
  • I think that it pretty air tight. I'm obviously not an expert, but I've tried to copy and paste it into other code that I've written with the Standard Java API. So far, so good. – rice2007 Sep 04 '13 at 01:41