[Python] Why do all versions of VB still keep C and Python style while statement? [closed]

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    In C/C++/C#/Java, while statement is an important statement for looping:

    while (condition) {
    statement;
    }


    So it is with Python. In Python the syntax of while statement is

    while condition:
    statement


    VB contains Do Loop statement, which can do the same thing as C/C++/C#/Java and Python by using While clause

    Do While condition
    statement
    Loop


    However, VB6 and Office VBA still keeps C and Python style While statement

    While condition
    statement
    Wend


    which is equivalent to

    Do While condition
    statement
    Loop


    VB.NET still contains this kind of While statement, but the syntax becomes

    While condition
    statement
    End While


    The question is: Why do all versions of VB still keep C and Python style While statement, even if this statement can be completely replaced by its own Do Loop statement with While clause?

    Continue reading...

Compartilhe esta Página