Hey! I work on a project as backend developer for two mobile applications (Android and IOs) and wrote my server in c# with MVC. Now I found this great project so now my question, is it hard to wirte a rest service for a mysql server? (At the project I got about 10 tables and about 60 rows) And are there any advantages for the mobile applications if I choose golang? And what are the main advantages of golang against MVC c#?
Than you!
评论:
heraclmene:
Mr_Swifts:Please have a look on Google and decide for yourself. One person's opinion might not be the reason why you should make the switch.
PsyWolf:Hiya
It is pretty easy to write rest services in go, but while the learning curve for go is smaller than other languages it is still there.
The main advantages of go server would be performance, and you get concurrency for no extra work
brightam1:For a simple rest service over a few tables, either one will do just fine. Go and C# have similar performance characteristics (faster than python, slower than C), so I wouldn't base your decision making on that. If you want to do things concurrently, go may be easier. If your project does something specific that will benefit heavily from generics, C# will be easier.
I summed up my personal opinion on Go vs .NET a while back, so I'll just refer you to that for the broader comparison https://www.reddit.com/r/golang/comments/5cenu6/z/d9wpvpq
ultra_brite:There are no advantages for clients going with either C# or Go. That's kind of the point of writing a REST Service/API is that it separates client and server tasks.
tldr C# for development speed, Go for application speed
C# with WebAPI and Entity Framework (connector here: http://dev.mysql.com/downloads/connector/net/) should get you up and running with basic CRUD operations very quickly. C# is also a very mature and convenient language that should be able to handle every problem you throw at it.
While I very much enjoy programming in Go, it takes more work than C# to get every thing up and running. If you are already familiar with C# and are looking to get something done I'd suggest you continue with C#. Don't give up on Go though. If you want to learn more about all of the things that .NET WebAPI and MVC is handling for you then Go is a great language to learn about web servers and with some work you can put together a well-tuned and fast REST service.
asp.net MVC is a fully featured web framework. Go is a language with a standard library. There is no equivalent to MVC in Go, none.
Now imaging having to re-implement MVC with the asp.net std lib only. That's the difference between C# + MVC and Go . I don't think a Go web service would be faster, the bottleneck is going to be your RDBMS.
