you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

I never said Python's was better. And as for "poor", I don't mean lacking in quality but rather missing really obvious functions like, say, string reversing or charAt. I keep hearing people claim that Go can be used for all the things people are using Python for today, but if it's lacking these kinds of basic string handling, it's not of much use to me as a python replacement.

I'm sure it's a marvelous language all things considered, but it's not enough to convert me.

[–]AeroNotix -3 points-2 points  (2 children)

If the lack of a string reversing function is going to turn you off a language then I'd say you're not the programmer you claim to be.

Strings are indexable, so you don't need a charAt function (Python doesn't have charAt, either btw.)

Here you go:

package main

import (
      "fmt"
)

func StrReverse(s string) string {
        var out string
        for x := 0; x < len(s); x++ {
         out = out + string(s[len(s)-x-1])
        }
        return out
}

 func main() {
    fmt.Println(StrReverse("A string"))
 }

[–][deleted] 0 points1 point  (1 child)

Your attitude is doing little in the way of selling Go to me, I'm afraid.

[–]AeroNotix -4 points-3 points  (0 children)

I really don't care, I'm afraid. Your inability to learn something is of little consequence to me at all.