My little suggestion for X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
xinjie
Posts: 108
Joined: Wed May 20, 2020 10:05 am
Location: China
Contact:

My little suggestion for X#

Post by xinjie »

Hi,

I have noticed some slight differences between Ver 2.19 and previous versions when creating console applications using the Visual FoxPro dialect(by template).

In the previous version was the following code:

Code: Select all

? "Hello World! Today is ",ToDay()
ToDay() was changed to Date() in ver 2.19.

The following opinion is based on the fact that I'm a programmer who has been using VFP for a long time, but my knowledge of the .NET world is almost zero!

I would suggest keeping the use of ToDay() and adding the comment that this is a function provided by the Core dialect and that Visual FoxPro can use functions from the Core dialect.

The advantage of this approach is that a VFP programmer such as myself will understand the help better when it is based on the existing help documentation system. I'm assuming that such cross-dialect function calls are allowed, so this tells VFP programmers that it's possible to use the Core dialect to do things in X# that the Visual FoxPro dialect doesn't yet do.

In addition, based on my very limited experience with X#, I would suggest adding the following statement:

Code: Select all

Using Static System.Console    && X# new language features :XSharp allows you to use the using statement to link to a static class and call the methods in this class as if they are functions.
And add the code:

Code: Select all

// call the methods of Static System.Console  static class
WriteLine("------------------")
WriteLine("After Using Block")
Although the suggested content I learned by studying the help and other whitepapers, I think the templates accelerate the conversion of pre-existing VFP programmers by making it easier for them to understand and accept X# with such a change. Especially for VFP programmers like me, who number at least in the thousands in China.

I'm sure this situation exists in other countries as well, perhaps not as dramatically as in China.

Forgive me for what may be reckless advice
简单的东西重复做,你能成为专家;重复的东西用心做,你能成为赢家!
User avatar
xinjie
Posts: 108
Joined: Wed May 20, 2020 10:05 am
Location: China
Contact:

Re: My little suggestion for X#

Post by xinjie »

Addendum: My second bit of advice actually tells programmers like me the fact that the .NET world is not a mystery.
简单的东西重复做,你能成为专家;重复的东西用心做,你能成为赢家!
User avatar
Chris
Posts: 4961
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: My little suggestion for X#

Post by Chris »

Hi,

I think Robert made that change in the VFP template because FoxPro does not have the Today() function, so was changed to Date() to make VFP programmers feel more "at home". But you can still use Today() if you like, both functions are actually defined in the same runtime dll (XSharp.RT) and are available to all X# dialects.

Regarding .Net classes/methods and VFP functions, in my opinion it's better to keep them separate. Anyone new coming to .Net programming will need sooner or later to learn (many!) new concepts like namespaces, static methods etc, so I think it's better to have to clear that VFP-compatible functions are available in X# and can be used and called exactly like you could do in FoxPro, but there's also a new way, with the .Net Framework classes which are used in a different way, because they are not functions (in VFP/Vo/xBase terms). But that's only my personal opinion on this.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
xinjie
Posts: 108
Joined: Wed May 20, 2020 10:05 am
Location: China
Contact:

Re: My little suggestion for X#

Post by xinjie »

Hi, Chris

Thank you for your patience in explaining.

Maybe I think about things in a narrow way. However, it truly expresses my intention: to use another method that is less familiar to VFP programmers but can be completely

(Edit to add: VFP programmers who don't know anything about the .NET Framework can be under the “illusion” that they simply need to change IDEs.
Last edited by xinjie on Mon May 13, 2024 8:28 am, edited 1 time in total.
简单的东西重复做,你能成为专家;重复的东西用心做,你能成为赢家!
User avatar
Chris
Posts: 4961
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: My little suggestion for X#

Post by Chris »

Hi Xinjie,

Yes I understand you, I just think it's better that in a first small test app it is better if VFP programmers see something that is familiar to them. If they create a first very small test app and already see a function that is not familiar to them, then that might be discouraging already. For the same reason I would not put a USING STATIC there either, as this another new concept. Actually I would even remove the USING statements that are already there, from this basic sample.

But of course we can add another VFP template for more "advanced" stuff, a sample using other X# functions, .Net methods and other concepts like the ones you mentioned. Would you be interested in creating one? Just the code, we can do the rest and add it as a new template.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
xinjie
Posts: 108
Joined: Wed May 20, 2020 10:05 am
Location: China
Contact:

Re: My little suggestion for X#

Post by xinjie »

Hi,Chris

I'm more than happy to oblige!

I'm quickly practicing X# and trying to create a small tool using the console, I'll be in touch with the development team when I've finished it and streamlined it to the point where I can call it a template.
Chris wrote: Mon May 13, 2024 8:20 am Hi Xinjie,

Yes I understand you, I just think it's better that in a first small test app it is better if VFP programmers see something that is familiar to them. If they create a first very small test app and already see a function that is not familiar to them, then that might be discouraging already. For the same reason I would not put a USING STATIC there either, as this another new concept. Actually I would even remove the USING statements that are already there, from this basic sample.

But of course we can add another VFP template for more "advanced" stuff, a sample using other X# functions, .Net methods and other concepts like the ones you mentioned. Would you be interested in creating one? Just the code, we can do the rest and add it as a new template.
简单的东西重复做,你能成为专家;重复的东西用心做,你能成为赢家!
Post Reply