How much more truth you don't know about low code?

What kind of code counts as low?

The word low-code has become lively in the past two years, and a bunch of entrepreneurial teams have emerged to do this. Before, I only knew the length of the code, but now I know the level of the code.

The so-called low code, intuitively speaking, is to make the code easier to write. When completing the same task, the amount of code (which can be understood as the workload) is less; in addition, another important indicator is that the requirements for developers are low enough. It is also difficult to achieve the purpose of reducing costs and improving efficiency if it is written short.

Obviously, when talking about low-code, you first have to have a code and see if this code is a little lower than the other codes.
However, now many so-called development platforms that shout low code do not have their own code, but make some frameworks and templates, and developers fill in the templates to build an application system. It is no problem to deal with simple needs, and it is still easy to use, but when the business is complicated enough to use code to handle, it is still necessary to use Java/C# code.
Low code is low in code , not framework. Templates without code can indeed solve some problems, but there are still too many businesses that need to be done with code, and the level of code is indeed closely related to development efficiency.

So, what kind of code counts as low code?
Low-code is mainly for the development of information systems (commonly known as MIS in a broad sense), because only this kind of application has a variety of needs, each is different, and it will never be done. High-efficiency and low-threshold development methods are particularly meaningful.
The main task of the information system is actually three things around data: Input Input, Process Process, and Output Output, which together are an IPO. IO can now be solved by mature reporting tools and interface controls, so the trouble is left, and most of the business logic to be written in the development process is this kind of thing.

In this way, we judge whether a code is low enough, just to see whether it is convenient for this code to process data.
What kind of data?
Mainly structured data , that is, the kind of data that exists in relational databases. This is the most common kind of data in information systems. Other unstructured data either only have some special and fixed processing requirements, or only need to transform or extract structured data to have flexible processing requirements.
The question then becomes what kind of code is good at working with structured data.

Under this criterion, Java is certainly not low, it does not have a decent structured data object. The new version of Java has a collection class library such as Stream and began to support Lambda syntax, but it can only be used for very general data objects (this is determined by the goal of Java itself), and it is still cumbersome to write when dealing with structured data. Moreover, Java is a compiled language, and it is inherently difficult to be dynamic. In addition, Java is a strong object-oriented language, and it is not easy to deeply understand the concept of object-oriented. When developing Java applications, it is necessary to establish a complex engineering environment, which is not a low threshold for developers.
Similar to C#.

SQL is relatively low to a certain extent. Many non-professionals can use SQL to write queries. When writing SQL, you don’t need to care too much about the application architecture, as long as you understand the data and the business itself, which is also the knowledge that developers must have.
However, SQL has two flaws: ordered computation and procedural logic. This will cause the slightly more complicated processing to become very troublesome, often writing hundreds of lines of N-level nested grammar, and I can't understand it after a few months. SQL is also particularly difficult to debug, further driving up development costs.
If you use stored procedures instead, you can implement procedural operations, but it's like switching back to Java. Although the stored procedure is written in SQL, it also has no useful structured data objects (which can only be dealt with by temporary tables) and set operations. It is often better to use Java to command SQL to work (many applications are written in Java+SQL). of). Moreover, when using stored procedures, you will also face some application architecture troubles.
The "low" of SQL is only suitable for relatively simple scenarios. As business needs become more complex, its complexity increases exponentially.

Python is slightly better, pandas has a dataframe that can be counted as a structured data object. But Python's integration is relatively poor, unless the entire application is written in Python, which is rare. Moreover, dataframe can only be considered a half-baked. It is essentially a matrix, not a data table in our conventional sense. Many operations are very confusing. Moreover, I have to say it again, pandas is a third-party package, its application environment is not very simple, and debugging is still troublesome.
Scala is also an option, it also has a dataframe that can handle some structured data processing, but it's not very professional. The Scala code itself is relatively low, but the understanding threshold of the object-oriented stuff is not low at all, and it also faces a complex engineering environment.

SPL is low code

Isn't that low enough code then?
There are still some. The SPL of the open source esProc is low-code, and it is very likely that it is the only one now.
This is actually why SPL was invented. When Rungan is a reporting tool, it will naturally involve a lot of complex operations, and then it is found that these operations are difficult to write in SQL and Java, and these difficulties cannot be solved by perfecting the existing system. After grinding for N years, I simply invented a language to solve these problems, which is SPL.

There are complete structured data objects in SPL, which can handle large and small data. Although it uses a small amount of object-oriented syntax, it does not use esoteric object-oriented concepts, and focuses on data processing and operations. The program logic is a bit like the early BASIC language, with basic branches, loops, and subroutines, which are easy to understand. It also provides collection types based on structured data and rich library functions, especially good at supporting complex collections and ordered operations, making code writing much simpler.

Talk is cheap, Let's show code.
SPL code is written in the grid, you can directly use the grid as the variable name (Excel users are very kind), it naturally supports step-by-step operations, the grid indentation can clearly reflect the level of the code, and also provides There is a perfect debugging function.

imagepng

Rich library functions, common basic operations can be done in one line.

imagepng

In SPL you can even use SQL directly (no database dependencies):

$select * from d:/Orders.csv where (OrderDate<date('2020-01-01') and Amount<=100)or 
(OrderDate>=date('2020-12-31') and Amount>100) 

$select year(OrderDate),Client ,sum(Amount),count(1) from d:/Orders.csv  
group by year(OrderDate),Client  
having sum(Amount)<=100

$select o.OrderId,o.Client,e.Name e.Dept from d:/Orders.csv o  
join d:/Employees.csv e on o.SellerId=e.Eid

$with t as (select Client ,sum(amount) s from d:/Orders.csv group by Client)  
select t.Client, t.s, ct.Name, ct.address from t  
left join ClientTable ct on t.Client=ct.Client

SPL itself has process control capabilities similar to Java. In this way, regardless of whether there is a database, SPL can play the effect of Java+SQL.

Compare it with other codes. For example, we want to calculate how many days a stock has risen continuously.
The SQL is written like this:

select max(consecutive_days)
from (select count(*) consecutive_days
      from (select sum(updown_flag) over(order by sdate) no_up_days
            from (select sDate,
                         case when price>LAG(price) over(order by sDate)
                              then 0 else 1 end updown_flag
                  from share))
      group by no_up_days)

This code is a bit difficult to understand. Leave it as an exercise to think about how it works.

Python writes this out:

import pandas as pd
aapl = pd.read_excel(‘d:/AAPL.xlsx’)
continue_inc_days=0;
max_continue_inc_days=0
for i in aapl['price'].shift(0)>aapl[‘price’].shift(1):
    continue_inc_days =0 if i==False else continue_inc_days+1
    max_continue_inc_days = continue_inc_days if max_continue_inc_days < continue_inc_days else max_continue_inc_days
print(max_continue_inc_days)

This logic is not complicated, but it is not very simple to write.

As for Java, I won't try it, everyone makes up their own minds.
The same operation, SPL writes it out like this:

A
1 =T(“d:/AAPL.xlsx”)
2 =a=0,A1.max(a=if(price>price[-1],a+1,0))

There are no loop statements in this code, because SPL has a large number of set functions with strong Lambda syntax style, and many tasks that can only be achieved by loops in other languages ​​are single statements in SPL.

SPL solves the flaws of SQL and combines the common advantages of Java and SQL. SPL can also easily support big data operations and multi-threaded parallelism, and Python is easy to be blinded in this situation. Interested students can go to STEM Academy to see more SPL code examples.

More than just low code

SPL provides complete data source support, and almost all data sources you have heard of or have not heard of can support:

imagepng

This in turn relieves a lot of the workload of interface and data conversion.

SPL is implemented in Java and provides a JDBC driver that can be seamlessly embedded into Java applications:

Class.forName("com.esproc.jdbc.InternalDriver");
Connection conn =DriverManager.getConnection("jdbc:esproc:local://");
Statement st = connection.();
CallableStatement st = conn.prepareCall("{call xxxx(?, ?)}");
st.setObject(1, 3000);
st.setObject(2, 5000);
ResultSet result=st.execute();

In this way, SPL can be easily integrated into an application framework. Most developers only need to care about business logic and data structure, and don't even need to understand complex application architecture.
In particular, for those "low-code platforms" without code, after integrating the open source SPL, there is a real low-code , and the template and code complement each other, which is a complete low-code platform.

SPL is also a dynamic language for interpretation and execution, and the script written can be placed outside the main application. This, on the one hand, reduces the coupling between the script and the main application, and also brings the benefit of hot swapping . After all, the business logic (especially the query report class) is often changing. After the requirements are changed, as long as the script is rewritten, it can take effect immediately, and the application does not need to be restarted. If you use Java code, then... (This also shows that Java code is not low at all).

SPL download address: http://c.raqsoft.com.cn/article/1595816810031
SPL open source address: https://github.com/SPLWare/esProc

Guess you like

Origin blog.csdn.net/mengchuan6666/article/details/123789914