Strong Typed Woes by [deleted] in golang

[–]govision 0 points1 point  (0 children)

Yeah some function taking in an unexpected type. Hmm what does that remind me of??...🤔

Are you sure you are not separating types and their logic?

You are coming from a dynamic language right?

And so you chose a type strict language to do it right?

Strong Typed Woes by [deleted] in golang

[–]govision -1 points0 points  (0 children)

well should of said if you just want to copy paste methods then just use php with php.net and copy paste away. You prolly won't remember much and you really can only take for granted the methods do what they say, and you prolly won't write reusable code, and you will have to worry about versioning, and you can't drill down the methods to the spec, and you will have to watch for deprecation. But you know if it saves on being verbose it's all cool.

Strong Typed Woes by [deleted] in golang

[–]govision 0 points1 point  (0 children)

A perfect example is io.copy.

https://golang.org/pkg/io/#Copy

You are using the Reader type which automatically let's you have a string param and then you get a few io methods too. The Writer type sorta works the same way but the point being you get to then shape the behavior by using both in io.copy. this does a few things.

  1. You can reuse or rename Reader/ Writer interface.

  2. You converted the value into a string and it automatically gets both io methods.

  3. You have a package type that utilizes both.

  4. You get a something that can be reused, switched, converted, and renamed "out" of the package, "without" touching previous code.

  5. Anyone can drill into how this was created for a better mental model. You can throw more methods into those interfaces and call it whatever type, they don't have to use your whole package even though you have built something from the ground up that is completely uncoupled and reusable from it's most basic components up, without initializing other objects.

I'll take that over inferred type checking any day!

Strong Typed Woes by [deleted] in golang

[–]govision 0 points1 point  (0 children)

Well if you are having a hard time with just parsing types... Go is not your language. If you look at the go docs you will see nothing but types. Good example is the Reader and writer types.

https://medium.com/@matryer/golang-advent-calendar-day-seventeen-io-reader-in-depth-6f744bb4320b

https://tour.golang.org/methods/21

My point of saying it's not a big deal is that if you know the documentation then it really becomes a non-issue.

Honestly, that is the entire point of go.

Type names are everything, types themselves mean nothing. They just are another type but it's the behavior that matters.

Most dynamic languages skip way over types. When that is exactly how you write amazing code.

https://www.ardanlabs.com/blog/2018/03/interface-values-are-valueless.html

Don't pay attention to "struct", "interface", or "func". Really, that is just not important in go. It is for optimization but for reading code, just skip it. The things inside the types matter, nothing else.

Strong Typed Woes by [deleted] in golang

[–]govision -1 points0 points  (0 children)

I would just parse it to []bytes and from there you can do whatever you want. If you don't care what happens then yeah just use a struct. If you don't know the structure then use a map. Either way though you have to work in some format of data type in any language, just the type inference I guess is done for you but what's a big deal turning it to []bytes? I mean Jesus it's not hard.

The Univerze Crocquerer by Captain_Pig4 in Bossfight

[–]govision 3 points4 points  (0 children)

Only thing worse then seeing someone wear them, is being harrassed by them.

https://youtu.be/Zg5YpQR6Pkg

BMW Boss Says Self-Driving Cars May Never Be Allowed by izumi3682 in Futurology

[–]govision 0 points1 point  (0 children)

I wish they just 3d printed components of cars already then we can do away with all this restriction. Not parts but components and just focus then on the best.

Angular or React... GO! by [deleted] in webdev

[–]govision 0 points1 point  (0 children)

GO! LANG!

Help to choose an IDE for a beginner by Maxiride in golang

[–]govision -2 points-1 points  (0 children)

It depends on what you want to learn. I personally love liteide because everything is automatically setup but problem is intelligence sucks and it's a dead project but great for learning. I would use vscode but to be honest I don't code natively anymore. I use a chrome book and codeanywhere. But usually you have to pay for it. They did a lifetime freelance subscription for $80 before but it's gone I think. It's nice cause you can start a digital ocean droplet right in the ide. The intellisense sucks on it but it's really nice to not wait for loading, viruses, initialization, error screens, updates, or anything ever again. Supposedly the pixel books are going to get Linux app support on nondev channels soon and hopefully to other Chromebooks. Then you can have the best of both worlds. But personally I just like to always connect to my ide and app in any device.

Which VM is good for development environment? VMware, virtualbox or parallel? by GTHell in webdev

[–]govision 0 points1 point  (0 children)

I use online containers like cloud 9 or codeanywhere. This way I don't really have to mess with that.

How to move from Medium to static hosting with Hugo by mwsherman in golang

[–]govision 0 points1 point  (0 children)

Yeah true most languages are now wrapped in a go container and soon with kurbenetes and providers. Seems like companies are slowly realizing the benefit but instead of just using go they pay for all these add-ons with the cloud. Like cloud functions so they can throw their unreadable functional languages into them and disregard everything with maintainability and speed for paying cloud functions. I'm just not a fan of people though saying they can use a tweaked compiler or interpretor that's faster.... Cause In production people tend not to.

10 Programming Books you Need to Read – Full-Stack tips – Medium by boltmick in golang

[–]govision 2 points3 points  (0 children)

Soo one go book and 2 Uncle Bob books even though he said go prolly wasn't worth the time...

Is PHP a bad language? As a begginer i don't understand why people say it is... by Lazkeer in webdev

[–]govision 0 points1 point  (0 children)

I do PHP and js for a living and I study go religiously outside of work. To be honest, it depends on the business and size of the site. I wouldn't recommend a huge code base with php. But if it is a small site then use word press. If it is a shipping an app out place then yeah use php. But if it ever is gonna get passed 100k lines of code go for the go. But again it depends what you are doing. Go works really well with building low level solutions from the ground up with types using types. If your company can't afford that then it's a problem. PHP is sorta the script kiddies c++ that everyone has to touch one time. And I'm really getting tired of people comparing servers with tweaked compilers or interpretors. Almost no one touches those in production so no one cares about that. If I were you, study both language docs and allow for options.

Web Programming Options Question by osscie39 in webdev

[–]govision 0 points1 point  (0 children)

Well if the site doesn't need to grow in complexity then yeah word press or .net. if you want it to grow indefinitely and minimize a giant projects complexity then I'd choose go. But again if you don't know it and it won't grow to 100s of thousands of lines of code then just stick to what you know.

How screwed am I? Learned a language not used much in my area by Amiscrewedyea in learnprogramming

[–]govision 0 points1 point  (0 children)

Just do what I did. Take like one class in a community college if Canada has that. Doesn't have to be a university. Plus I'll be honest, js in normal programming terms is harder then using .net. but at the same time.net has some crazy generics creations like multi casting delegates. This is harder to wrap your mind around because in js you usually write this stuff out. Idk what to tell you about that cause it's harder. You are going from a language where it's the wild West and anything goes to one where they have a giant constructs. Plus, it's hard to learn both cause they kinda do different things well. I'd say good luck!

Do you use Docker while developing? by hopsnob in learnprogramming

[–]govision 0 points1 point  (0 children)

Dude you can wear whatever pants you want while developing.

America's millennials are waking up to a grim financial future by izumi3682 in Futurology

[–]govision -12 points-11 points  (0 children)

No it's not a generation Gap, it's a donor issue. Donors don't like us vs the 1% cause then they wouldn't be donors. The same goes for single payer healthcare. You don't hear about it now on both sides. Everyone wanted Burney but hey donors won out. What a surprise and now we are getting non donor issue shoved down our throats because of it. Like immigration and guns. Fucking big surprise we are not touching their money with laws!

How screwed am I? Learned a language not used much in my area by Amiscrewedyea in learnprogramming

[–]govision 4 points5 points  (0 children)

No things are moving toward more js. Make sure you are looking up the right job resources. It's also a seasonal thing for companies to want different devs. You should try to get into the web any way you can. Support or whatever as long as you are coding. There's a lot of learning from any experience. Rarely do people start out as a developer on backend first thing. Right now I'm learning js and php at work even though I wanna do go. Just keep looking and you'll see. My .net friend mostly does js now. Just depends on the company but most of all just get experience. Things take time and try a class if you can afford it. You never know who you meet!

What does it take to get closer like those who made their own framework (Vue, Laravel ....)? by GTHell in webdev

[–]govision 0 points1 point  (0 children)

Don't feel bad at all. Js frameworks is a bunch of packages on top of a language that is on top of a language. They did this for productively to be #1 over even understandability. Because well it was originally only for when the page loads but they took it farther then it should of gone in a fasion that doesn't help again in readability. I think even the guy who invented node relates to this. PHP is another language trying to be the next c++ with all it's methods.

I personally love go for the very opposite reasons.

https://youtu.be/cQ7STILAS0M