Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Valeyard
Mar 30, 2012


Grimey Drawer

Shaggar posted:

you'll also want to use subversion instead of git or any other dvcs

dunno about that one

Adbot
ADBOT LOVES YOU

triple sulk
Sep 17, 2014



i legitimately still want to give go the benefit of the doubt, but when i go back and look at it again beyond the very basic scripting stuff i tried with it a few months ago, i see stuff like this

quote:

Why doesn't Go have "implements" declarations?

A Go type satisfies an interface by implementing the methods of that interface, nothing more. This property allows interfaces to be defined and used without having to modify existing code. It enables a kind of structural typing that promotes separation of concerns and improves code re-use, and makes it easier to build on patterns that emerge as the code develops. The semantics of interfaces is one of the main reasons for Go's nimble, lightweight feel.

See the question on type inheritance for more detail.

How can I guarantee my type satisfies an interface?

You can ask the compiler to check that the type T implements the interface I by attempting an assignment:

code:
type T struct{}
var _ I = T{}   // Verify that T implements I.
If T doesn't implement I, the mistake will be caught at compile time.

If you wish the users of an interface to explicitly declare that they implement it, you can add a method with a descriptive name to the interface's method set. For example:

code:
type Fooer interface {
    Foo()
    ImplementsFooer()
}
A type must then implement the ImplementsFooer method to be a Fooer, clearly documenting the fact and announcing it in godoc's output.

code:
type Bar struct{}
func (b Bar) ImplementsFooer() {}
func (b Bar) Foo() {}
Most code doesn't make use of such constraints, since they limit the utility of the interface idea. Sometimes, though, they're necessary to resolve ambiguities among similar interfaces.

Shaggar
Apr 26, 2006
git serves no purpose unless you're somewhere you'll be without internet for days at a time.

Bloody
Mar 3, 2013

I have used cvs svn and git and they are all total trash. use a network drive and copy paste I guess.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

uncurable mlady posted:

i mean if you're having a conversation with yourself about "what language should I use for this" then you're already so far up your own rear end in a top hat building bikesheds that you should seriously reevaluate your life choices

caveat: you're trying to implement some algorithm for shits and giggles that will serve no practical purpose

that aside, your language should be driven by the realistic final goal of whatever you want your application to do. there's options inside of that choice (I'm making a web app, which of five bad options do I want to choose) but even those are pretty easy to select from based on whatever your resources are

i mean what we're just supposed to like roll dice to pick our language? i dont understand

we're making a web app. we're very tired of ruby and want something with a little bit of type safety. so therefore we're looking at java and go??? i think that meets your criterea???? these are all things mentioned in my post.

i mean it's a web app which i guess i didnt mention but this is the terrible programmer thread so i think that's implicit???

DONT THREAD ON ME fucked around with this message at 04:27 on Apr 1, 2015

Bloody
Mar 3, 2013

like I can't even do pros and cons for them. it's only cons, and each list has infinite length

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
i hope you guys arent giving me false hope about maven. im p sure i'll need to learn it for this eclipse project and tbh i havent been looking forward to it

triple sulk
Sep 17, 2014



"our language doesn't support implements, and you have to explicitly implement all members of an interface in order to satisfy that interface, but only at compile time will you know whether you have satisfied that interface's requirements, nor is there an easy way to instantly implement it like in an ide using java/c#. however, if you want to tell people that it implements that interface, you can make an additional type function on that interface that says 'Implements[Interface]' !!!!"

Shaggar
Apr 26, 2006

triple sulk posted:

i legitimately still want to give go the benefit of the doubt, but when i go back and look at it again beyond the very basic scripting stuff i tried with it a few months ago, i see stuff like this

reading that its like, well ok its matching method signatures that's not thaaaat bad, but then they recommend creating methods w/ special names for interface detection and that's hilarious

jony neuemonic
Nov 13, 2009

MALE SHOEGAZE posted:

we are coming from ruby and our thoughts are very much something like 'hey wouldn't it be nice if it were difficult to do dumb things with our code'

don't worry, i'm sure you'll still find a way.

Valeyard
Mar 30, 2012


Grimey Drawer

DaTroof posted:

i hope you guys arent giving me false hope about maven. im p sure i'll need to learn it for this eclipse project and tbh i havent been looking forward to it

your first maven project will probably be filled with lots of problems, but by the end of it you should have encountered any problem you are likely to have again in the future so its all good

Shaggar
Apr 26, 2006

DaTroof posted:

i hope you guys arent giving me false hope about maven. im p sure i'll need to learn it for this eclipse project and tbh i havent been looking forward to it

as long as you aren't doing stupid poo poo like trying to stick a build script system into your pom then you'll be fine. its the easiest thing in the world once you get it.

jony neuemonic
Nov 13, 2009

DaTroof posted:

i hope you guys arent giving me false hope about maven. im p sure i'll need to learn it for this eclipse project and tbh i havent been looking forward to it

maven is legitimately good and will leave you spoiled forever.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Notorious b.s.d. posted:

the "good" use case for operator overloading is a numerics library

the bad use cases are everything else. literally everything. "adding" strings makes no sense. only perl tried to make "multiplying" strings work.

you don't have to be stupid for operator overloading to be bad. it's bad for everyone, equally

has anyone ever been confused by + for string concatenation?

some languages use other operators and thats cool but ive never had a problem with +

also java uses + for that anyway

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Valeyard posted:

your first maven project will probably be filled with lots of problems, but by the end of it you should have encountered any problem you are likely to have again in the future so its all good

Shaggar posted:

as long as you aren't doing stupid poo poo like trying to stick a build script system into your pom then you'll be fine. its the easiest thing in the world once you get it.


fidel sarcastro posted:

maven is legitimately good and will leave you spoiled forever.

huh, ok. thx guys

Notorious b.s.d.
Jan 25, 2003

by Reene

HappyHippo posted:

has anyone ever been confused by + for string concatenation?

some languages use other operators and thats cool but ive never had a problem with +

also java uses + for that anyway

i found it really loving stupid at first, but after twenty years, it's only infuriating

Bloody
Mar 3, 2013

you are broken

Shaggar
Apr 26, 2006
+ is fine for string concatenation.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Notorious b.s.d. posted:

i found it really loving stupid at first, but after twenty years, it's only infuriating

are you also annoyed that = doesn't really mean equals?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

i found it really loving stupid at first, but after twenty years, it's only infuriating

i think you're problem is that you're brain has overloaded the plus sign to mean "ONLY ADDING NUMBERS TOGETHRE"

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

i think you're problem is that you're brain has overloaded the plus sign to mean "ONLY ADDING NUMBERS TOGETHRE"

yeah why wouldn't this common mathematical symbol included on my keyboard to express math ALSO do some completely unrelated things on occasion?

that's definitely easier than an "append" method

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

triple sulk posted:

i legitimately still want to give go the benefit of the doubt, but when i go back and look at it again beyond the very basic scripting stuff i tried with it a few months ago, i see stuff like this

what kind of hosed up person writes all that out then goes "mmyup, thats definitely better than just having the implements keyword"

Notorious b.s.d.
Jan 25, 2003

by Reene

HappyHippo posted:

are you also annoyed that = doesn't really mean equals?

yeah, pascal did this right with the explicit assignment operator (:=)

Shaggar
Apr 26, 2006

Notorious b.s.d. posted:

yeah why wouldn't this common mathematical symbol included on my keyboard to express math ALSO do some completely unrelated things on occasion?

that's definitely easier than an "append" method

we're talking about programming, get that stupid math poo poo out of here

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

MALE SHOEGAZE posted:

i mean what we're just supposed to like roll dice to pick our language? i dont understand

rolling dice is a fine strategy here. if your problem is complex then you'll exceed the sweet spot for any language you choose. if your problem is simple then who cares what language you choose just :getin:

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Notorious b.s.d. posted:

yeah why wouldn't this common mathematical symbol included on my keyboard to express math ALSO do some completely unrelated things on occasion?

that's definitely easier than an "append" method

but it is easier.

do you have trouble understanding context generally, or just when programming?

Shaggar
Apr 26, 2006

bobbilljim posted:

what kind of hosed up person writes all that out then goes "mmyup, thats definitely better than just having the implements keyword"

a google employee laughing at the idea of someone actually using go

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

Notorious b.s.d. posted:

yeah why wouldn't this common mathematical symbol included on my keyboard to express math ALSO do some completely unrelated things on occasion?

that's definitely easier than an "append" method

+ to concatenate strings only doesnt make sense if u already know what it means and think too much about it

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Notorious b.s.d. posted:

that's definitely easier than an "append" method

itym "concatenate"

e: or for pointers I guess you mean "successor" or something.

Notorious b.s.d.
Jan 25, 2003

by Reene

HappyHippo posted:

but it is easier.

do you have trouble understanding context generally, or just when programming?

let me get this clear: we're already discussing one of the most short-term-memory intensive activities in all of human endeavor, and you consider it a net win to add more context-specific behavior?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

yeah why wouldn't this common mathematical symbol included on my keyboard to express math ALSO do some completely unrelated things on occasion?

that's definitely easier than an "append" method

do you get angry when someone asks you for 'some additional ham please' because adding things i only for math and you cant add ham to somethin??

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

do you get angry when someone asks you for 'some additional ham please' because adding things i only for math and you cant add ham to somethin??

i've never had someone ask me for "some additional ham," ever, in my entire life

do you live in a house full of people with mild communication deficits? it's ok if you do, group homes have a lot to offer in terms of community re-integration.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

MALE SHOEGAZE posted:

do you get angry when someone asks you for 'some additional ham please' because adding things i only for math and you cant add ham to somethin??

"that story doesn't add up"

"OF COURSE IT DOESN'T IT'S A SERIES OF EVENTS AND NOT MEMBERS OF A CLOSED SET"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

i've never had someone ask me for "some additional ham," ever, in my entire life

do you live in a house full of people with mild communication deficits? it's ok if you do, group homes have a lot to offer in terms of community re-integration.

no it was an example designed for someone who works in the ham business. i suppose in your case a better example woudl have been 'can i have some additional bad opinions please???'

Notorious b.s.d.
Jan 25, 2003

by Reene
if can i shoehorn the word "additional" into a sentence, then operator overloading is natural english!!!

q.e.d. :smug:

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

Subjunctive posted:

"that story doesn't add up"

"OF COURSE IT DOESN'T IT'S A SERIES OF EVENTS AND NOT MEMBERS OF A CLOSED SET"

Bloody
Mar 3, 2013

Subjunctive posted:

rolling dice is a fine strategy here. if your problem is complex then you'll exceed the sweet spot for any language you choose. if your problem is simple then who cares what language you choose just :getin:

agreed let's just use c for everything

Bloody
Mar 3, 2013

Notorious b.s.d. posted:

communication deficits

it's u

triple sulk
Sep 17, 2014



bobbilljim posted:

what kind of hosed up person writes all that out then goes "mmyup, thats definitely better than just having the implements keyword"

Shaggar posted:

a google employee laughing at the idea of someone actually using go

this is the only thing i can assume since rob pike seems truly stuck in 1975

Adbot
ADBOT LOVES YOU

MeruFM
Jul 27, 2010

Notorious b.s.d. posted:

the "good" use case for operator overloading is a numerics library

the bad use cases are everything else. literally everything. "adding" strings makes no sense. only perl tried to make "multiplying" strings work.

you don't have to be stupid for operator overloading to be bad. it's bad for everyone, equally

this is why php is the best language

  • Locked thread