我想知道低级函数和函数之间的区别。顶级功能 [英] I want to know the difference between Low-level functions & Top-level functions

查看:162
本文介绍了我想知道低级函数和函数之间的区别。顶级功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Charles Simonyi提出了通过创建一个超级超级超级程序员编写顶级函数来组织真正的大型软件团队的想法,同时根据需要将低级函数的实现交给一群低级程序员,他们称之为职位计划经理。



我想知道什么是顶级职​​能,我该如何识别它?我的语言是Javascript。到目前为止,这是我唯一知道的语言,因此请给我使用JavaScript的示例。

顺便说一下,上面的报价取自Joel Spolsky。查看他的博客并阅读如何成为程序管理员。



谢谢

与人类语言越接近,函数就越高。

越接近机器语言,函数的底层。



我很简单,但这里有一些例子:



高级函数:

  Car.Start()
Car.MoveTo(Home)


低级函数:

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

Car.StartEngine();
Car.ApplyAccelerator(0.1f);
Car.ChangeGear();
Car.RotateWheel(-25);


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."

I want to know what are the Top-level functions, and how can I identify it? My language is Javascript. So far that's the only language I know hence please give me examples using JavaScript please.

BTW, the quote above is taken from Joel Spolsky. Check out his blog and read How to be a program manager.

Thanks

解决方案

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);

这篇关于我想知道低级函数和函数之间的区别。顶级功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆