Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

difference between puting code in a single line or multiple lines?

Former Member
0 Likes
824

I am wondering if there is really a difference between putting all your code in one line or multiple lines.

For example,

IF v_flag_up = c_checked. "comment

CONTINUE.

ENDIF.

vs

IF v_flag_up = c_checked. CONTINUE. ENDIF. "comment

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
773

Doesn't make a difference.

Writing in different lines increases readibility and tracability for ourself as well as others who refer the code.

Good practice to keep the code organized.

Regards,

Lalit Mohan Gupta.

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
773

No difference.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
774

Doesn't make a difference.

Writing in different lines increases readibility and tracability for ourself as well as others who refer the code.

Good practice to keep the code organized.

Regards,

Lalit Mohan Gupta.

Read only

0 Likes
773

would it affect something in the debugger or anything to that effect?

Read only

0 Likes
773

It wont !

Only when executing the arrow will point to that line till all the statements on that line are executed.

Regards,

Lalit Mohan Gupta.

Read only

0 Likes
773

Hi Christian,

The best practise when formatting your code is to use the Pretty Printer with Indent and Keyword in caps. Also, keeping the code as you have shown in multiple lines helps with readability and also while debugging makes the single stepping to code especially in conditional statements more easy to follow.

Hence though multiple or single line doesnt impact program performance, multiple lines makes the code more "pretty" and easier to follow in debugging.

Cheers,

Aditya