Click here to Skip to main content
15,909,205 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Time for a new programming language paradigm Pin
PIEBALDconsult21-May-14 9:43
mvePIEBALDconsult21-May-14 9:43 
GeneralRe: Time for a new programming language paradigm Pin
Stefan_Lang21-May-14 21:30
Stefan_Lang21-May-14 21:30 
GeneralRe: Time for a new programming language paradigm Pin
rjmoses22-May-14 6:54
professionalrjmoses22-May-14 6:54 
GeneralRe: Time for a new programming language paradigm Pin
snorkie22-May-14 7:04
professionalsnorkie22-May-14 7:04 
GeneralTime for Klingon developers to rule the world Pin
CPallini21-May-14 9:22
mveCPallini21-May-14 9:22 
GeneralRe: Time for Klingon developers to rule the world Pin
PIEBALDconsult21-May-14 9:44
mvePIEBALDconsult21-May-14 9:44 
GeneralRe: Time for Klingon developers to rule the world Pin
CPallini21-May-14 9:47
mveCPallini21-May-14 9:47 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg21-May-14 13:59
Colborne_Greg21-May-14 13:59 
20 years of programming in Cobol, C++, and html

The language that meets your requirements is Visual Basic 2013.
Everything that C++ can do Visual Basic 2013 can do.
Here is an example of code, with no documentation, lets see if you can figure out what it does.

Public Interface iArray(Of someType)
    Event ItemAdded(ByRef Item As someType)

    Sub AddRange(Range() As someType)
    Function Clear() As someType()
    Property Collected() As someType()
    Function Count() As Int64
    Property Item(Index As Int64) As someType

    WriteOnly Property NewItem() As someType
    WriteOnly Property NewItems As someType()
    Property Populated As Boolean
    Function LastIndex() As Int64

End Interface
<Serializable>
Partial Public Class Array(Of SomeType)
    Implements iArray(Of SomeType)

    Private mCollected() As SomeType
    Private mPopulated As Boolean


    Public Event ItemAdded(ByRef Item As SomeType) Implements iArray(Of SomeType).ItemAdded


    Public Property Collected() As SomeType() Implements iArray(Of SomeType).Collected
        Get
            If mCollected Is Nothing Then mCollected = New SomeType() {}
            Return mCollected
        End Get
        Set(value As SomeType())
            mCollected = value
        End Set
    End Property

    Public Sub AddRange(Range() As SomeType) Implements iArray(Of SomeType).AddRange
        Allocate(Collected, Range)
        Populated = True
    End Sub
    Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Value As SomeType) As SomeType()
        Return Allocate(TheArray, Value, LastIndexOf(TheArray))
    End Function
    Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Values() As SomeType) As SomeType()
        Return Allocate(TheArray, Values, LastIndexOf(TheArray))
    End Function
    Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Values() As SomeType, ByRef Index As Int64) As SomeType()
        Try
            For Current As Int64 = 0 To Values.Length - 1
                Allocate(TheArray, Values(Current), Index + Current)
            Next
        Catch
        End Try
        Return TheArray
    End Function
    Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Value As SomeType, ByRef Index As Int64) As SomeType()
        Try
            TheArray(Index) = Value
        Catch
            ReDim Preserve TheArray(Index)
            TheArray(Index) = Value
        End Try

        Return TheArray
    End Function
    Public Property Item(Index As Int64) As SomeType Implements iArray(Of SomeType).Item
        Get
            Return Collected(Index)
        End Get
        Set(value As SomeType)
            Allocate(Collected, value, Index)
            Populated = True
        End Set
    End Property
    Public Function Clear() As SomeType() Implements iArray(Of SomeType).Clear
        Clear = Clear(Collected)
        Populated = True
    End Function
    Public Shared Function Clear(ByRef TheArray() As SomeType) As SomeType()
        TheArray = Nothing
        Return TheArray
    End Function
    Public Function Count() As Long Implements iArray(Of SomeType).Count
        Return Collected.Length
    End Function

    Public Overridable WriteOnly Property NewItem() As SomeType Implements iArray(Of SomeType).NewItem
        Set(value As SomeType)
            Allocate(Collected, value)
            Populated = True
        End Set
    End Property
    Public WriteOnly Property NewItems As SomeType() Implements iArray(Of SomeType).NewItems
        Set(values As SomeType())
            Try
                For Each value As SomeType In values
                    NewItem = value
                Next
            Catch
            End Try
        End Set
    End Property
    Public Property Populated As Boolean Implements iArray(Of SomeType).Populated
        Get
            Return mPopulated
        End Get
        Set(value As Boolean)
            mPopulated = value
        End Set
    End Property
    Public Function LastIndex() As Int64 Implements iArray(Of SomeType).LastIndex
        Return LastIndexOf(Collected)
    End Function
    Public Shared Function LastIndexOf(TheArray() As SomeType) As Int64
        Try
            Return TheArray.Length
        Catch
            Return 0
        End Try
    End Function


End Class

GeneralRe: Time for a new programming language paradigm Pin
Stefan_Lang21-May-14 20:57
Stefan_Lang21-May-14 20:57 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg22-May-14 3:40
Colborne_Greg22-May-14 3:40 
GeneralRe: Time for a new programming language paradigm Pin
Stefan_Lang22-May-14 3:43
Stefan_Lang22-May-14 3:43 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg22-May-14 3:51
Colborne_Greg22-May-14 3:51 
GeneralRe: Time for a new programming language paradigm Pin
rjmoses22-May-14 6:59
professionalrjmoses22-May-14 6:59 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg22-May-14 13:13
Colborne_Greg22-May-14 13:13 
GeneralRe: Time for a new programming language paradigm Pin
rjmoses22-May-14 13:56
professionalrjmoses22-May-14 13:56 
GeneralRe: Time for a new programming language paradigm Pin
Dar Brett22-May-14 16:45
Dar Brett22-May-14 16:45 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg22-May-14 16:53
Colborne_Greg22-May-14 16:53 
GeneralRe: Time for a new programming language paradigm Pin
jschell26-May-14 7:20
jschell26-May-14 7:20 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg26-May-14 11:28
Colborne_Greg26-May-14 11:28 
GeneralRe: Time for a new programming language paradigm Pin
jschell28-May-14 7:58
jschell28-May-14 7:58 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg28-May-14 14:13
Colborne_Greg28-May-14 14:13 
GeneralRe: Time for a new programming language paradigm Pin
jschell2-Jun-14 8:33
jschell2-Jun-14 8:33 
GeneralRe: Time for a new programming language paradigm Pin
Colborne_Greg2-Jun-14 15:47
Colborne_Greg2-Jun-14 15:47 
GeneralRe: Time for a new programming language paradigm Pin
BillWoodruff21-May-14 15:38
professionalBillWoodruff21-May-14 15:38 
GeneralRe: Time for a new programming language paradigm Pin
Mark_Wallace21-May-14 17:42
Mark_Wallace21-May-14 17:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.