我想知道低级函数和函数之间的区别。顶级功能 [英] I want to know the difference between Low-level functions & Top-level functions
问题描述
我想知道什么是顶级职能,我该如何识别它?我的语言是Javascript。到目前为止,这是我唯一知道的语言,因此请给我使用JavaScript的示例。
顺便说一下,上面的报价取自Joel Spolsky。查看他的博客并阅读如何成为程序管理员。
谢谢
与人类语言越接近,函数就越高。
越接近机器语言,函数的底层。
我很简单,但这里有一些例子:
高级函数:
Car.Start()
$ p $
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屋!