Page 2 of 2 FirstFirst 12
Results 41 to 45 of 45

Thread: The most lacking language feature in VB6

  1. #41

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,447

    Re: The most lacking language feature in VB6

    Quote Originally Posted by wqweto View Post
    If it's so easy for Olaf to impl this (in your opinion) then by transitivity it should be at least as easy to provide such declarative XAML support in your scripting language too.

    cheers,
    </wqw>
    I know what you want to express, you never seem to know what I'm doing.

    What I'm trying to say is that Olaf can always implement a certain feature in a more ingenious way. But the way I do it tends to be clunky, in fact I've implemented something similar in my WebBuilder.

    Also, my scripting language doesn't have much to do with RC6. But if Olaf develops the Next-Basic compiler, then my scripting language may be associated with his compiler.

    Edit:
    I always delete something that I actually want to say to you because it doesn't have any value and it doesn't make a person change anything.
    Last edited by SearchingDataOnly; May 31st, 2022 at 08:44 AM.

  2. #42
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,600

    Re: The most lacking language feature in VB6

    Quote Originally Posted by SearchingDataOnly View Post
    What do you think of the following way?
    Code:
        With New FormBuilder
            .AddXML "<Window Class='MainWindow' Title='MainWindow' Height='523' Width='858' AllowsTransparency='True' WindowStyle='None'>"
            .AddXML "    <Window.Background>"
            .AddXML "        <ImageBrush ImageSource='/Global-Warming-PNG-Clipart.png'/>"
            .AddXML "    </Window.Background>"
            .AddXML "    <Button HorizontalAlignment='Left' Height='143' Margin='383,328,0,0' VerticalAlignment='Top' Width='229'>"
            .AddXML "        <Button.Background>"
            .AddXML "             <ImageBrush ImageSource='/sample.png'/>"
            .AddXML "        </Button.Background>"
            .AddXML "    </Button>"
            .AddXML "</Window>"
            
            .Show vbModal
        End With
    IMO, Olaf should easily provide the above solution in RC6. I would also like to implement the above declarative programming on my scripting language.

    Also, XML seems to be more concise, clearer, and more object-oriented than JSON when it comes to describing UI.
    Yea I think this is a good idea. In fact, I thought about doing something like this myself at one point when I was testing out TwinBASIC before it had UI features. Such a thing could be useful for producing detailed UIs without the help of a designer.

    Quote Originally Posted by wqweto View Post
    If it's so easy for Olaf to impl this (in your opinion) then by transitivity it should be at least as easy to provide such declarative XAML support in your scripting language too.

    cheers,
    </wqw>
    If you have a recursive descent parser handy it could be tasked to process an XML based language. The resultant AST could then be used to generate equivalent .FRM code which the VB6 designer can process. It doesn't seem too difficult to accomplish though I'm sure there are a lot of unforeseen traps that may require clever workarounds.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #43
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: The most lacking language feature in VB6

    Quote Originally Posted by SearchingDataOnly View Post
    What do you think of the following way?
    Code:
        With New FormBuilder
            .AddXML "<Window Class='MainWindow' Title='MainWindow' Height='523' Width='858' AllowsTransparency='True' WindowStyle='None'>"
            .AddXML "    <Window.Background>"
            .AddXML "        <ImageBrush ImageSource='/Global-Warming-PNG-Clipart.png'/>"
            .AddXML "    </Window.Background>"
            .AddXML "    <Button HorizontalAlignment='Left' Height='143' Margin='383,328,0,0' VerticalAlignment='Top' Width='229'>"
            .AddXML "        <Button.Background>"
            .AddXML "             <ImageBrush ImageSource='/sample.png'/>"
            .AddXML "        </Button.Background>"
            .AddXML "    </Button>"
            .AddXML "</Window>"
            
            .Show vbModal
        End With
    IMO, Olaf should easily provide the above solution in RC6.
    I wouldn't want to, for several reasons...

    Main-reason: The VB-language is more expressive and elegant (compared to XML)...
    and the equivalent and complete VB6-code for the above is the following
    (when you include the prebuild Widgets as a reference to: "RCWidgets"):
    Code:
    Sub Main()
      Cairo.ImageList.AddImage "imgBG", App.Path & "\Global-Warming-PNG-Clipart.png"
      Cairo.ImageList.AddImage "img_1", App.Path & "\sample.png"
     
      With Cairo.WidgetForms.Create(6, "Transp-Form", True, 858, 523)
        .WidgetRoot.ImageKey = "imgBG"
        .Widgets.Add(New cwImage, "img_1", .Width - 143, 0, 143, 143).Widget.ImageKey = "img_1"
        .Show vbModal
      End With
    End Sub
    One code-module, and just a few lines (including intellisense-support for the Parameters -
    the resource-loading-part properly separated from the "consumption of the resource-Keys").

    Secondly - when you want a larger Form-area (or certain complete Forms) "UI-wise declarative",
    then it's easy enough to span a WebView2-Browser-Control over such areas,
    and use HTML5+CSS to do such "declarative, user-customizable stuff".
    (knowledge-for HTML5/CSS is much more widespread than XAML-knowledge).

    XAML will become a pain in the posterior, when Layouts get "too complex" or "too dynamic"
    (and for proper EventHandling you will need "CodeBehind-modules" anyways)

    Olaf

  4. #44
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,600

    Re: The most lacking language feature in VB6

    Quote Originally Posted by Schmidt View Post
    Main-reason: The VB-language is more expressive and elegant
    Expressive yes, VB6 is an imperative language after all. However, elegant? I don't think so. XML based languages are problematic, that I agree with. The only reason it's tolerable in WPF is because of how extremely powerful the Visual Studio intellisense is. The code practically writes itself. However, when it comes to designing UIs, a declarative language will always be more elegant than an imperative one.

    Let me point to a one of the core issue of using imperative languages for UI design, one that disturbs me a lot personally:-
    Code:
    Me.Controls.Add(New Button With {.Text = "Press me", .Width = 300, .Height = 25})
    The above adds a Button to a Form in a WinForms application. It shows one of the core issue with imperative languages and UI code. It's invoking a constructor, calling methods and setting properties. These things makes sense when you're dealing with algorithms that process input to produce an output. A UI on the other hand is not about computing so why are do we need all this baggage if we aren't using it to compute anything. What we need is to describe the UI, not compute it. Look at the equivalent code in HTML:-
    Code:
    <button style="width:300px; height:25px;"> Press Me! </button>
    The above removes all the elements that relates to computation and algorithmic flow like calling object constructors or Add methods. It's a simple description of what we want and not how to do it.

    Now to be clear, this is not to say that suitable ways of using imperative languages to create UIs, your widget components seem to handle it well enough, but in general, you're going to be better off using something declarative like HTML or XAML.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #45
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: The most lacking language feature in VB6

    Well in todays world there are a lot of things missing from VB6, it is after all ~25 years old. Lots of new things have came along over the last 20 years and are not in VB6, in many cases there are APIs, 3rd party tools or custom classes that can allow VB6 to handle some of these things but really when you get down to it VB6 is great at doing what it was meant to do and if you want to do things that were not even thought of until 10 years after VB then the best choice is to use a language that has built in support for whatever it is you want to do.

    It makes far more sense to translate a VB6 program to C or Java or whatever than to go the other way.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width