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

2020-03-06 Thread Dan Kortschak
Is this helpful for addressing your issue? On Fri, 2020-03-06 at 04:42 -0800, Warren Stephens wrote: > Perhaps I should have referenced MIT's Scratch programming tool??? > "Go is not as good as Scratch" -- THAT would be popular around here I > am sure! -- You received this message because you

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 Nigel Tao
On Thu, Mar 5, 2020 at 10:32 AM Warren Stephens wrote: > There is a bunch of "goto nonsense" added to get the Go compiler to accept > the 4 labels Well then, don't use labels, so you don't need nonsense (or the dummy parameter). Cutting them out (https://play.golang.org/p/SUalTGaAxmx) runs just

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 Dan Kortschak
I wrote cybernetic systems for laboratories with LabView a few decades ago. Nothing is worth keeping from that system. On Fri, 2020-03-06 at 00:59 -0800, Warren Stephens wrote: > How many good tools exist now that will turn linear code into a nice > looking readable flow chart? Few? None really?

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 Dan Kortschak
I'm really struggling to understand the benefit that you say you'll get. The linear form that the with: label gives you is really just what we already use with a different accent. The cost of testing or not is not substantially different, but the cost of allowing long linear functions, needing addi

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

2020-03-05 Thread David Riley
On Mar 5, 2020, at 5:17 PM, Warren Stephens wrote: > > So I should invent a fractal programming language -- where every function > must be defined within another function -- have people write tests for that! I think we call that "LISP". - Dave -- You received this message because you are su

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 David Riley
On Mar 5, 2020, at 9:26 AM, Warren Stephens wrote: > > And I am saying Functions PLUS Structure. > > > > Functions remain. Visible structure is added. Right, and you can do your testing at the boundaries of those functions, because the structure is nothing but a shell (in most Step Lambda c

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

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

2020-03-05 Thread Robert Engels
It’s in the name “Step FUNCTION”. They are composable testable units. This is what people are telling you to use. > On Mar 5, 2020, at 7:42 AM, Warren Stephens > wrote: > > All, > > If the code here is not making sense then take a look AWS Step Functions. > > AWS Step Functions homepage >

[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

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

2020-03-05 Thread roger peppe
On Wed, 4 Mar 2020 at 23:32, Warren Stephens wrote: > 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 wi

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

2020-03-04 Thread Tamás Gulácsi
If the (sub)step alone is comprehensible just in itself, hiding the previous (sub)steps and its context, then it is comprehensible when refactored to a separate function. An then it is separately testable, documentable, and no collapsing esitor help is neede when viewing them main function, lis

[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] 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] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-02 Thread 'Axel Wagner' via golang-nuts
On Mon, Mar 2, 2020 at 2:05 PM Warren Stephens wrote: > 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? > Of course. In fact, that was my thoug

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

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

2020-03-02 Thread Brian Candler
Tests that depend on the internal implementation of a function are very brittle: any refactoring and they're likely to break, which defeats much of the benefit. You can check that a function has the required visible behaviour without hooking directly into its internals, by comparing the state o

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

2020-03-02 Thread John Arundel
On Saturday, 29 February 2020 18:11:53 UTC, Warren Stephens wrote: > > The influence that test code has on the structure of the application code > is highly undesirable. > On the contrary, I think designing for testability improves your architecture considerably! And if you develop test-first,

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

2020-03-01 Thread 'Axel Wagner' via golang-nuts
On Mon, Mar 2, 2020 at 12:01 AM Robert Engels wrote: > Any decent compiler should in-line these private function calls in all > cases - so no function call overhead. > FTR, while I agree that any compiler *can* inline them, I wouldn't feel confident to make as broad an assertion as this - unless

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

2020-03-01 Thread Robert Engels
Any decent compiler should in-line these private function calls in all cases - so no function call overhead. Give me a system with lots of small easily tested and documented methods over one with 1000 line methods any day. > On Mar 1, 2020, at 4:48 PM, 'Axel Wagner' via golang-nuts > wrote:

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

2020-03-01 Thread 'Axel Wagner' via golang-nuts
On Sun, Mar 1, 2020 at 11:35 PM Warren Stephens wrote: > 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. :-) >

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] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread 'Axel Wagner' via golang-nuts
(uhm, nevermind that I didn't actually internalize the supposed syntax enough. Should be "step with: a", I guess?) On Sun, Mar 1, 2020 at 11:13 PM Axel Wagner wrote: > On Sun, Mar 1, 2020 at 3:17 PM Warren Stephens < > wsteph...@prognoshealth.com> wrote: > >> So the developer is in the situation

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

2020-03-01 Thread 'Axel Wagner' via golang-nuts
On Sun, Mar 1, 2020 at 3:17 PM Warren Stephens wrote: > So the developer is in the situation of *refactoring code that is known > to be working in order to write tests!* — which are rarely going to be > comprehensive anyway. The risk is breaking something that isn’t broken! > > With my language

[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] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-02-29 Thread Jason E. Aten
Try Test Driven Development. Since testing is non-negotiable, write your tests first and let them structure your implementation incrementally. It will radically improve your software. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscri