[go-nuts] Re: A modest format suggestion

2020-04-27 Thread Warren Stephens
Or really "Go for it" and suggestion a language syntax enhancement! // Great is a really great function. func Great( anArg int,/// This explains anArg anotherArg string, /// This explains anotherArg ) (err error) { ... Where 3 slashes `///` indicates that t

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
Nigel, Thanks! I can use that in general to wrap pieces of code so that I can collapse them in my editor whenever I want! I was grasping for some concrete way to show this concept -- amid the distraction of doing real work. Perhaps I should have referenced MIT's Scratch programming tool???

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
A few decades ago the Apple Macintosh was not very good either. Warren -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
> > establish[ed] refactoring tools that are well understood and > tested > New modes of working need new tools to be developed. Prior paradigm tools are for the prior paradigm. How many good tools exist now that will turn linear code into a nice looking readable flow chart? Few? None reall

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread Warren Stephens
Dave, A key amount of testing here and there is a great thing, but I think that folks greatly underestimate the amount of time (per your example) and effort put into increasing test coverage only to have a project shut down! There often is no "long run"! Whereas, what I call "real world" test

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread Warren Stephens
And I am saying Functions PLUS Structure. Functions remain. Visible structure is added. Warren -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts

[go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread Warren Stephens
All, If the code here is not making sense then take a look AWS Step Functions. AWS Step Functions homepage And imagine something that is compiled, rather than the web service that AWS offers. AWS Step Functions can be ed

[go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-04 Thread Warren Stephens
Folks, First off thanks for the feedback! -- positive and negative. Second, hopefully people can trust that I fully understand the standard approach to code refactoring and writing tests. I have done a bunch of it, and am sure will continue to do a bunch of it. I understand the merits of it

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Warren Stephens
rog, Very well said -- but everyone keeps talking about improving the maintainability without talking about the "comprehensiblity". Look at the 2 things below. Which is more quickly comprehensible? We cannot conceive of a way to have the upper one and still test each piece??? Warren AAA BBB

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Warren Stephens
I really am not trying to be a pain about this "real world" thing -- think about trauma nurses and MASH surgeons. I have 2 friends that are trauma nurses who fly on rescue helicopters to car and motorcycle crashes (or occasionally a military location). They do not do things the same was as re

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
Robert, I just feel like (somehow invariably!) breaking 60 line methods into 3 methods of 20 lines each is not the best ultimate solution. As for the "real world" ...this is too funny.. I must live in a different one than most -- I have received 2 high-priority urgent requests since my previou

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
Axle, Maybe with would need to be some sort of "freeze the variables" (no redefinition) statement? -- I am going to think about it. Warren -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
The over-arching goal is for me to write tests more easily. Not avoid writing tests. I am not arguing against tests. Though I am being a bit snarky when I see responses that seem merely to say "Use TTD or something similar and it will solve all your problems!" I have never experienced that w

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
Misha, Wonderful! This view is the furtherest away from mere TDD "virtue signaling"! Warren -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubs

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
Axel, What if local var pointers (like x above) were invalid to list in a *with* statement? Would there then be any other breaking examples? Can it be broken using passed pointers or heap pointers? Warren -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread Warren Stephens
Axel, I think it was a different kind of efficiency that first prompted my thinking on this. The (my) original prompting code was written quickly, debugged, and working. No tests. Such is life. The refactored "testable" code (no functionality added) became 162 lines and 9 funcs -- averaging

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
Axel, I like your example. Var *e* would get re-declared -- so that is a change. However, var *x* is not visible past the *with* statement -- only var *a* is brought forward. So we need another attempt at breaking this. :-) I will try to think of how to get a re-declaration to break someth

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
Also note that these *internal* pieces of code would eliminate the inefficiency of calls -- which is non-trivial as I am sometimes dealing with big-data of billions of records of data. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
No worries. It could made to look more Go-like... internal mystep2(lines, thing2): (mymap, err) or something like that. Where "internal" is like "func". The colon is already used for labels. And the results are like the values supplied after a return. -- You received this message beca

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
Robert, To me, code broken up into smaller pieces can “seem” more maintainable, but (actually more importantly to me) often is far less comprehensible. And I must comprehend it in order to maintain it. I recently returned to a piece of code that someone else had refactored in order to write t

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
// I don't want to get into the specific syntax of the test code directly, // but a test would start execution here, supplying "lines" and "thing2" // mystep2 with: lines, thing2 // <-- hide all local variables from above except for lines and thing2 mymap := make(map[string]

[go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Warren Stephens
All, Thanks for the advice, but I should have mentioned that I already know about Test Driven Development. I live in the real world of commercial software development (>3 decades). Here is the real world scenario: 1. Write some code quick — must stay on schedule, there is actually no t

[go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-02-29 Thread Warren Stephens
I often write a function or module to handle some process that takes 3 or 4 steps to complete. After I am happy with the code I then proceed to write tests for the code, but find that I am compelled to chop the code into pieces in order to simplify the test code -- thereby losing the nice top