[elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-07-31 Thread Filip Haglund
Keeping with the helpfullness of the compiler, having warnings when doing 
scetchy things with string interpolation (issue #905 on Github 
) could be useful. 
This could be warnings about building urls's from variables that might be 
user input. It could also be about building SQL queries, or HTML. 

I suggest having some basic checks in the compiler for these areas where 
special care should be taken. This would generate warnings, assuming it is 
a mistake until proven otherwise.

`"http://example.com/profile/{{userdata}}/"` would generate a warning. 
`"http://example.com/profile/{{[url] userdata }}/"`would not. 

`"My name is {{[url] userdata}}."`would generate a warning.
`"My name is {{userdata}}."`would not.

`"Check out my blog."` would generate a warning.
`"Check out my blog."` 
would generate a warning.
`"Check out my blog."` would not.

`"Select * from users where username = '{{userdata}}'"` would generate a 
warning.
`"Select * from users where username = '{{[html, url] userdata}}'"` 
would generate a warning.
`"Select * from users where username = '{{[sql] userdata}}'"` would not.

Exact syntax is not important right now. I want to know what the community 
thinks about the idea of "I know what I'm doing"-annotated string 
interpolation.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Zachary Kessin
I dislike the idea of any syntax that will let me do something dumb and let
me "Fix it later" because that generally never happens

Zach
ᐧ

On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund 
wrote:

> Keeping with the helpfullness of the compiler, having warnings when doing
> scetchy things with string interpolation (issue #905 on Github
> ) could be useful.
> This could be warnings about building urls's from variables that might be
> user input. It could also be about building SQL queries, or HTML.
>
> I suggest having some basic checks in the compiler for these areas where
> special care should be taken. This would generate warnings, assuming it is
> a mistake until proven otherwise.
>
> `"http://example.com/profile/{{userdata}}/"` would generate a warning.
> `"http://example.com/profile/{{[url] userdata }}/"`would not.
>
> `"My name is {{[url] userdata}}."`would generate a warning.
> `"My name is {{userdata}}."`would not.
>
> `"Check out my blog."` would
> generate a warning.
> `"Check out my blog."` would
> generate a warning.
> `"Check out my blog."`
> would not.
>
> `"Select * from users where username = '{{userdata}}'"` would generate a
> warning.
> `"Select * from users where username = '{{[html, url] userdata}}'"`
> would generate a warning.
> `"Select * from users where username = '{{[sql] userdata}}'"` would not.
>
> Exact syntax is not important right now. I want to know what the community
> thinks about the idea of "I know what I'm doing"-annotated string
> interpolation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Zach Kessin
SquareTarget 
Twitter: @zkessin 
Skype: zachkessin

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Peter Damoc
I agree with Zach.

"I know what I'm doing" is sometimes a shorthand for "WTF was I thinking 6
months ago?". Just because it makes sense to you now it is not a guarantee
that will continue to make sense forever.

If you like to shoot yourself in the foot, Elm does not try to prevent you
but it doesn't give you any gun either. You'll have to bring your own gun
(JS). :)





On Mon, Aug 1, 2016 at 10:34 AM, Zachary Kessin  wrote:

> I dislike the idea of any syntax that will let me do something dumb and
> let me "Fix it later" because that generally never happens
>
> Zach
> ᐧ
>
> On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund 
> wrote:
>
>> Keeping with the helpfullness of the compiler, having warnings when doing
>> scetchy things with string interpolation (issue #905 on Github
>> ) could be useful.
>> This could be warnings about building urls's from variables that might be
>> user input. It could also be about building SQL queries, or HTML.
>>
>> I suggest having some basic checks in the compiler for these areas where
>> special care should be taken. This would generate warnings, assuming it is
>> a mistake until proven otherwise.
>>
>> `"http://example.com/profile/{{userdata}}/"` would generate a warning.
>> `"http://example.com/profile/{{[url] userdata }}/"`would not.
>>
>> `"My name is {{[url] userdata}}."`would generate a warning.
>> `"My name is {{userdata}}."`would not.
>>
>> `"Check out my blog."` would
>> generate a warning.
>> `"Check out my blog."` would
>> generate a warning.
>> `"Check out my blog."`
>> would not.
>>
>> `"Select * from users where username = '{{userdata}}'"` would generate a
>> warning.
>> `"Select * from users where username = '{{[html, url] userdata}}'"`
>> would generate a warning.
>> `"Select * from users where username = '{{[sql] userdata}}'"` would not.
>>
>> Exact syntax is not important right now. I want to know what the
>> community thinks about the idea of "I know what I'm doing"-annotated string
>> interpolation.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Zach Kessin
> SquareTarget 
> Twitter: @zkessin 
> Skype: zachkessin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Nick H
I think the compiler would be far exceeding its job description if it was
trying to identify the language of every string! This sounds like it would
be better as part of a separate validation tool.

And of course, there's no telling when (if?!) string interpolation gets
added to the language. Right now we are stuck with (++) and concat.

On Mon, Aug 1, 2016 at 1:35 AM, Peter Damoc  wrote:

> I agree with Zach.
>
> "I know what I'm doing" is sometimes a shorthand for "WTF was I thinking 6
> months ago?". Just because it makes sense to you now it is not a guarantee
> that will continue to make sense forever.
>
> If you like to shoot yourself in the foot, Elm does not try to prevent you
> but it doesn't give you any gun either. You'll have to bring your own gun
> (JS). :)
>
>
>
>
>
> On Mon, Aug 1, 2016 at 10:34 AM, Zachary Kessin  wrote:
>
>> I dislike the idea of any syntax that will let me do something dumb and
>> let me "Fix it later" because that generally never happens
>>
>> Zach
>> ᐧ
>>
>> On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund 
>> wrote:
>>
>>> Keeping with the helpfullness of the compiler, having warnings when
>>> doing scetchy things with string interpolation (issue #905 on Github
>>> ) could be useful.
>>> This could be warnings about building urls's from variables that might be
>>> user input. It could also be about building SQL queries, or HTML.
>>>
>>> I suggest having some basic checks in the compiler for these areas where
>>> special care should be taken. This would generate warnings, assuming it is
>>> a mistake until proven otherwise.
>>>
>>> `"http://example.com/profile/{{userdata}}/"` would generate a warning.
>>> `"http://example.com/profile/{{[url] userdata }}/"`would not.
>>>
>>> `"My name is {{[url] userdata}}."`would generate a warning.
>>> `"My name is {{userdata}}."`would not.
>>>
>>> `"Check out my blog."`
>>> would generate a warning.
>>> `"Check out my blog."` would
>>> generate a warning.
>>> `"Check out my blog."`
>>> would not.
>>>
>>> `"Select * from users where username = '{{userdata}}'"` would generate a
>>> warning.
>>> `"Select * from users where username = '{{[html, url] userdata}}'"`
>>> would generate a warning.
>>> `"Select * from users where username = '{{[sql] userdata}}'"` would not.
>>>
>>> Exact syntax is not important right now. I want to know what the
>>> community thinks about the idea of "I know what I'm doing"-annotated string
>>> interpolation.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Elm Discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to elm-discuss+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Zach Kessin
>> SquareTarget 
>> Twitter: @zkessin 
>> Skype: zachkessin
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Magnus Rundberget
Well a step up from ++ and concat would be 
http://package.elm-lang.org/packages/krisajenkins/formatting/3.0.0/Formatting

-magnus

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-02 Thread Zachary Kessin
I think I would state it as "WTF Was I thinking " is the past tense of "I
know what I am doing".

Sort of like "No Sh*t there we were" is the past tense of "Oh Sh*t Here
they come"

Zach
ᐧ

On Mon, Aug 1, 2016 at 11:35 AM, Peter Damoc  wrote:

> I agree with Zach.
>
> "I know what I'm doing" is sometimes a shorthand for "WTF was I thinking 6
> months ago?". Just because it makes sense to you now it is not a guarantee
> that will continue to make sense forever.
>
> If you like to shoot yourself in the foot, Elm does not try to prevent you
> but it doesn't give you any gun either. You'll have to bring your own gun
> (JS). :)
>
>
>
>
>
> On Mon, Aug 1, 2016 at 10:34 AM, Zachary Kessin  wrote:
>
>> I dislike the idea of any syntax that will let me do something dumb and
>> let me "Fix it later" because that generally never happens
>>
>> Zach
>> ᐧ
>>
>> On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund 
>> wrote:
>>
>>> Keeping with the helpfullness of the compiler, having warnings when
>>> doing scetchy things with string interpolation (issue #905 on Github
>>> ) could be useful.
>>> This could be warnings about building urls's from variables that might be
>>> user input. It could also be about building SQL queries, or HTML.
>>>
>>> I suggest having some basic checks in the compiler for these areas where
>>> special care should be taken. This would generate warnings, assuming it is
>>> a mistake until proven otherwise.
>>>
>>> `"http://example.com/profile/{{userdata}}/"` would generate a warning.
>>> `"http://example.com/profile/{{[url] userdata }}/"`would not.
>>>
>>> `"My name is {{[url] userdata}}."`would generate a warning.
>>> `"My name is {{userdata}}."`would not.
>>>
>>> `"Check out my blog."`
>>> would generate a warning.
>>> `"Check out my blog."` would
>>> generate a warning.
>>> `"Check out my blog."`
>>> would not.
>>>
>>> `"Select * from users where username = '{{userdata}}'"` would generate a
>>> warning.
>>> `"Select * from users where username = '{{[html, url] userdata}}'"`
>>> would generate a warning.
>>> `"Select * from users where username = '{{[sql] userdata}}'"` would not.
>>>
>>> Exact syntax is not important right now. I want to know what the
>>> community thinks about the idea of "I know what I'm doing"-annotated string
>>> interpolation.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Elm Discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to elm-discuss+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Zach Kessin
>> SquareTarget 
>> Twitter: @zkessin 
>> Skype: zachkessin
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Zach Kessin
SquareTarget 
Twitter: @zkessin 
Skype: zachkessin

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.