[U2] BASIC code - upper, lower, CamelCase, what say you?
First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
Depends on how portable you want your code to be. Some older systems, even some symbols are case insensitive. For U2, Unidata is pickier out of the box about keyword case than UniData. I've settled on UPPERCASE for reserved words and camelCase for variables. But old-school die hards think it's totally unreadable. I think if you program in other languages, you find it appealing. If I discard the criticism of those who still embrace GOTO, then the objections are probably 1 out of 4. You know the programmer is poser if he writes GOTO as goTo :-) -BD On 12/20/2013 12:01 PM, Bobby Worley wrote: First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
I have been writing uniBasic code in camelCase for a few years now. To me... there are major obvious readability advantages. Trying to convince other programmers of the merits seems to be an upHump battle. --Bill -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bobby Worley Sent: Friday, December 20, 2013 2:02 PM To: U2 Users List Subject: [U2] BASIC code - upper, lower, CamelCase, what say you? First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
Lowercase keywords - camelcase variables - lowercase comments - equates should be easy to differentiate from variables. Dave Davis Team Lead, Research Development P: 614-875-4910 x108 F: 614-875-4088 E: dda...@harriscomputer.com [http://www.harriscomputer.com/images/signatures/HarrisSchools.jpg] [http://www.harriscomputer.com/images/signatures/DivisionofHarris.gif]http://www.harriscomputer.com/ 6110 Enterprise Parkway Grove City, OH 43123 www.harris-schoolsolutions.comhttp://www.harris-schoolsolutions.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
I am not concerned about portability at all, this is for our company only. On Fri, Dec 20, 2013 at 1:16 PM, Bruce Decker bdec...@bluepinc.com wrote: Depends on how portable you want your code to be. Some older systems, even some symbols are case insensitive. For U2, Unidata is pickier out of the box about keyword case than UniData. I've settled on UPPERCASE for reserved words and camelCase for variables. But old-school die hards think it's totally unreadable. I think if you program in other languages, you find it appealing. If I discard the criticism of those who still embrace GOTO, then the objections are probably 1 out of 4. You know the programmer is poser if he writes GOTO as goTo :-) -BD On 12/20/2013 12:01 PM, Bobby Worley wrote: First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this? Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- *Bob Worley* IT Applications Developer Coburn Supply Company o: 903.753.8613 | m: 214.676.9825 bwor...@coburns.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
This is really what got my thought-process flowing on this subject. I saw this code on github after the Rocket Software Whats New in 11.2 webinar: https://github.com/RocketSoftware/u2-servers-lab/blob/master/UniVerse-11.2/Local/BP/LocalMain PROGRAM LocalMain ** Let's have a quick look at local scoping CRT Calling the local SUBROUTINE CALL Main(@SENTENCE) ;* This will call Main() below, rather than an external subroutine CRT Back from the local SUBROUTINE END SUBROUTINE Main(Args) CRT Running inside the local SUBROUTINE CRT Args: :Args FOR Counter = 1 TO 3 CALL InnerLoop(Counter) NEXT Counter RETURN SUBROUTINE InnerLoop(OutsideCounter) * Notice this won't affect Main()'s 'Counter' variable due to scoping FOR Counter = 1 TO OutsideCounter CRT *: NEXT Counter CRT RETURN ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
Wonder if anyone has ever done a study on whether by using U/l variables, now you will be hitting the shift a whole lot more, does this lead to or worsen carpel tunnel? Kind of a serious concern. I think it also makes debugging more difficult, I'd rather stick to all UPPER or all lower Nothing better Than wasting 2 hours going through a program to find out Oops, mean L instead of l George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bobby Worley Sent: Friday, December 20, 2013 2:32 PM To: U2 Users List Subject: Re: [U2] BASIC code - upper, lower, CamelCase, what say you? This is really what got my thought-process flowing on this subject. I saw this code on github after the Rocket Software Whats New in 11.2 webinar: https://github.com/RocketSoftware/u2-servers-lab/blob/master/UniVerse-11.2/Local/BP/LocalMain PROGRAM LocalMain ** Let's have a quick look at local scoping CRT Calling the local SUBROUTINE CALL Main(@SENTENCE) ;* This will call Main() below, rather than an external subroutine CRT Back from the local SUBROUTINE END SUBROUTINE Main(Args) CRT Running inside the local SUBROUTINE CRT Args: :Args FOR Counter = 1 TO 3 CALL InnerLoop(Counter) NEXT Counter RETURN SUBROUTINE InnerLoop(OutsideCounter) * Notice this won't affect Main()'s 'Counter' variable due to scoping FOR Counter = 1 TO OutsideCounter CRT *: NEXT Counter CRT RETURN ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
When using Rocket's BDT... upper-casing the commands is redundant since the editor automatically changes the color of this text to red. --Bill -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bobby Worley Sent: Friday, December 20, 2013 2:32 PM To: U2 Users List Subject: Re: [U2] BASIC code - upper, lower, CamelCase, what say you? This is really what got my thought-process flowing on this subject. I saw this code on github after the Rocket Software Whats New in 11.2 webinar: https://github.com/RocketSoftware/u2-servers-lab/blob/master/UniVerse-11.2/L ocal/BP/LocalMain PROGRAM LocalMain ** Let's have a quick look at local scoping CRT Calling the local SUBROUTINE CALL Main(@SENTENCE) ;* This will call Main() below, rather than an external subroutine CRT Back from the local SUBROUTINE END SUBROUTINE Main(Args) CRT Running inside the local SUBROUTINE CRT Args: :Args FOR Counter = 1 TO 3 CALL InnerLoop(Counter) NEXT Counter RETURN SUBROUTINE InnerLoop(OutsideCounter) * Notice this won't affect Main()'s 'Counter' variable due to scoping FOR Counter = 1 TO OutsideCounter CRT *: NEXT Counter CRT RETURN ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
All upper. All variables global to the program. Everything is untyped. I've always wondered why anyone would induce an increased level of complexity into an inherently simple language. It's part of the beauty of the development environment. George Gallen wrote: Wonder if anyone has ever done a study on whether by using U/l variables, now you will be hitting the shift a whole lot more, does this lead to or worsen carpel tunnel? Kind of a serious concern. I think it also makes debugging more difficult, I'd rather stick to all UPPER or all lower Nothing better Than wasting 2 hours going through a program to find out Oops, mean L instead of l George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bobby Worley Sent: Friday, December 20, 2013 2:32 PM To: U2 Users List Subject: Re: [U2] BASIC code - upper, lower, CamelCase, what say you? This is really what got my thought-process flowing on this subject. I saw this code on github after the Rocket Software Whats New in 11.2 webinar: https://github.com/RocketSoftware/u2-servers-lab/blob/master/UniVerse-11.2/Local/BP/LocalMain PROGRAM LocalMain ** Let's have a quick look at local scoping CRT Calling the local SUBROUTINE CALL Main(@SENTENCE) ;* This will call Main() below, rather than an external subroutine CRT Back from the local SUBROUTINE END SUBROUTINE Main(Args) CRT Running inside the local SUBROUTINE CRT Args: :Args FOR Counter = 1 TO 3 CALL InnerLoop(Counter) NEXT Counter RETURN SUBROUTINE InnerLoop(OutsideCounter) * Notice this won't affect Main()'s 'Counter' variable due to scoping FOR Counter = 1 TO OutsideCounter CRT *: NEXT Counter CRT RETURN ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users . -- Jeff Schasny - Denver, Co, USA jschasny at gmail dot com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
If you use mixed case, what search tools comparitors do you use when researching your program libraries? Particularly if you have programs written in different styles over the years. What formatting tools do you use? On 12/20/2013 10:01 PM, Bobby Worley wrote: First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
Charles: I've always used the following: http://www.pickwiki.com/cgi-bin/wiki.pl?BFind ...to search everything on U2, including Windows directories. Considering Windows search capabilities really suck, this is very handy for our web stuff, programs, accounts, dictionaries, etc. I did this so many years ago the newer version may or may not have some enhancements or fixes. This way I couldn't care less about case. Now-a-days all of my UniData STATEMENTS are upper case while everything else is designed to be readable by anyone who speaks and writes human languages (in my case English). Bill - Original Message - *From:* stevenson.c...@gmail.com *To:* U2 Users List u2-users@listserver.u2ug.org *Date:* 12/20/2013 1:07 PM *Subject:* Re: [U2] BASIC code - upper, lower, CamelCase, what say you? If you use mixed case, what search tools comparitors do you use when researching your program libraries? Particularly if you have programs written in different styles over the years. What formatting tools do you use? On 12/20/2013 10:01 PM, Bobby Worley wrote: First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] BASIC code - upper, lower, CamelCase, what say you?
me? BIG LETTERS ALL THE TIME AND NO I'M NOT SHOUTING as far as code goes. the rest of the time i don't use caps at all. crps in middle right knuckle, can't use right hand to type at all, caps are a pita with only one hand On 12/20/2013 6:21 PM, Bill Haskett wrote: Charles: I've always used the following: http://www.pickwiki.com/cgi-bin/wiki.pl?BFind ...to search everything on U2, including Windows directories. Considering Windows search capabilities really suck, this is very handy for our web stuff, programs, accounts, dictionaries, etc. I did this so many years ago the newer version may or may not have some enhancements or fixes. This way I couldn't care less about case. Now-a-days all of my UniData STATEMENTS are upper case while everything else is designed to be readable by anyone who speaks and writes human languages (in my case English). Bill - Original Message - *From:* stevenson.c...@gmail.com *To:* U2 Users List u2-users@listserver.u2ug.org *Date:* 12/20/2013 1:07 PM *Subject:* Re: [U2] BASIC code - upper, lower, CamelCase, what say you? If you use mixed case, what search tools comparitors do you use when researching your program libraries? Particularly if you have programs written in different styles over the years. What formatting tools do you use? On 12/20/2013 10:01 PM, Bobby Worley wrote: First off - Merry Christmas and Happy New Year to all. I'm starting to write a lot of new BASIC (Universe 11.1) subroutines for our DesignBais application, and since I'll be starting with a blank code template instead of modifying existing code, and I thought 'hey why not join the 21st century' and make the code look more mainstream, and readable. (falling back on our last TEXMUG presentation by Clif Oliver on refactoring). And considering Universe 11.2 now supports local subroutines and functions, I should make the code look and behave more object-like. Does anyone know of a set of rules or guidelines on how to do this?Just experimenting briefly, Universe BASIC compiler will allow any mix of cases for keywords, but variables are case sensitive. Example: ED BP TEST ABC=1 Abc=2 abc=3 PRINT ABC Print Abc pRiNt abc stop end RUN TEST 1 2 3 So, how are developers mixed case in their code these day? Do keywords, local variables, common variable, equates follow a standard method? thanks in advance, ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users