r/backtickbot • • May 20 '21

https://np.reddit.com/r/visualbasic/comments/ngimhd/what_is_your_code_style_regarding_blank_lines/gyspb9t/

Same as many other VB.Net user, I also view it as paragraph but I add 2 more case to instead blank line, in case if that part of code take much time to read then normal, other case is it already 5 lines and it still easy to read even if I instead blank line between it.

Example.

Function Q_rsqrt_test(Base As ULong,
                      Correnctness_reccord As Dictionary(Of ULong, List(Of Single))) As ULong

    Dim DT(Correnctness_reccord.Count - 1), Y As Single, 
        Number = 1.0F / Base

    Y = (&H5F3759DF - (Number.as(Of Integer) >> 1)).as(Of Single)

    Dim R = 1.0F / MathF.Sqrt(Number),
        I = 0UL
    Const Limit = 10000UL

    Do Until Y = R
        Y = correcting_result(Number, Y)
        If I < DT.Length Then DT(I) = deviation(R, Y)
        I += 1

        If I = Limit Then
            For N = 1 To Correnctness_reccord.Count
                Correnctness_reccord(N).Add(DT(N - 1))
            Next
            Return I
        End If
    Loop

    Return I
End Function
1 Upvotes

0 comments sorted by