What is hybrid programming?
Hybrid programming refers to the process of developing applications using two or more programming languages. Currently, there are many popular programming languages on the computer. They have their own advantages and disadvantages. hybrid programming can take full advantage of the advantages of various programming languages. The key issue of mixed programming is parameter transfer.
The above is from Baidu encyclopedia.
Simply put, code is written in more than one language.
During Development in Linux, you need to write some makefiles to support C/C ++ development. However, hybrid programming can integrate makefile and code, what are the benefits of doing so? It is not worthwhile to write makefile for a small test file.
Such mixed programming is as follows:
# If 0g ++-o Test 1. cppexit # endif // The main code is written below # include <iostream> using namespace STD; int main () {cout <"Hello word" <Endl; return 0 ;}
You only need to use Sh 1. cpp to generate the test executable file.
The second example is to use hybrid Programming to Implement thrift definition files to generate thrift files:
/*in/ls > /dev/nullNAME=`echo $0 | awk -F '/' '{print $NF}' | sed 's/\./-/g'` [ -e "${NAME}-dir" ] || mkdir "${NAME}-dir"thrift -out "${NAME}-dir" -gen cpp $0 exit*/namespace cpp izp enum _EFlowType{ TANX = 0, BFP = 1, IDCLICKS = 2, TOTAL_TYPE = 3 }typedef _EFlowType EFlowTypestruct test{ 1: i32 id;}