Sign in to follow this  
Followers 0
dcop

Multiple Code On One Line

8 posts in this topic

I do the following to to cut down on the number of lines and increase my view using the &@CRLF&. Is there any other way to do it with AutoIt? TIA, Dennis

$label1 = GUICtrlCreateLabel("Date Of Gas-Up", 2, 16, 90, 17) &@CRLF& GUICtrlSetResizing (-1,$GUI_DOCKALL) &@CRLF& GUISetBkColor(0x00FFFF)

Share this post


Link to post
Share on other sites



Runtime performance should not be impacted by a programmer's coding habits. This isn't 1982. Windows have scrollbars. Whitespace is not something to be afraid of. I suggest you better spend your time writing clear code than trying to squeeze as much as possible into as little screen space as possible.

Share this post


Link to post
Share on other sites

Runtime performance should not be impacted by a programmer's coding habits. This isn't 1982. Windows have scrollbars. Whitespace is not something to be afraid of. I suggest you better spend your time writing clear code than trying to squeeze as much as possible into as little screen space as possible.

I agree but my I feel my code is clear. Anyhow, there is no other way to one line multile syntax?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Single lines = a messy peice of code.

Look at this one line of C++ code:

int main(){for(int i=0, j=10, x=0; i<=5, j<=20; i++, j+=2, printf("%i", i+j), x+=i+j){}}

May have syntax errors, but you get the idea.

#)

Edited by nfwu

Share this post


Link to post
Share on other sites

I do the following to to cut down on the number of lines and increase my view using the &@CRLF&. Is there any other way to do it with AutoIt? TIA, Dennis

You really think this is more readable

$label1 = GUICtrlCreateLabel("Date Of Gas-Up", 2, 16, 90, 17) &@CRLF& GUICtrlSetResizing (-1,$GUI_DOCKALL) &@CRLF& GUISetBkColor(0x00FFFF)

than this?

$label1 = GUICtrlCreateLabel("Date Of Gas-Up", 2, 16, 90, 17) 
       GUICtrlSetResizing (-1,$GUI_DOCKALL) 
       GUISetBkColor(0x00FFFF)

:whistle:

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

PageSpaceTakenBySourceCodeDoesNotReflectOnSizeOfEndExeFile.

Readability is paramount when you revisit your code six months down the track.

Comments are free and you will really appreciate them whan you go back later and update your code to add functionality - it always happens.

I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht

I was rdanieg The phaonmneal pweor of the hmuan mnid

Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy,

it deosn't mttaer in waht oredr the ltteers in a wrod are,

the olny iprmoatnt tihng is taht the frist and lsat ltteer

be in the rghit pclae. The rset can be a taotl mses and

you can sitll raed it wouthit a porbelm. Tihs is bcuseae

the huamn mnid deos not raed ervey lteter by istlef,

but the wrod as a wlohe.

Amzanig huh? yaeh and I awlyas thought slpeling was ipmorantt

Share this post


Link to post
Share on other sites

I agree but my I feel my code is clear. Anyhow, there is no other way to one line multile syntax?

Okay, maybe you can read it, good for you. Can anybody else? Can you absolutely positively guarantee no other living (or dead) person will ever have to read your code for any reason what-so-ever? Most people can't and some people won't. For example, if I was handed a script written like you show, I'd immediately discard it and rewrite it from scratch no matter how big it is. My thoughts are if you make such a poor decision about the way you write the code, I can't imagine the poor decisions you make in designing the code. This is irrespective of your actual ability - I'm never going to make it far enough into the script to see if you can design good code or not.

If you want to see more code on screen do everybody else a favor and use a smaller font and get a bigger monitor. Don't write nasty code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0