More descriptive way to declare and use a method in programming languages

At present, in most programming language, a method is declared in few parts:

keyword, method name, method parameters and return type etc.

E.g.

function int add(int a, int b)
\\ The way to use it:
int r = add(2, 3)

new way: Natural language style method declaration and usages in programming languages

idea

The idea is to split a method name into multiple parts, and put parameters before/between/after these name parts.

Example 1:

function int (int a)add(int b)

\\ usage:
r = (2) add (3)
\\ or
r = 2 and 3

Example 2:

function void save(Employee employee)with(EmployeeSaveOptions options)

\\ usage:
save(employee)with(options)
\\ or
save employee with options

Example 2:

function (int a)add(int b) result is (return int) 

\\ usage:
int r = (2) add (3)
\\ or
int r = 2 and 3
\\ or
(2) add (3) result is int r

Explanation

  • For each parameter part, it may includes 0+ parameter(s).
  • For return data type, we may use parameter style with a keyword return inside, e.g. result is (return (DataType))

Advantage

The new way makes code is more readable.

Natural language style method declaration and usages in programming languages的更多相关文章

  1. 如何将 Cortana 与 Windows Phone 8.1 应用集成 ( Voice command - Natural language recognition )

    随着 Windows Phone 8.1 GDR1 + Cortana 中文版的发布,相信有很多用户或开发者都在调戏 Windows Phone 的语音私人助理 Cortana 吧,在世界杯的时候我亲 ...

  2. Natural Language Processing with Python - Chapter 0

    一年之前,我做梦也想不到会来这里写技术总结.误打误撞来到了上海西南某高校,成为了文科专业的工科男,现在每天除了膜ha,就是恶补CS.导师是做计算语言学的,所以当务之急就是先自学计算机自然语言处理,打好 ...

  3. Deep Learning for Natural Language Processing1

    Focus, Follow, and Forward Stanford CS224d 课程笔记 Lecture1 Stanford CS224d 课程笔记 Lecture1 Stanford大学在20 ...

  4. <Natural Language Processing with Python>学习笔记一

    Spoken input (top left) is analyzed, words are recognized, sentences are parsed and interpreted in c ...

  5. spaCy is a library for advanced natural language processing in Python and Cython:spaCy 工业级自然语言处理工具

    spaCy is a library for advanced natural language processing in Python and Cython. spaCy is built on ...

  6. How 5 Natural Language Processing APIs Stack Up

    https://www.programmableweb.com/news/how-5-natural-language-processing-apis-stack/analysis/2014/07/2 ...

  7. 论文笔记:Dynamic Multimodal Instance Segmentation Guided by Natural Language Queries

    Dynamic Multimodal Instance Segmentation Guided by Natural Language Queries 2018-09-18 09:58:50 Pape ...

  8. Parsing Natural Scenes and Natural Language with Recursive Neural Networks-paper

    Parsing Natural Scenes and Natural Language with Recursive Neural Networks作者信息: Richard Socher richa ...

  9. 论文笔记:Tracking by Natural Language Specification

    Tracking by Natural Language Specification 2018-04-27 15:16:13  Paper: http://openaccess.thecvf.com/ ...

随机推荐

  1. MMS关键指标意义&各数值区间意义

    MMS关键指标意义&各数值区间意义 What's MMS MongoDB Management Service (MMS) is a suite of services for managin ...

  2. Emit动态生成代码

    Emit动态生成代码 引用:秒懂C#通过Emit动态生成代码 首先需要声明一个程序集名称, // specify a new assembly name var assemblyName = new ...

  3. 介绍几个工作开发中封装的好用的android自定义控件

    首先看效果图, 看下这两个界面,第一个中用到了一个自定义的FlowRadioGroup,支持复合子控件,自定义布局: 第二个界面中看到了输入的数字 自动4位分割了吧:也用到了自定义的DivisionE ...

  4. Copy15G的初始容量,注册就再送5G,邀请注册的人也送5G

    Copy15G的初始容量,注册就再送5G,邀请注册的人也送5G,可谓是史上最隆重最给力的容量赠送活动~~~https://copy.com?r=kFpfsZ

  5. swift 类和结构体

    1:类和结构体定义 类和结构体分别通过关键字class 和struct定义. swift的编码风格是类class和结构体struct名字使用大写字母开头的匈牙利表示法,相反的.类的方法和属性则用小写字 ...

  6. [LeetCode] Sparse Matrix Multiplication

    Problem Description: Given two sparse matrices A and B, return the result of AB. You may assume that ...

  7. Backbone之旅——Collection and View篇

    上篇文章说了Model,这次说说Collection,collection就是model的集合,用来装载model对象的 定义方法 var Persons = new Backbone.Collect ...

  8. ODAC(V9.5.15) 学习笔记(十九)主键值自动生成

    ODAC支持通过Oracle的序列来自动生成表的主键功能.这个过程允许在客户端自动完成,不需要过多代码.这个对一些要求自动增长字段做主键的场合非常有用.其实现步骤为: 1.数据库必须先建立生成主键的序 ...

  9. 关于castle和Could not find the dialect in the configuration错误

    最近试了试castle,NND,老是报“Could not find the dialect in the configuration”,明明配的没问题,上网搜索所有教程都是这么配的.后来在一国外的网 ...

  10. char str[]和char *str的区别

    1.http://blog.csdn.net/szchtx/article/details/10396149 char ss[]="C++";  ss[0]='c';        ...