Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I start a year long industrial placement in September where i will be coding in Java predominantly. I am going to use the summer to brush up on my Java as in year one of the degree Java was the main language taught for OOP modules. However this year i have had no Java exposure except for an algorithms module, which was one of eight, so as you can see i am probably getting really rusty!.

What i wanted to know is, how does the "real world" java programming differ from university coding and what do you suggest i brush up on that would be different to my normal workings. As a start I definitely need to get familiar with a professional IDE like NetBeans, opposed to having used BlueJ throughout but more specifically what coding practices should I get more familiar with.

I appreciate they wont expect me to be a qualified full developer and will give me time, but I would like to hit the ground running as it were, with me having full hopes to secure a permanent position after I finish my degree.

share|improve this question
7  
May I just add, in addition to all the good answers below, don't be too surprised if you get out there and your company is doing none of these good, best practice things, but instead have a few, many thousand line long 'utility' classes that do everything. If this happens, don't despair and give up, it's all good experience... – Paddy May 24 '10 at 15:59
@Paddy great comment there! How can we forget those Utility classes! ;-) – MalsR Mar 9 '12 at 17:36

migrated from stackoverflow.com Dec 6 '11 at 22:22

14 Answers

up vote 12 down vote accepted

how does the "real world" java programming differ from university coding?

The main difference is not necessarily technical (those are obvious - heavy use of database backends, the need to re-use existing codebase/libraries) but more "social":

  • Working on teams. This includes great need for clear communication.

  • Importance of code maintainability.

    IIRC 90% of effort is spent on code maintenance (don't have a cite now).

    That means that you will be working on existing codebase - and more importantly, that other people will be working on what you write.

    So readability of your code is paramount - comments, documentation, clear code, lack of overly-clever-but-confusing hacks, using accepted coding styles even if they are different from what styles you learned on your own or from school.

    To practice for this: Read up on hwo to make your code readable/maintainable. Take an existing project and try to read/understand how it works and update the code in some way. Ask a peer (or better yet someone in the industry) to review YOUR code and critique - both as a way to understand your weaknesses AND as a way to practice for code reviews at work... some people don't really know how to handle criticism of their code all that well.

  • Business requirements (you need to do things that the user will find needed, not what you find technically exciting).

  • Importance of thorough testing/QA.

share|improve this answer
thanks dvk - are you a qualified developer now (ie student or not student) and if you are, what do you find the most common problems that apprentices/ industrial trainees find (or cause!) when they do work placements. – simion May 24 '10 at 14:33
9  
Obvious jokes aside (I'm always learning!!!), i've been working as a professional software developer for many years. Most common problems usually stem from either not asking questions when needed (misguidedly too afraid to appear stupid), or not putting enough effort in research (e.g. google for some simple problem, and bother everyone with trivial stuff. BTW, this is not in conflict with the last point - the problem is not asking someone, it's not bothering to try and find the answer yourself first). Second most common cause of problems is not putting enough effort into testing/QA. – DVK May 24 '10 at 14:41
thanks very much for the info :) – simion May 24 '10 at 14:46
+1 Since I felt that this is probably the thing I missed the most in my university studies (no wonder since it is the hardest to teach). I'm still learning, not only the technical aspects of being a developer, but also the social and collaborative aspects of being a part of a team of developers, testers, project manager(s), requirement engineers etc. Good advice. – daft May 24 '10 at 14:52

Start by reading SCJP Sun Certified Programmer for Java 6, you don't have to read it from cover to cover, when you feel comfortable enough try to work on some problems from Euler or ACM. Don't spend too much time on those, they are good for building problems solving skills.

Then find yourself a real world problem, ex: try yahoo weather service api, read a stackoverflow atom feed, parse any xml, read in/out to files, interact with database(CRUD) read books(spring, jboss(messaging), persistence, ORM(ex: hibernate), browse SO questions they are very good for learning).

Also try to get familiar with maven or ant, will make your life easier, try to learn to write junit tests from the start(unlike me).

Don't expect too much at first, I'm about 7 months into Java and I'm still learning new things almost every day(noob). Good think we have SO :D

Don't give up. Everything has a learning curve.

UPDATE

Since you say you learn about OOP, I assume you're CS student, learn data structures well(they always come handy), I'd recommend this book(now its 4th edition, but I have 2nd from my uni days).
I read it again just the other day. It explains not only the data-structures but also some algorithms that go along ex: sorting algorithms hence the title.

share|improve this answer
1  
@Pascal Thiven thank you, I picked up this "learning curve line" from you, and you were right. btw what does pad mean? – c0mrade May 24 '10 at 14:46
2  
@c0mrade, thats padding for the minimum 15 chars requirement for comments. – Zaki May 24 '10 at 14:48
2  
A character used to fill empty space (so that I reached the 15 chars limit). – Pascal Thivent May 24 '10 at 14:51
2  
A practical proof that Joel was right - developer will find a way to game ANY performance metrics, even the minimal limit on comment length :) – DVK May 24 '10 at 15:12
3  
Our svn requires a commit comment of at least 10 characters, or else it errors out with "You're a bad developer". Some developers have resorted to putting "No I'm not" instead. – corsiKa May 24 '10 at 15:25
show 3 more comments

Things they never taught me:

  • Building: Code has to be built in a very complex manner. Dependencies, classpaths, using Ant scripts and other forms of build scripts, it's all very complex. I would recommend getting to know Ant.

  • Application: A lot of the code you write, if it's a larger company, will be based around enterprise Java. This means getting to know Servlets, JSP, etc. If you think they might be asking you to do that, consider going through tutorials on how to do JSP, some Javascript, download Tomcat and MySQL and the like. Use these tools to make a small, functional, persistent website. Using the Servlet API will help a lot. A lot of enterprise software works through a web interface (even if it only ever sees an internal network.)

  • Testing: Good firms spend a lot of money on testing their code. Familiarize yourself with JUnit. Make unit tests for your projects. Incorporate those tests into the Ant script that builds everything.

  • Deployment: The code doesn't do much good if it only runs on your machine. Familiarize yourself with how the code is going to get installed on other machines, like a web server. Consider doing this, again, with Ant.

These are just a few things that I wish I would have known going into development. I had no idea about these things. All the Java tricks in the world would have perpared me for these hurdles.

share|improve this answer
3  
If your university skipped over the complexity of building (in general) they did you a disservice. My training was in C with Make, but the theory holds. – C. Ross May 24 '10 at 15:18
We did some small stuff in make, but it was very basic. Now granted I learned a lot of very important things (Good multithreaded design, for instance is something very difficult to get your brain around.) – corsiKa May 24 '10 at 15:23
1  
I haven't heard of any Unis teaching much(any) about building - at least lately. I know mine doesn't (at least so far halfway through my junior year+.5) – Wayne Werner May 24 '10 at 15:32
We did learn a bit about building in a C++ course I took in college, but the complexity of builds in an enterprise were definitely not explained in my classes. I quickly learned Ant when I entered the "real world." – JasCav May 24 '10 at 23:50

Don't overlook practicing Version-control. It's not as glamorous as coding and it is normally ignored in college curriculums.

Most large shops already use some form of source control. You'll do yourself a major favor by being familiar with the basics like check-in/check-out, locking vs merging, version comments, commits, branching/merging, etc.

Start with do you really need version control? Many feel that you should be using version control from home development. As with any tool, it is possible to overuse version control so it helps to understand the pros and cons. That being said, there are still places where version control can be useful outside of the traditional programming code-base, e.g. database definitions, application configuration, etc.

Before getting heavy into the theory of version control, Stackoverflow has many good questions covering the subject to get you started.

Getting Started

http://stackoverflow.com/questions/2658/version-control-getting-started
http://stackoverflow.com/questions/1469623/a-few-basic-version-control-questions
http://stackoverflow.com/questions/1044700/a-good-video-to-explain-version-control
http://stackoverflow.com/questions/3859/what-is-the-difference-between-all-the-different-types-of-version-control
http://stackoverflow.com/questions/8747/learning-version-control-and-learning-it-well

How do I ...

http://stackoverflow.com/questions/1710027/can-should-i-put-3rd-party-libraries-in-version-control
http://stackoverflow.com/questions/1974886/how-to-version-control-config-files-pragmatically
http://stackoverflow.com/questions/1141529/best-practice-in-storing-non-source-files-under-version-control

Advanced topics

http://stackoverflow.com/questions/1714925/version-control-and-release-management
http://stackoverflow.com/questions/100162/what-is-your-tool-for-version-control-faq
http://stackoverflow.com/questions/460022/preferred-version-control-methodology
http://stackoverflow.com/questions/559332/why-should-my-team-adopt-source-control
http://stackoverflow.com/questions/954242/how-important-is-version-control-integration-with-your-bug-tracking-software
http://stackoverflow.com/questions/1141529/best-practice-in-storing-non-source-files-under-version-control
http://stackoverflow.com/questions/1142580/good-link-or-book-for-basics-and-theory-of-version-control
http://stackoverflow.com/questions/338469/is-version-control-about-deployment-history-or-development-history
http://stackoverflow.com/questions/1646120/what-is-the-difference-between-configuration-management-and-version-control

share|improve this answer

Practice coding

Start writing a lot of code to get used to. One the one hand, coding contests like spoj.pl or Euler might be good, on the other hand, write your own application with some buisness logic behind, i.e. a tool for organizing your DVD collection.

Read books

Read good books about Java, like:

  • Effective Java 2nd Edition Java
  • Concurrency in Practice

Read also books about software engineering in general, like

  • GoF Design patterns
  • etc.

Read code

Have a look at different open source projects, read the code, understand the principles and ideas behind.

Have a look at the tool box

Get used to sophisticated IDEs like Eclipse, but also to source code management, versioning tools, unit testing etc.

share|improve this answer

How does real-world coding differ from school coding?

I think the biggest difference is: In school you get straightforward, well-defined problems. In the real world, you get messy problems with lots of special cases and exceptions.

For example, I recently had to work on a program where the warehouse people would scan items in the warehouse while taking inventory, and then we'd match this against what the system thought should be in the warehouse to give a discrepancy report. In a school problem, I'm sure you would scan some sort of stock number and that would be the end of it. But in real life, we have four different types of identifying number that we had to scan. Then we had to figure out which of the four types it was by studying the format. Like, one type of ID number always ends with a hyphen, 3 digits, another hyphen, and 3 more digits. Another type of ID has no hyphens and always includes at least one alpha character. A third type is all digits. Etc. Oh, except for the first type, when the number is too long to fit on the label they leave out the second hyphen. Etc. So as we scanned each item, we had to count the number of hyphens, see if it included any digits, etc. to try to guess which type of ID it was.

In another problem I worked on recently, we had a transaction type code that identified whether a transaction was a basic sale record, a discount of some kind, or various other special cases. Straightforward enough, you might see that in a school problem. Except one of the codes had two completely different meanings, and the only way to tell which it was was to look at its position on the sales receipt and see if it was listed before or after delivery charges.

I assume that school problems tend to be neat because the point is to make sure that the student understands how to use a SQL JOIN or a Java ArrayList or whatever, and not to slog through a long list of confusing requirements that the teacher would have to make up just to make the problem difficult. That's fine. But in real life, problems aren't invented to test your knowledge of a language feature but to meet some business requirement. And in real life, those requirements often include having to deal with inconsistent inputs coming from many sources, coping with bad design decisions made by somebody who quit five years ago, etc.

What you need to know to get a job

In real life, knowing how to solve real-life programming problems doesn't necessarily help you get a job. What helps you get a job, especially that first job, is being able to say that you know X and Y and Z. Like if you're looking for a Java programming job, you want to be able to say that you know servlets and Swing and Struts and Hibernate and as many such frameworks and tools as you can. Play with them enough that if you are quizzed on them you can give coherent answers. Read "Design Patterns" and make sure you thoroughly understand at least several of the patterns described. Questions about this book came up a lot the last time I was going on interviews. Know the difference between "waterfall development", "agile development", and "test-driven development". Basically, look at want ads and see what they say they want you to know, and pick at least a few of those things and learn enough about them that you can check those boxes.

This may or may not help when you're actually on the job. But you have to get the job first.

share|improve this answer

First thing download Eclipse IDE. (it's the most used IDE for Java developers)

Second, start your own project, think about a large project, like a business/accounting application with database connections, reports, GUI ..etc.

share|improve this answer
I would suggest doing a more "fun" project, like a network based game or something... – aioobe May 24 '10 at 14:28
@aioobe, I agree but domain knowledge in finance,accounting etc. won't hurt. – Zaki May 24 '10 at 14:33
2  
so combine the two and make a network based game of finance... to the death! (because games to the death are so much more fun) – Wayne Werner May 24 '10 at 15:34
haha, nice comment @Wayne. @aloobe, I half agree, I have made few games myself, and many network business projects. The outcome from business projects is generally more useful in the market. – medopal May 24 '10 at 19:45

If you really want to increase your knowledge and practical experience in any language, joining an open source project in an area that interests you can have great benefits for you and the project.

share|improve this answer

Yes you should definitely install and run Netbeans. But switching from something like BlueJ to Netbeans is not that easy in most cases. So you might want to use the BlueJ plugin for Netbeans to help you switch to Netbeans.

share|improve this answer

Robustness

This is the single most important feature of the code that is absolutely required by production code, and that doesn't matter much in an academic setting.

Academic code? Well, you run it and when it is done it is done. Next thing. If you see it crash you fix the problem and run it again.

Production code? You need something that can run for very long time without human intervention, and which can survive whatever happens to be thrown its way so that service can continue reliably as well as notify appropriately. This has a very strong influence on how you write code, because you cannot just say "This will never happen, no need to handle" because some day it will, and it usually happens at 03:00 in the morning and be very expensive to the customer.

To me the change in mindset to write that kind of code, was the biggest difference.

share|improve this answer

Most of all real work solves someone's real problems. It may very often be tedious and not-that-exciting, but at the end of the day - you've done something that someone actually needs. Most university programming exercises revolt around mathematics - and although they are fun, there aren't particularly helpful.

On a real project one needs to pay more attention to readability, maintainability, style, performance, error checking and handling. It cannot be described with words, one has experience it for himself...

share|improve this answer

The biggest thing that they're expecting is for you to to be familiar with the Java library. You should pick up and study books such as the Java Cookbook. The Java library is huge and they will not want you to reinvent a single thing.

Find and participate in some local "code camps" or "code retreats", preferably Java. You'll be peer programming, so you'll have an opportunity to be mentored.

Besides that, I think the most beneficial thing would be to become a domain expert. Learn as much as you can about the company and industry that you will be working for. This will save them tons of time in getting you up to speed.

Also, learn everything you can about the technologies that they are currently using. Are they using Oracle? Tomcat? JBoss?

share|improve this answer

I find Peter Norvigs article Teach Yourself Programming in 10 years useful.
Always try to get better and it will take some time to get there.

share|improve this answer

Start to learn J2EE if you haven't. Things like JSP/Servlets, JDBC, EJB, Web Service.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.