 |
|
 |
Better late then never. I needed some time to think how to vote for this work...
|
|
|
|
 |
|
|
 |
|
 |
Hello and Happy New Year!
Do you remember our old discussion (see this thread, below)?
How is everything? I noticed your newer articles on JukeBox and MVVM...
I wanted notify you on my new work, because back then I noticed you've used Plossum library. I interested what it was and wanted to point out it could be a little too heavy-weight option, even though I liked to fundamental approach and quality of Plossum. At this moment, I planned to advice you to employ the approach I use (much easier to use, light-weight, yet extremely robust as it also develops meta-data driven method), but at that time I did not have anything good enough to publication.
This way, you gave me an idea of interesting publication. Thank you!
I planed to refine my code and publish an article. I was awfully busy, so it took some time.
By now, I've complete a small series of articles devoted to meta-data driven techniques applied to enumeration type, the last article is devoted to one application aspect of the topic: command line utility: Enumeration-based Command Line Utility -- it reference my other articles on the topic -- 3 in total.
I would be happy know your opinion if you could take a look at this thing.
Thank you and best wished in New Year!
Sergey A Kryukov
|
|
|
|
 |
|
 |
Hi!
Nice to hear from you again. I would be glad to read through your article and give you my points of view, as you did with my article. However, it may take 1-2 weeks before I reply since I am in the middle of another project of mine. Then, if suitable, I will replace Plossum with your framework and reference you in the article.
Happy new year to you as well!
|
|
|
|
 |
|
 |
Thanks a lot for your reply.
All right. I mostly interested to know what do you think.
Sergey A Kryukov
|
|
|
|
 |
|
 |
First of all, your attempt to help avoiding non-source code files in the submission set is quite useful.
I personally meet too many developers who do not even understand which files emerging during developing work are part of the source code, and which are not; this is really bad and question the very ownership of the code. Some of such developers even submit their articles for CodeProject or elsewhere.
But then, I was wondering if you're using any revision decent control system like Subversion, because it would streamlines whole process and virtually eliminate this problem.
To my surprise, I spotted in you article words about stripping SVN sub-directories. Then, do you really know who use revision control?
Look, you're creating artificial problems out of something designed to avoid them in first place!
Subversion is designed to eliminated unwanted files from the pure source, not to create them -- unless somebody abuses the tool.
First, you should set up your system to ignore unwanted files and sub-directories from attempted commits.
TortoiseSVN client offers convenient global ignore pattern to ignore all those "bin", "obj", "*.sln.cache", "*.user", "*.ncb", "*.suo", "Debug", "Release" and the like.
Secondly, why would anyone ever pack and submit a local checked-out development directory? To extract pure source, Subversion provides correct command called "Export".
RTFM, if I may say so...
Thank you.
Sergey A Kryukov
|
|
|
|
 |
|
 |
Hi SAKryukov and thank you for your feedback.
SAKryukov wrote: But then, I was wondering if you're using any revision decent control system like Subversion...
Yes, I am a daily user of both Tortoise SVN (.svn ignore) and Bazaar (.bzr ignore), and yes, my ignore patterns prevents unwanted files from getting committed. However, Zip My Code has a couple of benefits:
- It doesn't care if you use a version control system
- It doesn't care what coding language you are using
- It produces a attachable zip with minimal amount of work, something the Export functionality in Tortoise doesn't
- It doesn't require me to configure my compressing software to use zip (my personal choice is rar) with best compression
SAKryukov wrote: Secondly, why would anyone ever pack and submit a local checked-out development directory?
In my article Silver JukeBox with an Alternative Client I wanted to submit code with local changes, in that case without my Amazon Access Key Id.
To finish it off, I have read TFM but it didn't solve my issue.
Best regards,
Disore
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
Please don't get me wrong.
I do agree your software has significant value.
To re-formulate my concern: I simply think your point in the article text about removing revision control artifacts does not advertise your work well; if you will, your work itself is better than the way you describe it.
Back to my point, using your application would not help those people who misuse SVN by trying to submit working directories and those who do not understand which files are source file and which are not. (Believe me, this is a real-life and common problem.) By advertising this feature, you implicitly and unwillingly approve some sloppy practices of the people who may get benefit of your software. But this advertisement does not reach your goals because 1) it does not help those poor users anyway, 2) and because good users may mentally associate yourself with those poor users (as I did before your reply) because you kind of encouraged poor usage. This kind of advertising is quite legitimate; only less claim often advertise better then more...
Do you see my point? I am thankful for your work, but I would also prefer good work to be presented well, to everyone's benefit.
Sergey A Kryukov
|
|
|
|
 |
|
 |
I see your point, and the introduction is perhaps not as well written as intended. If you thought my main intent was removing revision control files and folders, others might too.
I will make my best effort to update the article this week, but if you have some hands on improvements it would be much appreciated (you will of course be credited in the history section).
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
Thank you for understanding all that.
Sorry, I don't have ideas for improvement of your code at the moment, neither I can get enough time for that.
However, in case I can see any way to improve it, I will gladly give you my detailed feedback. I would never miss a chance to help improving things.
Thank you.
Sergey A Kryukov
|
|
|
|
 |
|
 |
Ok, I took a look at you code. Not bad. It's accurately structured and simple.
I can see number of problems, mostly minor ones, as well as some room for improvement.
1) I would highly prefer console application only: configuration file on input (list of excluded file name patterns), zip on output goes to working directory; name of the zip file is constructed out of the name of working directory. Remember, you users are programmers. We know where our stuff is and used to working with texts.
As a big bonus, you will make your application running on Linux with no re-compilation -- via Mono (not just Linux but a lot more). You could also make it running on Mono also with System.Windows.Forms, but this would take some more effort.
Again, main benefit of console application is convenience.
2) Do you have source code of ICSharpCode.SharpZipLib.dll? I believe it is available in SharpDevelop. You need to provide a clear reference to the source code and give them credit.
3) Why not trying 7z? The problem with ZIP is patent issues; that is why Microsoft.NET does not provide ZIP. I heard ZIP is also available from J# run-time library. We would probably need to convince CodeProject editorial board to accept 7z. Alternatively, 7z code could be used for ZIP format. This is just the idea.
4) Now, if you really want WPF, there are issues with UI.
4a) The product does not have installation. This is good! But it would be nice to have un-installation, like “un-install and terminate”. During run-time the application leave some footprint where most recent user's configuration is stored. There must be an option to remove this.
4b) Desktop is a bad place for a default directory for user's project directory. (Desktops are for the lamer only, aren't they?) I would suggest using Working Directory for default. Again, remember your users are programmers.
4c) Your “Source path” control should be editable edit control. Again, remember your users are programmers. We would better off copying the path we need and pasting it there. Of course, then you will need to handle invalid directories.
4d) You need to use underscored label names to provide hot key navigation using “Alt+...”. Also, check up tab navigation: it should be intuitive.
4c) You have a problem with initial focus in main form. It should be set to “Source Path” (again, editable) control. And don't assume everyone will be happy clicking mouse. Programmers use keyboards much more then others.
4d) You have pretty bad XAMLs in terms of design time behavior. TaskDialog.xaml does not even open. This is fairly common with XAMLs (I hope next versions of VS will improve XAML things), but you need to check up all XAMLs in design time before you publish. Another design time problem is that your XAML windows break apart if you change window size. This is an Open Source product, not just a demo, so it should do well in design time. It is actually easier for you to make in a more accurate way, especially for your support. To achieve that, either use SizeToContent=WidthAndHeight for containers, or fill containers with content using proper margins and alignment. After you do this accurately, everything will be automatically adjusted to sizes. This effort will pay off in large.
Good luck!
Sergey A Kryukov
|
|
|
|
 |
|
 |
I have the last week been working on modifying the source code. I am not finished (article and downloadable code has not been updated), but wanted you to get an indication of the progress.
SAKryukov wrote: 1) I would highly prefer console application only: configuration file on input (list of excluded file name patterns), zip on output goes to working directory; name of the zip file is constructed out of the name of working directory. Remember, you users are programmers. We know where our stuff is and used to working with texts.
As a big bonus, you will make your application running on Linux with no re-compilation -- via Mono (not just Linux but a lot more). You could also make it running on Mono also with System.Windows.Forms, but this would take some more effort.
Again, main benefit of console application is convenience.
PARTIALLY FIXED. I have adapted the code to work as a console application. Here is the console interface:
usage: ZipMyCode path [/output:value] [/configuration:value] [/exclude:value[+value]]
path: Specifies the location and name of the folder you want to compress.
[/output:value]: Specifies the location and/or name of the compressed output file.
[/configuration:value]: Specifies the configuration file with exclude patterns, one pattern per line.
[/exclude:value[+value]]: Specifies the list of exclude patterns.
The application will however not run on Mono as the assembly are referring WPF specific .NET classes.
SAKryukov wrote: 2) Do you have source code of ICSharpCode.SharpZipLib.dll? I believe it is available in SharpDevelop. You need to provide a clear reference to the source code and give them credit.
FIXED. Added source code and added a new credits section in the article.
SAKryukov wrote: 3) Why not trying 7z? The problem with ZIP is patent issues; that is why Microsoft.NET does not provide ZIP. I heard ZIP is also available from J# run-time library. We would probably need to convince CodeProject editorial board to accept 7z. Alternatively, 7z code could be used for ZIP format. This is just the idea.
REJECTED. If CodeProject decide to use 7z I will add support for it.
SAKryukov wrote: 4a) The product does not have installation. This is good! But it would be nice to have un-installation, like “un-install and terminate”. During run-time the application leave some footprint where most recent user's configuration is stored. There must be an option to remove this.
IN PROGRESS
SAKryukov wrote: 4b) Desktop is a bad place for a default directory for user's project directory. (Desktops are for the lamer only, aren't they?) I would suggest using Working Directory for default. Again, remember your users are programmers.
4b) FIXED. Changed to Directory.GetCurrentDirectory().
SAKryukov wrote: 4c) Your “Source path” control should be editable edit control. Again, remember your users are programmers. We would better off copying the path we need and pasting it there. Of course, then you will need to handle invalid directories.
FIXED. Path is now editable and handles validation.
SAKryukov wrote: 4d) You need to use underscored label names to provide hot key navigation using “Alt+...”. Also, check up tab navigation: it should be intuitive.
FIXED. Changed TextBlocks to underscored Labels.
SAKryukov wrote: 4c) You have a problem with initial focus in main form. It should be set to “Source Path” (again, editable) control. And don't assume everyone will be happy clicking mouse. Programmers use keyboards much more then others.
FIXED. However using code behind but I am confused as to why FocusManager.FocusedElement="{Binding ElementName=sourceTextBox}" doesn't work in this situation.
SAKryukov wrote: 4d) You have pretty bad XAMLs in terms of design time behavior. TaskDialog.xaml does not even open. This is fairly common with XAMLs (I hope next versions of VS will improve XAML things), but you need to check up all XAMLs in design time before you publish. Another design time problem is that your XAML windows break apart if you change window size. This is an Open Source product, not just a demo, so it should do well in design time. It is actually easier for you to make in a more accurate way, especially for your support. To achieve that, either use SizeToContent=WidthAndHeight for containers, or fill containers with content using proper margins and alignment. After you do this accurately, everything will be automatically adjusted to sizes. This effort will pay off in large.
FIXED. Visual Studio is now capable of showing the UI in design mode. Improved resize behaviour by having MainWindow specify the sizes and not the individual views themself. However, MainWindow will still look funny when resizing the window manually since there is no ideal element to use as fill element.
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
Article has now been updated thanks to your extremely useful remarks, thank you!
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
Very nice.
Thank you for all this work and your constructive approach to criticism and advice.
You got quite good reader's acceptance for this work. My congratulations!
A couple of final notes:
I would still regret a bit about lack of compatibility with W2K and Mono, not only due to WPF, but also due to use of somewhat extended syntax. You could segregate non-UI part in separate assembly and re-use it by UI and non-UI versions. Not to worry though: anyone who needs that kind of compatibility could use your work to create a derived work and craft a non-UI or Windows.Forms version.
It should not be too hard to do. I actually like your neat project structure and UI isolation (your article on View Model is very interested by could provide more explanation).
Using of very advanced and flexible Plossum library for this application looks like a bit of overkill to me. I hardly can imagine a basic but sufficiently comprehensive command line parser of more than one source file or two. Perhaps I would need to publish my own method before I can argue about it. There is nothing wrong in using this library though.
Thank you again. Wish you all the best in New Year!
Sergey A Kryukov
|
|
|
|
 |
|
 |
Hi SAKryukov.
SAKryukov wrote: I hardly can imagine a basic but sufficiently comprehensive command line parser of more than one source file or two. Perhaps I would need to publish my own method before I can argue about it.
The reason I chose a third-party command line parser was because I wanted to focus on other parts of the code. There are plenty solutions out there, but actually none of them (including Plossum) was supporting all of my requirements:
1. Registration of named arguments, either using attributes (like Plossum and also NConsoler) or using some kind of registration method
2. Registration of unnamed arguments (doesn't featured by Plossum, in fact really poor support for it)
3. Supporting AND/OR when it comes to named arguments, e.g. I support the following CLI:
some.exe /c:file.txt
some.exe /u
but the named arguments c and u isn't allowed together. NConsoler forces me to use the following syntax:
some.exe compress /c:file.txt
some.exe uninstall
which is the solely reason I didn't go with it.
4. Automatically handling and printing usage
5. Automatically handling and printing error messages
Happy new year, with hopes of many new articles on CodeProject
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
1) I would add more to the default list of ignore patterns. For example, do you know that Subversion offer a choice between "_svn" and ".svn"?
2) That said, would be even better to offer an option to use a custom ignore patterns file provided by the user, instead of just using most recent settings. In this way, the user may want to keep different files for different project "profiles". For example, I sometimes develop on different platform, using different languages...
Thank you.
Sergey A Kryukov
|
|
|
|
 |
|
 |
I cannot express the amount of gratitude I feel for your constructive comments. I will start right away modifying the code, and will reply with comments as I go through your comments one after the other. The first thing I will tackle is allowing Zip My Code to be used as a console application.
Best regards,
Disore
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
SAKryukov wrote: 1) I would add more to the default list of ignore patterns. For example, do you know that Subversion offer a choice between "_svn" and ".svn"?
FIXED. Added "_svn". Do you have any other ignore patterns you would like as default.
SAKryukov wrote: 2) That said, would be even better to offer an option to use a custom ignore patterns file provided by the user, instead of just using most recent settings. In this way, the user may want to keep different files for different project "profiles". For example, I sometimes develop on different platform, using different languages...
FIXED. Console interface supports configuration files.
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
http://zipsolution.codeplex.com/
|
|
|
|
 |
|
 |
Nice Didn't know about that project
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
I understand the goals of MVVM and objectively they are great BUT when one examines your code it is not readily apparent how things work.
The example functions well and the file / directory filtering functionality is great I just do not see an advantage to this design pattern.
It is easy to crititcize but much harder tooffer a realistic solution.
|
|
|
|
 |
|
 |
Hi kidzopa.
I can definitely see your point. The MVVM pattern introduces another abstraction layer where the View and ViewModel are separated. The amount of separation is up to the developer. In my post about the dialog service William E. Kempf, the author of CodePlex project Onyx, strongly argues that the View can and should know about the ViewModel. I however draws to the opposite side and wishes that no knowledge what so ever should be shared between them.
Just to clarify your point, is it the extra abstraction layer imposed by MVVM you find complicating or my design of it? Regarding MVVM in general, it is not necessary to implement a small application, like this one, using the pattern. But as a application grows the abstraction helps with unit testing, scaling and basic black box concept. The same rules apply for Prism, it is not a necessity but will help you on the way during the application lifetime.
If it is my design of the pattern you feel compelling I am willing to straiten the question marks for you. Could you be more specific about what areas you are referring to, and have you read my previous article before this one?
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |
|
 |
Chris,
I will take a look at the other article and make a more coherent set of comments. I like the concept of making a testable ui.
I hope to have time by the end of the week
Cheers,
It is easy to crititcize but much harder tooffer a realistic solution.
|
|
|
|
 |
|
 |
I get a 500 server error when I try to download which is interesting as it doesnt appear anywhere else.
|
|
|
|
 |
|
 |
Weird, very weird. Try it again, I just did and it worked for me
Why is it drug addicts and computer afficionados are both called users?
--Clifford Stoll
|
|
|
|
 |