Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Low-level functions & Top-level functions? [closed]

I need to understand the following sentence: "Charles Simonyi introduced the idea of organizing really big software teams by creating one super duper uber programmer writing the top-level functions, while handing off the implementation of the lower-level functions to a team of grunt junior-programmers as needed. They called this position program manager."

  1. I want to know what are the Top-level functions
  2. What are the lower-level functions?
  3. How can a program manager easily spot Top-level and Lower-level functions?
  4. Can you provide Javascript examples of Top-level and Lower-level functions?

BTW, the quote above is taken from Joel Spolsky, extracted from his blog about How to be a program manager.

like image 706
Richard Kevins Avatar asked Mar 11 '09 07:03

Richard Kevins


People also ask

What are low level functions?

The low level functions are the functions in your program which don't call any other functions that you have written (but use the operating system or framework to compute their results etc).

What's a top level function?

These are functions that exist outside of any class, object, or interface and are defined directly inside a file. The name top-level comes from the fact that functions are not nested inside any structure and so they are at the top of the hierarchy of classes and functions.

What is low level file in C?

In low-level I/O functions a file descriptor is used to identity a file for all subsequent read or write operations. Low-level I/O functions are used for: Accessing files and devices directly.


1 Answers

The closer it is to human language, the higher-level the function is.

The closer it is to machine language, the lower-level the function is.

I'm simplyfying but here are some examples:

High level functions:

Car.Start()
Car.MoveTo(Home)

Low level functions:

Car.Insert(Key);
if (Car.IsKeyInserted() == False)
   return False;

Car.StartEngine();
Car.ApplyAccelerator(0.1f);
Car.ChangeGear();
Car.RotateWheel(-25);
like image 172
MrValdez Avatar answered Oct 20 '22 10:10

MrValdez