Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I like to think I write good maintainable Java code, using best practices, design patterns and try and get good test coverage with unit tests.

Recently whilst looking for a job, I came across a couple of job adverts that have references to "scalable" code.

So, my question is, what is considered to be "scalable" code?

share|improve this question

marked as duplicate by Robert Harvey, GlenH7, gnat, MichaelT, Blrfl Apr 15 '13 at 18:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Using a matrix? Haha, I kid. – Richard J. Ross III Apr 15 '13 at 17:57
What they probably mean in the adverts is code (that is part of a larger program, probably a web site or web service) that can handle an increasingly large number of users without falling down. – Robert Harvey Apr 15 '13 at 18:05
Correct answer: You cannot write scalable Java. – bobobobo Jan 7 '14 at 18:25

As Robert mentioned in a comment, what they mean is that the software performs well under increasing volumes of load.

Any programming language has potential for code that performs or scales well and code that performs or scales poorly.

However, Java is an interesting language to be picky about in regards to scaling perhaps because of its popularity and low barrier-to-entry.

I see two reasons to be concerned about developers who claim expertise in Java but make poorly performing or poorly scaling software:

  • Commonly taught - every IT, SE and CS curriculum that I have seen teaches Java first. At least in the US, it's the de facto programming 101 language. Not a bad idea since it teaches the basics of control flow such as loops, functions, arrays, I/O etc. and allows for a "warming" into OOP.
  • It is popular and heavily marketed.

One of the dangers of garbage collected languages is that you do not need to understand how a computer works to make software with it. You can even make software that performs fairly well without understanding memory management, CPU registers, GC algorithms, etc. these days. However, if you want the software to scale, you need some understanding of these concepts (not necessarily an expert however).

For example, you write code that selects a bunch of data from a database table and then load it into an ArrayList in Java. You try it in development and it works great. Try it in QA, it works great. Run it in production where the table has 2 million rows instead of the 10 rows from development and 2,000 users are selecting from it at the same time, suddenly your database CPU spikes up and your app servers run low on memory. How would you handle this?

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.