Man, you posted this video at the right moment, i started coding a framework for a set of command line utilities i want to make using windows API. Shortly after i encountered the specific problem, i opened youtube and god bless your video popped. Looking forward to see more of this series!
excellent video!! while you were showing your version of the crt style parsing I was thinking "why re-implement weird legacy behavior?" and when you showed your personal approach I was relieved 😅 I really liked your approach, such an elegant way of handling it! I personally avoid c style strings in my own code so I would make something really similar but use a length instead of modifying the string. I am a really loving all these "non c runtime" videos and really like this longer format, love the pacing and the soft background music!
Thank you. I am also not a fan of null terminated C style strings, but there is some windows APIs that still only accept C style strings. But for everything that doesn’t need to be passed to those I usually don’t bother with it either.
I thought that "\\" means that you are escaping the back slash so it would be parsed as just "\". I thought thats why you put "\\" instead of "\" for windows path
For paths that is the case. But when you pass a path as a command line argument it will just leave the backslash pair as-is unless they are followed by a quotation mark. When you then pass that path to a windows function that takes a path it presumably treats the double backslash as an escaped character. If you check the links in the description you can read the rules specified by Microsoft. It is a bit odd in my opinion but probably has some historical reason why it works the way it does.
On windows you should use windows, command line is an artifact of the past. Python libraries are preferable to command line programs. Command line still have its uses, but that's something I'd prefer to keep you average user away from.
I like the variety in your approaches as well as the way and rate at which you are speaking
Great video! Can't wait to see what else you have in store...
Man, you posted this video at the right moment, i started coding a framework for a set of command line utilities i want to make using windows API. Shortly after i encountered the specific problem, i opened youtube and god bless your video popped. Looking forward to see more of this series!
Glad you found it helpful
excellent video!! while you were showing your version of the crt style parsing I was thinking "why re-implement weird legacy behavior?"
and when you showed your personal approach I was relieved 😅 I really liked your approach, such an elegant way of handling it!
I personally avoid c style strings in my own code so I would make something really similar but use a length instead of modifying the string.
I am a really loving all these "non c runtime" videos and really like this longer format, love the pacing and the soft background music!
Thank you. I am also not a fan of null terminated C style strings, but there is some windows APIs that still only accept C style strings. But for everything that doesn’t need to be passed to those I usually don’t bother with it either.
I thought that "\\" means that you are escaping the back slash so it would be parsed as just "\". I thought thats why you put "\\" instead of "\" for windows path
For paths that is the case. But when you pass a path as a command line argument it will just leave the backslash pair as-is unless they are followed by a quotation mark. When you then pass that path to a windows function that takes a path it presumably treats the double backslash as an escaped character.
If you check the links in the description you can read the rules specified by Microsoft. It is a bit odd in my opinion but probably has some historical reason why it works the way it does.
Yeah I like this style but as you say is a lot of work but maybe every now and then?
I think that would be doable haha
On windows you should use windows, command line is an artifact of the past. Python libraries are preferable to command line programs.
Command line still have its uses, but that's something I'd prefer to keep you average user away from.