Programming Language Evaluation Criteria Part 1: Readability

Icons by Freepik, FlatIcon
Icon by Gregor Cresnar, FlatIcon

Readability

C code:
int square(int num) {
return num * num;}

Assembly Code RISC-V gcc 8.2.0
square(int):addi sp,sp,-32sd s0,24(sp)addi s0,sp,32mv a5,a0sw a5,-20(s0)lw a4,-20(s0)lw a5,-20(s0)mulw a5,a4,a5sext.w a5,a5mv a0,a5ld s0,24(sp)addi sp,sp,32jr ra

Bool IsEnd = True;
Int IsEnd = 1.
Ptyhon:
for x in range (0,3):
print “hello world”
C:
for (int i = 0; i<3, i ++) {
printf (“hello world”);
}

for x from 0 to 3:
print (“hello world”);
end

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ngwes

ngwes

7 Followers

I’m a Computer Science engineer, in love with programming improvement books. In my free time, I’m a swimmer and a volleyball fan