"Go", Google programming language

Bob Hubbard

Retired
MT Mentor
Founding Member
Lifetime Supporting Member
MTS Alumni
Joined
Aug 4, 2001
Messages
47,245
Reaction score
772
Location
Land of the Free
In the "I'm amused" department, I just discovered that Google has it's own programming language. While not surprising, it was interesting.

Seems some of my 'haven't used it in over a decade' C knowledge is still useful. lol

FYI.
[h=2]Examples[/h] The following is a Hello world program in Go:
Code:
package main
 
import "fmt"
 
func main() {
        fmt.Println("Hello, World")
}
Go's automatic semicolon insertion feature requires that opening braces not be placed on their own lines, and this is thus the preferred brace style; the examples shown comply with this style.[SUP][17][/SUP]
Example illustrating how to write a program like the Unix echo command in Go:[SUP][18][/SUP]
Code:
package main
 
import (
        "os"
        "flag"  // command line option parser
)
 
var omitNewline = flag.Bool("n", false, "don't print final newline")
 
const (
        Space = " "
        Newline = "\n"
)
 
func main() {
        flag.Parse()   // Scans the arg list and sets up flags
        var s string
        for i := 0; i < flag.NArg(); i++ {
                if i > 0 {
                        s += Space
                }
                s += flag.Arg(i)
        }
        if !*omitNewline {
                s += Newline
        }
        os.Stdout.WriteString(s)
}

More info
http://golang.org/
http://www.eweek.com/c/a/Applicatio...About-Googles-Go-Programming-Language-859839/
http://en.wikipedia.org/wiki/Go_(programming_language)
 

Bill Mattocks

Sr. Grandmaster
MTS Alumni
Joined
Feb 8, 2009
Messages
15,675
Reaction score
4,548
Location
Michigan
Yeah. That's Pascal. Gimme a break!

I will keep coding in Perl, the only language that matters.
 
OP
Bob Hubbard

Bob Hubbard

Retired
MT Mentor
Founding Member
Lifetime Supporting Member
MTS Alumni
Joined
Aug 4, 2001
Messages
47,245
Reaction score
772
Location
Land of the Free
That's not Pascal. I know Pascal.

That's what happens when you let Pascal play with C and let it smoke lots n lots of funny herbs. :D
 

MaxiMe

Brown Belt
Joined
Mar 3, 2011
Messages
496
Reaction score
9
Location
San Diego, CA
Headline: Cyberspace.
Virtual archeologist discovers once thought dead language.

Watch at 11 only on "BSK" News
:)
 

granfire

Sr. Grandmaster
Joined
Dec 8, 2007
Messages
16,010
Reaction score
1,617
Location
In Pain
roflmao!

some nerd got mad because Bill Gates made it obsolete to know all that poop so he put it into google...

oh man, not that I ever was part of that crowd, but I do recall the days when you had to type out pages of silly commands to make a dot move across the screen.....
a half a novel in nonsensical characters to produce a monochromatic game that malfunctioned if you had a typo in the 200 or so pages you copied...(yes, I have played such a game, colliding with invisible stars...the game itself was fun, not seeing what killed you, not so much - Battlestar Galactica btw, if you should wonder...I think I always had nerd friends...)
 

clfsean

Senior Master
MT Mentor
MTS Alumni
Joined
Jun 15, 2004
Messages
3,687
Reaction score
400
Location
Metropolitan Tokyo
That's not Pascal. I know Pascal.

That's what happens when you let Pascal play with C and let it smoke lots n lots of funny herbs. :D

I knew Pascal... it made sense & was fun.

C is what happens when too much fapping occurs with angry people who decide to get back at the world...
 

Carol

Crazy like a...
MT Mentor
Lifetime Supporting Member
MTS Alumni
Joined
Jan 16, 2006
Messages
20,311
Reaction score
541
Location
NH
I knew Pascal... it made sense & was fun.

C is what happens when too much fapping occurs with angry people who decide to get back at the world...


....and its STILL the most efficient thing around. :p
 

Sukerkin

Have the courage to speak softly
MT Mentor
Lifetime Supporting Member
MTS Alumni
Joined
Sep 15, 2006
Messages
15,325
Reaction score
493
Location
Staffordshire, England
But C is avant garde Jazz and I prefer classical :lol:. Structure, structure, structure ... that's what I like.

COBOL is an old 'guilty pleasure' of mine. I always say it's like writing a letter to the computer ...

"Dear Computer

How are you? I am fine. The weather today is much like it was yesterday without too much sun, wind or rain.

This day, if it does not disrupt your plans, I would like to add the Arabic Numeral 2 to an identical but seperate Arabic Numeral 2. Do you think that you could help me with this? ..."

And so on :lol:.
 
OP
Bob Hubbard

Bob Hubbard

Retired
MT Mentor
Founding Member
Lifetime Supporting Member
MTS Alumni
Joined
Aug 4, 2001
Messages
47,245
Reaction score
772
Location
Land of the Free
I once wrote a program for a project.
I sat at the computer, and wrote code.
I didn't sit at a note book and draw little diagrams, and charts and maps.
I had a 3 paragraph spec, that was it.
So I composed code. Built in error traps. Commented it. Included extensive prompts and all that stuff.
It worked, superbly.

I got docked points for not including the doodles.
I got docked points for only indenting 3 spaces, not 4 as demanded.
It was....annoying.

So my next project included a 10 page "discussion" with myself, discussing all aspects of the design.
It included stick figuresm and doodles, and all that jazz.
It also included careful comments indicating where the 'mandetory' indent points were.
In short, Sarcastic Psudeocode.

I got my points the next time.

Took me longer to write the firgen doodles than actually code.
I used to be smart. :D
 

Carol

Crazy like a...
MT Mentor
Lifetime Supporting Member
MTS Alumni
Joined
Jan 16, 2006
Messages
20,311
Reaction score
541
Location
NH
But C is avant garde Jazz and I prefer classical :lol:. Structure, structure, structure ... that's what I like.

COBOL is an old 'guilty pleasure' of mine. I always say it's like writing a letter to the computer ...

"Dear Computer

How are you? I am fine. The weather today is much like it was yesterday without too much sun, wind or rain.

This day, if it does not disrupt your plans, I would like to add the Arabic Numeral 2 to an identical but seperate Arabic Numeral 2. Do you think that you could help me with this? ..."

And so on :lol:.

Did you just say C is unstructured? *faints*
 

Carol

Crazy like a...
MT Mentor
Lifetime Supporting Member
MTS Alumni
Joined
Jan 16, 2006
Messages
20,311
Reaction score
541
Location
NH
I once wrote a program for a project.
I sat at the computer, and wrote code.
I didn't sit at a note book and draw little diagrams, and charts and maps.
I had a 3 paragraph spec, that was it.
So I composed code. Built in error traps. Commented it. Included extensive prompts and all that stuff.
It worked, superbly.

I got docked points for not including the doodles.
I got docked points for only indenting 3 spaces, not 4 as demanded.
It was....annoying.

So my next project included a 10 page "discussion" with myself, discussing all aspects of the design.
It included stick figuresm and doodles, and all that jazz.
It also included careful comments indicating where the 'mandetory' indent points were.
In short, Sarcastic Psudeocode.

I got my points the next time.

Took me longer to write the firgen doodles than actually code.
I used to be smart. :D


Tcl is the only scripting language that runs natively on Cisco routers. Tcl/Tk is....I believe the politically correct term is "whitespace sensitive". Put too much, or too little, whitespace in your code and your script is blown.

I can't wait till I have all my tools converted over to Perl :D
 

Latest Discussions

Top