dotnet / vblang

The home for design of the Visual Basic .NET programming language and runtime library.
289 stars 65 forks source link

[PROPOSAL] Allow Multi-Line Comments #592

Closed salelele closed 3 years ago

salelele commented 3 years ago

If you sometimes have to type comments that span multiple lines then it can become boring typing the REM (') after each line. I Propose we extend the syntax with:

`'/ These are my
' multiline 
' comments /'`

Upon typing of the opening '/, VB.Net could automatically insert the closing /' and insert a REM (') for each successive line of comments. This would greatly simplify adding comments that truly describe a piece of code anywhere inside a code module.

AdamSpeight2008 commented 3 years ago

I VB did support multi-line comments, I think promoting Rem for its long service the language, to a full block structure. eg Rem ... End Rem or

Rem
  This is a comment
End Rem
salelele commented 3 years ago

Thank you @AdamSpeight2008 for expressing it well. Rem...End Rem is a better way to express what I mean to say,

VBAndCs commented 3 years ago

I like the Rem End Rem idea. But sense nothing will happen in the compiler, I advise you to type all the lines you want, select them, and click the Block comment command from the toolbar to comment them all at once.

paul1956 commented 3 years ago

I am not sure this would work anyway, Rem on a line is perfectly valid with nothing but under this proposal the parser would not know if it needed to close the block or this is a single line comment and could end up commenting out the entire program and then report missing Rem End

AdamSpeight2008 commented 3 years ago

Rem ... End Rem Would presume to be a single rem (to end of line) comment, until it encountered an End Rem.

michieal commented 3 years ago

A couple of things... 1) the language, VB.NET, is dead. It was a good run, and I loved every minute of it. 2) There are a ton of good VB Programmers out there... 3) Have you read the MIT License attached to Rosalyn? If not, you should. Being a (now) dead language, and open sourced, with a liberal license... I have to wonder why great programmers are complaining that Microsoft won't do X.

Now, for the On Topic portion: You would use a Compiler directive, to allow both the compiler and the parser know that it's a block comment. Which, btw, would be the easiest way to implement it. So:

Rem

    This is my 
    multi-
    Line
    Comment. What do you think?

End Rem

This allows both to differentiate between the keyword Rem and the proposed block comment, and it would allow IDE's to collapse the comment down properly, and can also allow for a Comment Block Title to show in the collapsed line. (#Rem "Title text"...#End Rem) (Think Regions, but it's not included in the compile.)

It's at this point in time, that my seriously younger self is screaming "SEE!!! I told you that I needed to continue developing IDE's and compilers!!!" and I wish that I had of listened. Instead, I have like 50 different dotnet repo downloads with the thought of "Gee, it'd be nice to have this on Linux, now that I use Linux too."

VBAndCs commented 3 years ago

@michieal

Have you read the MIT License attached to Rosalyn? If not, you should. Being a (now) dead language, and open sourced, with a liberal license... I have to wonder why great programmers are complaining that Microsoft won't do X.

We are excepting to hear some good news from Anthony Green (https://anthonydgreen.net) in this month. To discuss such things, please join VB.NET community room on Gitter: https://gitter.im/VB-NET/community

KathleenDollard commented 3 years ago

@michieal VB.NET is not dead. Microsoft does not have plans to evolve it, but that does not mean it is dead

VBAndCs commented 3 years ago

@KathleenDollard

VB.NET is not dead. Microsoft does not have plans to evolve it, but that does not mean it is dead

Not evolving equals dead. In fact most beginners got this exact message 4 years ago, when VB was caged in windows desktop apps only, so, you can review all beginners topics in VB or VS.NET forums asking what language is better to learn, and you will find vb devs themselves answering that VB is easier to learn, but C# will allow you to do more and have more job opportunities! This is why I kept shouting since day 1 here: MS is killing VB on purpose. It is sad that VB team didn't realize that early (at least as they still claiming).

michieal commented 3 years ago

@michieal VB.NET is not dead. Microsoft does not have plans to evolve it, but that does not mean it is dead

@KathleenDollard I would offer you the opportunity to google search those words. The last time VB was updated was in 2018. Right before Microsoft itself announced that VB.Net is dead. But, to be fair... some people say that COBOL isn't dead. And, there's a small shop outside of Flint MI that has been around since the 1960s. They use it, "therefore it's not dead." (I got a job offer from them in 2014 via LinkedIn). COBOL hasn't been updated in 60 yrs... And, 58 yrs from now, that one last person using vb.net will say the same thing even though VB "hasn't been updated in 60 yrs" at that point too. shrugs But, my actual point was completely missed, especially by Kathleen. That the source code is available, open source, and liberally licensed... If a new form of Basic shows up, that can access the .Net framework, and is cross platform (including the IDE) .. what do you think would happen? Maybe the VBLang repository might get updated? Or, would MS put the final nail in VB.NET and let whomever take it over?

VBAndCs commented 3 years ago

@michieal

But, my actual point was completely missed

I pointed out that @AnthonyDGreen is working on new VB.NET features on his fork. Antony was the VB.NET PM b4 leaving MS. Besides, there is a new VB.NET successor in beta now, called Mercury. It is not based on Roslyn, but it is fully compatible with VB.NET and targets .NET framework and .MET core besides other non-MS frameworks, so it runs cross-platform and do ASP.NET Core and Mobile apps. We, the community, took a year discussing this situation and studying alternatives and be sure, we will not let VB.NET die.

michieal commented 3 years ago

@VBAndCs I'm glad to hear this.

pricerc commented 3 years ago

VB.NET is not dead. Microsoft does not have plans to evolve it, but that does not mean it is dead

That may be 'technically' correct, but Microsoft has put it on life support, and for anyone who has used Microsoft products for more than 10 years will know, that's the first step towards pulling the plug.

Microsoft has a penchant for pulling the plug on tools that I've gotten used to using and were awesome for my small business customers.

The constant technological churn and obsession with turning out new features before the old ones are fixed is why more and more people are choosing open source solutions over Microsoft products. VB has become a victim of that same mentality at Microsoft.

michieal commented 3 years ago

The constant technological churn and obsession with turning out new features before the old ones are fixed is why more and more people are choosing open source solutions over Microsoft products. VB has become a victim of that same mentality at Microsoft.

And that is exactly why, after 40 years (ish) of using Microsoft OS's, I finally switched to Linux. Because MS made a new segoe font for their metro bs rather than fixing the known bug that has been in their OS since WinXP was first released. After fighting with said bug for 6 months, I called it quits - much like what MS has done with VB.Net. VB.Net is stable, and functional, hence Microsoft can't sell a "new, improved, look at all of our bug fixes" version. Microsoft put vb 6 on the backburner when they released vb.net. 5 yrs later, the dropped mainline support for it, and offered a converter to upgrade to vb.net. The same occurred in 2008 when they dropped Enterprise support. And that was the last time they offered an updater/converter to vb.net. This discussion is because people forget the past, and pine for the future.

michieal commented 3 years ago

@VBAndCs I took a look at Mercury and remembered looking at it before... I'm not paying 3 guys $500 a year for a program that I have to run in a VM. Especially not when I can run VS 2017 in said VM, and do effectively the same thing. Or, I could just buy (It think it's Pure Basic? or something... there's a vb.net Linux clone out there that's multiplatform.)

VBAndCs commented 3 years ago

@michieal It depends in your code-base. Companies with huge VB.NET code-base will see a 500$ a trivial price to maintain their apps up-to-date and running efficiently. But your point is important for small business, and this is why we are thinking of a Roslyn-based alternatives. The expected XML=Literals-bases features can make VB.NEt make wonderful things, and catch up with C#. A working example of this is my Vazor (the VB.NET Razor), which I used to crate the VB.NET version of eShopOnWeb. Anthony Green expanded the idea and provided prototypes to work with WPF and Xamarin. I am waiting for him to complete his work to take this further to a XML-Literals-based dynamic-XAML SilverLight-alike Asp.net framework to get rid of HTML, CSS, JS and even Blazor, and work directly with a pure XAML and IL web apps. (Anthony has a prototype to make VB code work in the browser by translating it to JS using expression trees, but I don't want to use any translation, and transfer every thing via XAML and IL code). Also, I have an idea to crate wpf-forms , a wpf based windows forms, that combines winforms simplicity with wpf power. A glimpse of this can be seen in this prototype of Small Visual basic where I added a wpf form designer to the Small Basic language (this is still in early stages, just a small working prototype and of course the controls library is limited and written in a complex way to fit small basic, which will not be the case if it is written for VB.NET and C#).

michieal commented 3 years ago

It depends in your code-base. Companies with huge VB.NET code-base will see a 500$ a trivial price to maintain their apps up-to-date and running efficiently. But your point is important for small business, and this is why we are thinking of a Roslyn-based alternatives.

Huge corporations, it's a non-issue. But, as you said... for the rest of us, including small businesses... It's kind of insane. I get that companies want to be profitable, and have returning, recurring income... but subscription software only works (and only grudgingly) if the company has cornered the market and there are no other alternatives.

Most get caught up on the ($)($) in their eyes, but if you think about it... I have 30 developers under me, plus myself. At the price point of $500 per station, times 31 stations... that's $15500 per year alone on a IDE. After 3 years, that's the equivalent of buying a house, or a small office building somewhere... Or, Paying those 31 developers to make a freaking IDE / compiler with a few modifications... as 99.8% of the work is done and on github. And, VMWare is free, and and so is VS. Therein lies the problem with subscription based IDEs. (JetBrains Rider, also faces this, but has enough java developers using their wash-rinse-repeat web development suites to offset their losses they may incur.)

The expected XML=Literals-bases features can make VB.NEt make wonderful things, and catch up with C#. A working example of this is my Vazor (the VB.NET Razor), which I used to crate the VB.NET version of eShopOnWeb. Anthony Green expanded the idea and provided prototypes to work with WPF and Xamarin. I am waiting for him to complete his work to take this further to a XML-Literals-based dynamic-XAML SilverLight-alike Asp.net framework to get rid of HTML, CSS, JS and even Blazor, and work directly with a pure XAML and IL web apps. (Anthony has a prototype to make VB code work in the browser by translating it to JS using expression trees, but I don't want to use any translation, and transfer every thing via XAML and IL code). Also, I have an idea to crate wpf-forms , a wpf based windows forms, that combines winforms simplicity with wpf power. A glimpse of this can be seen in this prototype of Small Visual basic where I added a wpf form designer to the Small Basic language (this is still in early stages, just a small working prototype and of course the controls library is limited and written in a complex way to fit small basic, which will not be the case if it is written for VB.NET and C#).

I've not checked out your Vazor, but I did download the SmallBasic ide. I like what you did with it. Also, as a small note, you should consider VB.NET -> IL / ILASM -> WebAsm. WebGL/Webassembly is supported across all modern browsers, and will be very simple to implement - UnoPlatform with Prism does this... Also, Uno/Avalonia/Maui cross platform UI implementation / builder. As an accomplished Game Developer, the thing that I LOVE about Unity Technologies' Unity3D is that it's write once, build for all platforms. It's literally build once, ship to all customers. And, that - that's the important point. Microsoft watched Unity Technologies, and said "hey, we can do that too" and ported .NET to dotnet and it's cross platform. Being able to get everyone to buy your software means that you don't HAVE to rely on subscriptions to make money. (I mean, you're going to make upgrades and evolutionary changes... hell MS became the biggest with that model. even with rampant software piracy.) Think about it.

VBAndCs commented 3 years ago

I expect they will reduce the coast after covering the development expanses. Blazor WASM has many issues, such as initial download size, slowness and limited DOM manipulation. Using Xaml can get rid of all legacy web non-sense. I was exited with silver-light and felt it was a wast to throw it away. If one has to download Blazer components and .net runtime for WASM for every single site, it will be easier to download a xaml-based web runtime once to run all xaml sites (supposing browsers will not support it). When I find time, I will write a small prototype to make a client app communicate with a server app via xaml, and see how it goes.

You mentioned COBOL b4. Look at this :) https://visualstudiomagazine.com/articles/2021/04/15/cobol.aspx

michieal commented 3 years ago

I expect they will reduce the coast after covering the development expanses. Blazor WASM has many issues, such as initial download size, slowness and limited DOM manipulation. Using Xaml can get rid of all legacy web non-sense. I was exited with silver-light and felt it was a wast to throw it away. If one has to download Blazer components and .net runtime for WASM for every single site, it will be easier to download a xaml-based web runtime once to run all xaml sites (supposing browsers will not support it). When I find time, I will write a small prototype to make a client app communicate with a server app via xaml, and see how it goes.

I was thinking more just webgl... I saw that being the end of javascript, except for a dirty loader. Wasn't necessarily referencing Blazor's implementation... I've used webgl compilation in Unity 3D for web games. And, that's a download once, use many, many times. You download the blobs, and it goes into the browser's user storage, and the program is set. Much like downloading (but not having to install) a program, and running it. structured language, no stupid hacks during coding, intelligent error reporting... yeah.

You mentioned COBOL b4. Look at this :) https://visualstudiomagazine.com/articles/2021/04/15/cobol.aspx

^ LMFAO ^

I was asked a few years back by the local college I did programming expos for if I knew Cobol, and could help "migrate" (code for keep our cobol systems going, we hate new stuff) a couple of local company's programs from cobol to vb.net. I declined. I hated cobol as a kid on a C64... I'm definitely not going to do it now on any machine. lol. Anyway, shoot me a link when you write that cli/serv app with xaml. I'd love to check it out.