Cobra (programming language)

from Wikipedia, the free encyclopedia
Cobra
Paradigms : imperative , object-oriented , generic , modular
Publishing year: 2006
Developer: Chuck Esterbrook
Current  version : 0.9.6   (December 23, 2013)
Typing : strong , static , dynamic
Influenced by: Python , Eiffel , C # , Objective-C , D
Operating system : .NET , mono
License : MIT license
cobra-language.com

Cobra is an object-oriented programming language . The aim of this development is not experimental features or new concepts, but a clear, practice-oriented syntax with extensive and proven support for the development process. The implementation is based on .NET and runs on both the .NET and the Mono platform.

Cobra's syntax is heavily based on Python . The language offers dynamic and optional static typing. Cobra also offers syntax elements for lambda expressions , design by contract and module tests . These were of Eiffel and D inspired.

Cobra is an open source project and was released on February 29, 2008 under the MIT license.

example

The classic hello world program looks like this:

class Hallo
    def main
        print 'Hallo Welt!'

Classes are introduced in Cobra with the keyword class. The following example program defines a new class Personwith a name and an age that can be automatically converted into a string using a method:

class Person

    var _name as String
    var _alter as int

    cue init(name as String, alter as int)
        _name, _alter = name, alter

    def toString as String is override
        return 'Mein Name ist [_name] und ich bin [_alter] Jahre alt.'

Web links

Individual evidence

  1. a b Reaping the Benefits of Cobra. Retrieved June 26, 2018 .
  2. Was George Costanza a Computer Programmer? In: Dr. Dobb's . ( ddj.com [accessed June 26, 2018]).
  3. Chuck Esterbrook: Geek of the Week - Simple Talk . In: Simple Talk . April 26, 2010 ( simple-talk.com [accessed June 26, 2018]).
  4. ^ Paul Krill: Cobra language slithering to open source . In: InfoWorld . ( infoworld.com [accessed June 26, 2018]).
  5. Open Source | Cobra. Retrieved June 26, 2018 .