|
Bloody posted:whats the least bad way to write-once run-everywhere apps? react native? this is for like an idiot spare time prototype-tier crud project bumping this
|
# ? May 8, 2020 21:26 |
|
|
# ? Apr 24, 2024 17:28 |
|
Bloody posted:bumping this
|
# ? May 8, 2020 21:27 |
|
kotlin multiplatform is good
|
# ? May 8, 2020 21:53 |
|
i use python and java a lot and this kind of criss cross "everything working and being mostly autogenerated" kind of idea abraham is proposing is wild i've never not had stuff be somewhat custom, with custom event handlers i constantly feel like there's a "this is an actual good design! seriously! learn it!" resource or something but it's never shown up in any software i have ever worked on
|
# ? May 8, 2020 23:04 |
|
RPATDO_LAMD posted:great idea well you don't obviously you use a map of your type (key or val or both) code:
|
# ? May 8, 2020 23:22 |
|
and this is better/easier than java... why/how exactly???
|
# ? May 8, 2020 23:28 |
|
afaict the idea is that making BlockingQueue a language feature instead of part of the standard library solves all concurrency problems
|
# ? May 8, 2020 23:33 |
|
we actually have CSP in jvm land, it's called akka and it's poo poo. no one uses it except for scala weenies, and nobody cares what they think because if they had good opinions they wouldn't be using scala
|
# ? May 8, 2020 23:34 |
|
DELETE CASCADE posted:and this is better/easier than java... why/how exactly??? I haven't done much java recently, what would that look like? a map/dict of your own type
|
# ? May 8, 2020 23:36 |
|
i did not include kotlin in the list of languages worth using intentionally. kotlin exists to beta test java features, be briefly popular because it has features that java doesn't, and then fade away once java gets a better version of those features. this is the inevitable fate of all non-java languages on the jvm
|
# ? May 8, 2020 23:37 |
|
tak posted:I haven't done much java recently, what would that look like? a map/dict of your own type i know 0 go but what does code:
|
# ? May 8, 2020 23:55 |
|
The equivalent in the example is this line:code:
I was just being a smartass but this would fail to compile if the type didn't match that interface code:
tak fucked around with this message at 00:25 on May 9, 2020 |
# ? May 9, 2020 00:22 |
|
jesus WEP posted:I’ve heard okay things about avalonia for .net core CRIP EATIN BREAD posted:kotlin multiplatform is good honestly, for as much of a loving joke as dart has been for the last decade, flutter seems to be getting some legitimate adoption outside of google. i think right now if i wanted to make a native ios/android app that would be my first stop react native still seems okay if you can somehow figure out how to share components and logic with a react web app. in practice i have literally never met anyone who has successfully done this for anything but, like, a small module with some helper methods, or a couple components that use react-native-web that all the frontend developers hate. i'm not sure it's worth buying into the react ecosystem otherwise, unless you already know react or want to get some of your frontend team to work on it. at my company which is primarily a native app, we have a react native app because it was the only real shared-code game in town when we decided to combine code, and the apps are still like 50/50 native/react, and we have a split between specialized native devs and frontend devs who have started doing native development i've built a server-side rendered vue web app, so i've occasionally thought of looking into nativescript w/ vue to build a native app to go with it, but i don't think it has much adoption at all and i'm skeptical i could actually share enough components to matter. it probably would end up being either a wrapped web app with enough of a native facade that apple wouldn't reject it (no idea what their standards are on this atm other than that they get mad if you serve "most" of your app over the web instead of shipping code in the app bundle), or a flutter app. hell maybe now is the time once i get through this stupid go websocket thing, not like i'm doin much else carry on then posted:i know 0 go but what does nothing, which is the point, those are equivalent things however, map is a language construct, and not one defined in userspace like a java HashMap is. you cannot write your own type-safe HashMap implementation in go, because while maps are "generic" in that they can hold a given type as keys or values, you cannot make your data structures that are. which is why go does not have a type-safe equivalent to, say, ConcurrentHashMap - they implemented the stdlib `sync.Map` data structure as a go data structure instead of doing whatever they did to create the language `map` construct, and thus, it is fully untyped. abraham linksys fucked around with this message at 00:27 on May 9, 2020 |
# ? May 9, 2020 00:24 |
|
i'd rather punch myself in the balls pretty hard than try to do websockets in go
|
# ? May 9, 2020 00:33 |
|
Bloody posted:bumping this i dont think my answer is good but it is at least true: i made a unity app in a day that ran on my linux computer and my phone (and probably windows and mac and ios but i didnt try) and it was very easy. i honestly have no idea how i would otherwise put crap on my phone and unity made it pretty easy
|
# ? May 9, 2020 00:40 |
|
Nomnom Cookie posted:i'd rather punch myself in the balls pretty hard than try to do websockets in go really the things that are most important to me about this websockets project (concurrency, building a little json protocol, small http api running alongside so i don't have to do rpc-over-websockets which is the fuckin worst) aren't that bad in go like... if i did this in kotlin (or java), i'm not sure what i'd do differently. probably would use javalin's small websocket wrapper which gives you regular ol `onConnection/onMessage/onClose` callbacks instead of go's weird goroutine/for-select/channel poo poo, but i'd still have the same problem of stuff being multithreaded by default and that would require some concurrency work if i did this in python with asyncio, it would be single-threaded making any in-memory state trivial to work with by comparison. so there is that, maybe i should just revisit python for the first time in a minute. honestly i'd probably just use node if i was going a dynamic-typed route though just b/c it's what i'm most familiar with.
|
# ? May 9, 2020 00:42 |
|
abraham linksys posted:you cannot write your own type-safe HashMap implementation in go, because while maps are "generic" in that they can hold a given type as keys or values, you cannot make your data structures that are. which is why go does not have a type-safe equivalent to, say, ConcurrentHashMap - they implemented the stdlib `sync.Map` data structure as a go data structure instead of doing whatever they did to create the language `map` construct, and thus, it is fully untyped. you probably don't need a sync.Map though https://golang.org/pkg/sync/#Map posted:The sync.Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.
|
# ? May 9, 2020 00:46 |
|
Nomnom Cookie posted:the only languages worth using in 2020 are java, rust, and python the only language you should be writing new stuff in is c#, but i wouldn't rush to rewrite existing java projects like i would with deprecated languages like ruby and vb or hobbyist languages like python and go.
|
# ? May 9, 2020 00:47 |
|
bob dobbs is dead posted:watch shaggar shaggar in and add some .net langs
|
# ? May 9, 2020 00:47 |
|
Oh ya I don't care about like nativeness like web view stuff would work
|
# ? May 9, 2020 01:43 |
|
I just found out python lets you directly gently caress with the stack and frame: pee lang is stored in the computer's balls To be a little more serious, does anyone have a link to that talk at dropbox about how pyston optimized out poo poo like monkey patching and how guido got a bit upset about it? Having trouble searching for it.
|
# ? May 9, 2020 03:49 |
|
I feel bored with C# after 7.5 years of doing it, but more than anything I'm sick of the kind of management that seems to favor MS stuff. I could be totally wrong, but it feels like things are more agile where it's totally open source. Does this mean go for .NET Core shops or should I try to get into the open sores world? I figured I could gently caress with python again, hence "lol you can directly access the stack and frame lmao" Also wondering about other languages. I'm pretty open, just want something that will lead to, yanno good environments.
|
# ? May 9, 2020 04:18 |
|
Have you considered landscaping?
|
# ? May 9, 2020 04:19 |
|
taqueso posted:Have you considered landscaping? Yeah but I like paying bills and raking sand is more for me than an income
|
# ? May 9, 2020 04:20 |
|
Space Whale posted:Also wondering about other languages. I'm pretty open, just want something that will lead to, yanno good environments. honestly a somewhat lateral move into java would probably give you a lot of backend dev opportunities at a lot of, like, mature startups/web/app companies if that's the sort of environment you're looking for? i think it's pretty common at "hip" places these days as they mature and give up their python monoliths and such. lotta folks writing rewriting their big ol' p-lang mess into services in java (not necessarily even microservices, mind you, just "hey maybe checkout should live in a nice java service that has types and api documentation instead of being split arbitrarily across twenty files across our giant rails codebase"). that's where my company is at and where my friends' companies seem to be headed, and because a lot of folks are coming from the experiences of moving "rapidly" with rails/django/flask/laravel/node/whatever, they gravitate towards "fresher" stacks when it comes to java instead of just falling back on spring and hibernate or whatever (thus why we use kotlin, for example) go might be an option but i really have no sense of what go looks like in production and who's using it and where. it keeps coming up in like bullshit "languages developers want to learn!!" surveys but i have no idea where it tracks in terms of what companies are hiring for abraham linksys fucked around with this message at 04:27 on May 9, 2020 |
# ? May 9, 2020 04:24 |
|
tak posted:The equivalent in the example is this wait does this mean you have to check that ok variable every single god damned time you take a value out of the map or be subject to surprising downstream errors if the key didn’t have a value
|
# ? May 9, 2020 04:25 |
|
abraham linksys posted:honestly a somewhat lateral move into java would probably give you a lot of backend dev opportunities at a lot of, like, mature startups/web/app companies if that's the sort of environment you're looking for? i think it's pretty common at "hip" places these days as they mature and give up their python monoliths and such. lotta folks writing rewriting their big ol' p-lang mess into services in java (not necessarily even microservices, mind you, just "hey maybe checkout should live in a nice java service that has types and api documentation instead of being split arbitrarily across twenty files across our giant rails codebase"). that's where my company is at and where my friends' companies seem to be headed, and because a lot of folks are coming from the experiences of moving "rapidly" with rails/django/flask/laravel/node/whatever, they gravitate towards "fresher" stacks when it comes to java instead of just falling back on spring and hibernate or whatever (thus why we use kotlin, for example) Seems like all the fad chasers want to go with Go for some reason over Java, C#, or whatnot. I don't get why because lolgenerics but I've been keeping a tab on Go. Rust seems promising but portability and, well, like you say, wanna do vs can get paid to do. Also, Elixir. Honestly the big thing I want is just maturity from management. No egos, no rockstars, no whip crackers, nobody who argues with technical people from total ignorance, yanno, minimize the Dilbert factor? I'm mostly salty because I interviewed at a place where the team had all the right answers but I neglected to ask about upper management - I now am in a hell where the CEO nitpicks everything. tl;dr he outsourced twice, blames both offshore teams, is now mis-micro-managing the onshore team, admits he doesn't know what he's doing, but blames everyone but himself. Trying to manage up with my current teamlead and boss but fiik if that will go anywhere. They keep saying 'sprint' but they're not even doing grooming.
|
# ? May 9, 2020 04:35 |
|
Phobeste posted:wait does this mean you have to check that ok variable every single god damned time you take a value out of the map or be subject to surprising downstream errors if the key didn’t have a value oh boy i get to tell you about what actually might be even worse than a lack of generics: go uses zero values instead of having a concept of a nil value. so let's say you got this: code:
no, what you will see is: quote:true this is because you get an empty Butt if it's not present in the map, which is the zero value of a struct. an empty struct will have a zero value for didFart, which is false, because it's a bool. this also applies for strings (""), ints (0), and floats (0.0). now, you can represent the concept of nil in Go, but you have to use a pointer: code:
now, you could make the argument of "well, who needs a nullable boolean anyways?" but you know what structs get encoded and decoded to? database fields. json fields. things that are nullable. which is why the sql package has to ship nullable types as separate structures. which, by default, you have to manually convert yourself for json encoding/decoding. which is why there is a whole package you can install for nullable values that you can use in json decoding and encoding. also go did not have a native sql.NullTime until 1.13, which is like a year ago. and to actually answer your original question, they do at least tell you in a map whether or not it found a value, so you don't have to try to guess whether you purposefully stored a zero value or if a key is missing. that's why you check the second argument: code:
abraham linksys fucked around with this message at 05:40 on May 9, 2020 |
# ? May 9, 2020 04:55 |
|
it kind of rules how golang's zero values and error returns are like you tried to explain the concepts of null safety and option types to someone and they just completely loving missed the point as hard as they possibly could
|
# ? May 9, 2020 04:58 |
|
tak posted:I know what you mean but to be pedantic you can define an interface that wraps a sync.Map and expose a type-safe interface on top of it, if type assertions from interface{} are too scary and you really need a sync.Map instead of a plain map or use a big boy language that provides a typed concurrent map instead of telling yourself it doesn’t hurt that bad abraham linksys posted:really the things that are most important to me about this websockets project (concurrency, building a little json protocol, small http api running alongside so i don't have to do rpc-over-websockets which is the fuckin worst) aren't that bad in go do thread per connection in java and stop dealing with weird bullshit invented in the 60s and pushed on the world by a bunch of devs who can’t accept that error codes are obsolete
|
# ? May 9, 2020 05:46 |
|
Nomnom Cookie posted:the only languages worth using in 2020 are java, rust, and python c#, c++/cli, ironpython
|
# ? May 9, 2020 08:11 |
|
redleader posted:c#, c++/cli, ironpython please don’t suggest people write new python2 code in 2020
|
# ? May 9, 2020 08:40 |
|
Space Whale posted:Also, Elixir. elixir is a great option if you want to get in on the ruby 2.0 hype train early
|
# ? May 9, 2020 08:43 |
|
Soricidus posted:please don’t suggest people write new python2 code in 2020 my government place of work uses java 8 for greenfield projects. It's gonna be fun when we reach its end of life in ... january of last year
|
# ? May 9, 2020 08:50 |
|
Boiled Water posted:my government place of work uses java 8 for greenfield projects. It's gonna be fun when we reach its end of life in ... january of last year Java 8 to 11 is a very easy tranition.
|
# ? May 9, 2020 09:30 |
|
ratbert90 posted:Java 8 to 11 is a very easy tranition. oh yeah, the technical transition is easy. Its the inertia of SAFe I have to fight. The business side of things absolutely runs things and the RTE side that's supposed to push back are all recruited from the business process pool. Its maddening
|
# ? May 9, 2020 09:36 |
|
what i'm trying to get at is my place of work is almost literally the Phoenix Project as told by Gene Kim, Kevin Behr and George Spafford
|
# ? May 9, 2020 09:39 |
|
Boiled Water posted:SAFe
|
# ? May 9, 2020 09:49 |
|
Phobeste posted:wait does this mean you have to check that ok variable every single god damned time you take a value out of the map or be subject to surprising downstream errors if the key didn’t have a value no, you only need to do that if you need to differentiate a key being in the map with a nil/zero-value vs. the key not being in the map. if you don't need to know that, just use the single value return form without the ok the concept of zero values is really cool and useful, and melds v. well with protobuf (which owns btw)
|
# ? May 9, 2020 09:49 |
|
|
# ? Apr 24, 2024 17:28 |
|
abraham linksys posted:
lol
|
# ? May 9, 2020 09:57 |