Take the 2-minute tour ×
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.

The descriptor 'Engine' gets thrown around a lot: graphics engine, RegEx engine, AI engine, etc. but what actually makes a piece of software an Engine? Design, Input/Output, Purpose, Size?

share|improve this question
60  
The marketing department. –  Oded Sep 15 '11 at 19:41
2  
@Oded: term 'engine' is commonly used by programmers themselves. Try to find alternatives and you'll see why. –  MaR Sep 16 '11 at 9:15
1  
an engine is what makes the wheels I don't want to be reinventing turn –  Flexo Sep 16 '11 at 11:14
    
@Flexo, so - a library? –  Vorac Sep 9 '13 at 10:08
add comment

7 Answers

up vote 27 down vote accepted

An engine would be something that is "under the hood", so to speak. It is not, or at least very rarely is, visible to the end user. A graphics engine, for instance, drives all the rendering calculations but passes those changes on to the actual environment to be modeled. Input: math. Output: pretty colors. An engine might also have very different working variables than a more high level interface. For instance, in the previous example, it is using raw numerical data to manipulate graphics without worrying about whether something is a shadow or a texture, all of that is abstracted into the equations and matrix operations to be performed by that engine. Think of the Engine as the "Kernel" of a given system while the rest would be more like the "Shell".

To use a real world, CS101 analogy, an engine is just like a car engine. It takes two inputs, air and gas. It then passes them into a chamber, whereupon electricity is used to generate the world's smallest use of arc welding. Stuff then explodes. This produces two outputs, exhaust and a pressure wave which drives a piston. The rest is transferred into wheel motion by the various drive shafts and such. So the Engine is the engine and the car itself is the shell. You could use a car engine for a different purpose, say driving a generator for electricity or a mill to grind grain. You could use different inputs if the Engine has the coatings and such to handle things like ethanol or biodiesel.

To sum it up, an Engine is a piece of software that is usually not found in isolation. It acts as motive force for that piece of software but typically interacts very little if at all with the outside world. Several engines may work together to produce complimentary outputs or may be pipelined together as needed. An engine does not do things related to user experience in an aesthetic sense directly but drives those experiences none the less by motivating dataflow and being responsive enough to allow for good application performance.

share|improve this answer
8  
So a driver is the tool that controls the engine & crashes the shell? –  MikeJ-UK Sep 16 '11 at 9:06
    
i really liked and benifited from your answer but i think the question was more about how to now this piece of code/software should be called a library or API or engine ? if you can add explaination for this as well it will be perfect answer –  Ali Sep 8 '13 at 7:00
    
Libraries and APIs operate at a different level than an Engine does. Better to keep it focused on the term at hand than diverge into a potentially endless sea of variations and names. –  World Engineer Sep 8 '13 at 7:08
add comment

The definition of engine is

noun /ˈenjən/ 
engines, plural

  1. A machine with moving parts that converts power into motion

  2. A thing that is the agent or instrument of a particular process

#1 is the semantic equivelant to engine in the software sense that it causes something to happen. 3D Graphics Engine, takes inputs and converts that to motion on the screen. A regex engine takes inputs and converts them to a different output.

#2 is like using the sentence an engine of change. This semantic can be applied to software as well.

Software engines are more than frameworks and libraries that passively do things. Software engines act on their own based on inputs, they are not passive, and usually have their own run loop to do processing on their own volition.

share|improve this answer
add comment

Engine is anything that takes some input, process that input, and delivers something as output. By this definition, a CMS engine is the part which generates the HTTP response on the fly based on the input. A database engine is what takes the query, draws an execution plan, and the executes it, and returns result.

Technically speaking, even a cow is a kind of engine. It takes grass, processes it, and delivers milk.

Don't forget that the term engine is more used in Mechanical engineering, and it does exactly the same.

Another aspect of an engine, is being the core of a system. For example, database engine is the core of any RDMS. However, IDEs to connect to that engine, while taking input and returning result, is not considered an engine.

share|improve this answer
5  
+1 for the "milk engine", I was eating yoghurt and nearly choked on it when I read that. ;) –  FrustratedWithFormsDesigner Sep 15 '11 at 20:06
4  
Your definition would make every function an engine. –  back2dos Sep 15 '11 at 20:34
    
Not every function is a function of its inputs. –  Michael Burge Sep 15 '11 at 21:15
    
I have to agree. Your explanation sounds a bit blurry and arbitrary. –  Yam Marcovic Sep 15 '11 at 21:36
1  
A programmer is an engine too. It takes coffee on input and produces code on output. –  SF. Sep 15 '11 at 22:18
show 1 more comment

IMHO, an engine is just another word for subsystem, module, or library. I.E. - one or more components cohesively designed for a specific purpose.

share|improve this answer
2  
downvoters: please elaborate. That an engine (e.g, the Quake Engine) is a subsystem, a module, or a library is not obviously false. –  keppla Sep 16 '11 at 8:49
3  
While engine is implemented typically as a subsystem, the term is commonly used only for subsystems "under the hood". They are not used as synonyms. –  MaR Sep 16 '11 at 9:30
add comment

The closest answer so far, in my opinion, was the one that said it's a marketing thing.

Let's try to think where the use of the word in this context came from.

Certainly car or jet engines aren't called that way because they take input and produce some output. If that were it, then not just functions, but many things in life would be engines.

It's not by coincidence, in my opinion, that a cow is most definitely not an engine, not technically speaking, and not in any sane way of speaking.

Engines use various types of energy and turn it into motion (i.e. a specialized type of energy).

Why do we use it in software? I'd say the most realistic guess is because it simply sounds cool. Why do we call some programmers 'Architects'? Same reason, if you ask me.

Another reason could be that programmers generally like to use metaphors to describe parts of their software, so they could be easier to grasp (because naturally the're often not).

My hunch is that it's bad practice to abuse metaphors in such a way that your application domain is full of them. I think it could be useful when talking to clients, or people who don't know or care about programming. Other than that, simple flow charts and diagrams do the job for me.

share|improve this answer
add comment

An engine is basically software that can be extended to create something.

For example, in gaming, you'll hear a lot about 'something' game engine. This means a particular software was modified and extended to create a totally unique game.

share|improve this answer
add comment

At my job the term seems to mean "A single code file in the format XEngine.cs with multiple classes inside that code file, all of which contain nothing but static methods". I throw up a little inside every time I look at it; might as well be a VB6 module.

I personally wouldn't use the term, it's ambiguous and meaningless (unless, I suppose, you're writing software that simulates an automobile or perhaps a racing game) in most cases; it's like the old "Manager" classes of yore - the name tells you nothing other than "This does a lot of stuff" and usually that means it's a gross violation of SOLID.

share|improve this answer
add comment

Your Answer

 
discard

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

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