Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

0, 1, Many, a Zillion

DZone's Guide to

0, 1, Many, a Zillion

· Performance Zone ·
Free Resource

Sensu is an open source monitoring event pipeline. Try it today.

There are only four numbers in computer programs:

0, 1, many, "a zillion"

If you have 2 or more of anything, you are, in general, better off using loops to process many of them.

But what is "a zillion?"

Zillion is a made-up number. Your system cannot hold a zillion items in memory. It cannot show a zillion items on the screen.


Doesn't work for "a zillion":

Select employee name:

Doesn't work for "a zillion":

def handleFiles( filenames: Array[String] ) {
    val results = openFiles(filenames).readAll().processAll()
    results
}
* The program first opens all the files, and then processes them. The OS will run out of file handles.

Doesn't work for "a zillion":

Changing software from handling "many" to "a zillion" is hard if the program is already written.

Decide when to you need to handle a zillion.

Sensu: workflow automation for monitoring. Learn more—download the whitepaper.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}