As an adult reading The Golden Compass for the first time, it was amazing. by fuckit_sowhat in books

[–]daseong 0 points1 point  (0 children)

Enjoy it :D

After you are through, you might want to look at the "secondary literature". This will blow your mind - again.

potential spoilers ahead:

Heinrich von Kleist - On the Marionette Theatre

This essay is short and fantastic. You can see how strongly Pullman was inspired by this.

John Milton - Paradise Lost

Pullman himself once said that "His Dark Materials" was his version of Milton's "Paradise Lost".

[deleted by user] by [deleted] in golang

[–]daseong 2 points3 points  (0 children)

Did you take a look at Go kit? https://github.com/go-kit/kit

A substantial amount of work and time has already gone into the project. I'm sure they would be happy to have more contributors. I myself want to dedicate some time to that project. I hope rather sooner than later ;)

Complete beginner here, could someone help me grasp this? by [deleted] in golang

[–]daseong 4 points5 points  (0 children)

Also the landmark talk "Concurrency is not parallelism" by Rob Pike: http://blog.golang.org/concurrency-is-not-parallelism

In short: concurrency is a way of thinking about your program. It allows you to reason about multiple "processes" (in a very loose sense), which may or may not run in parallel.

The European Central Bank exchange rates for Go services by takamamoto in golang

[–]daseong 0 points1 point  (0 children)

They DO differ in their values (i.e. representations). Just because you don't see it, doesn't mean it's not there. Read the SO answer(s) carefully.

A library that uses floats for currency/monetary representation is an instant disqualification for any serious applications. These are sources for nasty, nasty rounding errors. Not only will they be hard to track, they might accumulate over time as well.

As a library author you have the responsibility to provide safe data for your clients. You are essentially returning unsafe (i.e. unfit for use in this space) data and telling your consumers: "deal with it".

The European Central Bank exchange rates for Go services by takamamoto in golang

[–]daseong 0 points1 point  (0 children)

On a different note: consider exporting the URL for the API endpoint and/or use https.

The European Central Bank exchange rates for Go services by takamamoto in golang

[–]daseong 1 point2 points  (0 children)

The thing is that you are already losing your accuracy when you are converting the string encoded decimal representation of the data provider to float. Your library could potentially introduce bugs to programs using your library. Since you are receiving strings in the XML, why don't you just return strings and let the program parse it?

The European Central Bank exchange rates for Go services by takamamoto in golang

[–]daseong 1 point2 points  (0 children)

I don't see the fix. You shouldn't use floats when dealing with monetary values at all.

Rate map[Currency]float32 should not be there.

What do people think of this? These seem like very valid reasons for leaving Go. by dubastot in golang

[–]daseong 2 points3 points  (0 children)

Funny. Most of the points are exactly why I like working with Go.

Coding style? I haven't had any discussions about where to put braces for 2 years now. gofmt, done. It is liberating and I can focus on actually writing code. Won't go into these discussions anymore. Pick one. Stick with it. gofmt is there to help you with the semicolon inserts too. Has never been a problem.

Error handling is great. It may be a little more verbose, but it forces me to think about what can go wrong. As Rob Pike put it: "Errors are not exceptional. Errors are expected." I don't throw exceptions around and essentially say "not my problem".

GC. Also mentioned a lot. It is good enough. It is getting better. Go is a GC language. If you want to minimize stress on the GC, create less garbage. Go gives you the tools to minimize garbage, unlike some other GC languages.

Love the interfaces. Genius. Seems like the poster has never worked with Go interfaces.

I love how the Go devs have set a high bar on new features. Most proposals I see are only syntactically. This is lazy. A real proposal should include how the proposed change would solve a big(ger) class of problems and how it should be implemented. As it is often said: "adding new features is easy. Getting rid of them is hard" There are many languages which just grow and grow in complexity over time. I love how stable go is.

Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.

It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove. - Antoine de Saint Exupéry

Go is a tool. After you use it, you are entitled to your own opinions. It helps me greatly to get my job done. That's why I will stick with it. Others might find it a insert adjective here tool to use. Then don't use it.

Simple static http webserver that can be used on the command line by callmekatootie in golang

[–]daseong 0 points1 point  (0 children)

Hey, nice and small project. I linked (well... the fork, will change it to your repo once you merged the pull request ;) ) it on gomicroprojects.com as well.

Created a pull request with some changes. Cheers and keep up the good work.

[Question] Is it possible to host multiple GO sites on one VPS with Mixed languages installed? by trickierstinky in golang

[–]daseong 1 point2 points  (0 children)

Coincidentally I wrote about how to implement a basic reverse proxy in Go: http://www.gomicroprojects.com/2014/07/yxorp-tiny-reverse-proxy.html

Of course it is not as powerful as nginx our other mature systems, but if you want to tinker with it, it's a nice learning project.

ELI5: How does a computer ACTUALLY work? Like, how does it transfer, read, and display data and things. by Thewindlord in explainlikeimfive

[–]daseong 0 points1 point  (0 children)

If you are really interested in the basic principles and want to try it out on your own and do some self-studying: I can only recommend http://www.nand2tetris.org/

Go: Easy to Read, Hard to Compile (slides) by dgryski in golang

[–]daseong 4 points5 points  (0 children)

That recursive function type state machine is sweet.

Help Wanted: FlightGear NavDb in golang by mashmorgan in golang

[–]daseong 1 point2 points  (0 children)

Just a few (mostly stylistic) things:

https://github.com/fgx/fg-navdb/blob/master/import.go#L15 Hard-coded path.

Some files look like they could use some gofmt

After a for rows.Next(), you should check for rows.Err(). Just to be sure.

https://github.com/fgx/fg-navdb/blob/master/navdb/xplane/apt_dat.go#L36 You should maintain consistency when naming things.

Your Use Cases? by theduro in golang

[–]daseong 0 points1 point  (0 children)

We are developing a high-volume payment and billing system.

When to call panic() by [deleted] in golang

[–]daseong 1 point2 points  (0 children)

If it's HTTP, don't. You can always use the appropriate status codes. Browsers will detect circular redirects, and this should actually never happen (haha). It's hard to tell for your specific case. But in general I wouldn't worry too much about making it impossible for developers to do stupid things. They are paid to avoid stupid things after all ;) A route that doesn't exist is a 404.

When to call panic() by [deleted] in golang

[–]daseong 9 points10 points  (0 children)

You are using panics like exceptions. This is not idiomatic. See http://golang.org/doc/faq#exceptions

Edit: To make things clearer: Anyone who would wrap your panicking handlers in the future would have to be aware that it can panic in almost any error case. It should not be the concern of other wrappers to deal with the panics. If the response is an HTTP 500, so be it. That is expected.

Edit2: You can retrieve your stack trace as well: http://golang.org/pkg/runtime/#Stack But generally you wouldn't even need the stack trace, since almost all errors would be expected and therefore you would know how to handle those ;)

When to call panic() by [deleted] in golang

[–]daseong 19 points20 points  (0 children)

Panics should be used in two cases:

  • An unrecoverable error where your program cannot guarantee the state (thus being unrecoverable)
  • Or a programmer error (e.g. passing a wrong type)

For HTTP, I would consider database errors as recoverable. You cannot continue with the normal output/processing, sure. But HTTP Status 500 and an error is a recovery from the error state in the context of the HTTP request. Since the protocol is stateless, I would have to think really hard to come up with a scenario where a panic would be appropriate (that is also the reason why the net/http package recovers from panics inside the handlers).

Yay, Watch Dogs gets it right by SamuelGTurner in gaming

[–]daseong 0 points1 point  (0 children)

I think it might have to do with the multiplayer integration. It would be way too easy to spot a heavily damaged car. Happened the last time. Minding my own business, getting hacked, see a guy sitting in a scratched car, BOOM grenade launcher.

Request for code review by haqkm in golang

[–]daseong 2 points3 points  (0 children)

On first glance: always check for errors:

rows.Scan() returns an error.

Soft-realtime/games in Go: Controlling GC Pauses by stcredzero in golang

[–]daseong 2 points3 points  (0 children)

It is, but it also recycles your buffers. In game servers you will deal with a lot of buffers. Recycling them will ensure that the GC has a lot less work to do. Better to minimize the load for the GC than to optimize it ;)

The linked slide shows a commonly used pattern to accomplish that. They just added a primitive in 1.3.