News for hackers. Stuff that matters.
Re:The Makefile I use with JavaScript projects by to3m on Wednesday February 28, 2018 @05:23PM (#16487704)
I expect you mean NUL (ASCII 0) - but that's typically not a good choice, because POSIX decrees it invalid, along with '/'. But anything else is fair game, sure. Handling every Unicode char might be a pain, but that's the filing system's job, not yours!

Most programming languages manage to get this right. You have a quoting syntax with an escape character that lets you express the quotes, the escape character, and any arbitrary character (as a byte sequence, as a Unicode codepoint in some encoding, etc.) as well. Now you can do everything. Why not do this?

I'm not going to say this won't be a pain if you decide to write out every file name possible, because it will be, inevitably. But you can supply alternative syntaxes by way of more convenient (if limiting) shorthand - Python has its r"""...""" notation, for example, allowing you to express the majority of interesting strings without needing to escape anything.

You might argue that I've just punted the problem on to the text editor and the filing system. You'd be quite right.

Re:The Makefile I use with JavaScript projects by gonvaled on Wednesday February 28, 2018 @05:33PM (#16487801)
Depends very much on your programming environment: on Python I don"t care, but when doing bash scripting or makefiles (very often) I very much care.

I have recently decided to stop using $ in passwords (defined by me) for that same reason: of course they are valid char, but they are such a big pain to support in usual contexts that it is simply not worth it.

Re:The Makefile I use with JavaScript projects by gonvaled on Wednesday February 28, 2018 @05:36PM (#16487832)
And regarding slashes: are you bemused that unix does not support them in filenames?

(Thanks for correcting the nul reference)

Re:The Makefile I use with JavaScript projects by to3m on Wednesday February 28, 2018 @05:51PM (#16487973)
No, not really - I have no particular opinion about what POSIX chooses to support or not.

But I'm going to go back to my original point. What I do have an opinion about is how reasonable it is for tools not to support a character that is valid in file names, when that character is straightforward to support with everyday, well known syntax.

And when that character is ' ', the standard English word separator, as straightforwardly supported by approximately ever kind of quoting or escaping syntax ever, my opinion about a lack of support is: it's crap.

Re:The Makefile I use with JavaScript projects by gonvaled on Wednesday February 28, 2018 @06:00PM (#16488048)
Please write a makefile that uses an environment variable as a mysql password to connect to a mysql server and perform an arbitrary administrative task.

Now do the same, assuming that the password can have a dollar in it.

You can do it. It is not as easy, readable or maintanable. Avoid it if you can.

Re:The Makefile I use with JavaScript projects by flukus on Wednesday February 28, 2018 @11:04PM (#16489584)
Why do it from a makefile instead of a script called by the makefile? This plays well to the strengths of both.
Re:The Makefile I use with JavaScript projects by gonvaled on Thursday March 01, 2018 @01:04AM (#16490020)
Just because of the dollar? Exactly my point.
Re:The Makefile I use with JavaScript projects by flukus on Thursday March 01, 2018 @01:37AM (#16490120)
No, not just because of the dollar. Because it's easier to test in isolation and allows you to use things like here docs which are useful for dealing with sql.
Re:The Makefile I use with JavaScript projects by gonvaled on Thursday March 01, 2018 @08:06AM (#16491594)
?

Somehow we started with a single dollar in a string, and now I am dealing with sql, here docs, and TDD?

There is a place for everything in life: for small helper makefiles, which I write simply to support me in my workflow and even to remember some interesting commands that I need to run for a certain project, I can assure you that making some simple assumptions helps me staying halfway sane.

Re:The Makefile I use with JavaScript projects by rcxdude on Thursday March 01, 2018 @09:24AM (#16492198)
This represents a problem with make, not any other part of the system.
Re:The Makefile I use with JavaScript projects by ibotty on Wednesday February 28, 2018 @10:48PM (#16489531)
Not a problem if you use a my.cnf file...
Re:The Makefile I use with JavaScript projects by gonvaled on Thursday March 01, 2018 @01:03AM (#16490016)
And I need that because of ... a dollar!

Extra complication to avoid if possible.