Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "the place where the magic happens"
-
I wrote a prototype for a program to do some basic data cleaning tasks in Go. The idea is to just distribute the files with the executable on our shared network to our team (since it is small enough, no github bullshit needed for this) and they can go from there.
Felt experimental, so I decided to try out F# since I have always been interested with it and for some reason Microsoft adopted it into their core net framework.
I shit you not, from 185 lines of Go code, separated into proper modules etc not to mention the additional packages I downloaded (simple things for CSV reading bla bla)
To fucking 30 lines of F# that could probably be condensed more if I knew how to do PROPER functional programming. The actual code is very much procedural with very basic functional composition, so it could probably be even less, just more "dense"
I am amazed really. I do not like that namespace pollution happens all over F# since importing System.IO gives you a bunch of shit that you wouldn't know where it is coming from unless you fuck enough with Ionide and the docs. But man.....
No need for dotnet run to test this bitch, just highlight it on the IDE, alt enter and WHAM you have the repl in front of you, incremental quasi like Lisp changes on the code can be REPL changed this way, plethora of .NET BCL wonders in it, and a single point of documentation as long as you stay in standard .net
I am amazed and in love, plus finding what I wanted to do was a fucking cakewalk.
Downside: I work in a place in which Python is seen as magic and PHP, VB.NEt and C# is the end all be all of languages. If me goes away or dies there will be no one else in this side of the state to fuck with F#
This language needs to be studied more. Shit can be so compact, but I do feel that one needs to really know enough of functional programming to be good at it. It is really not a pure language like Haskell (then again, haskell is the only "mainstream" pure functional language ain't it not?) but still, shit is really nice and I really dig what Microhard is doing in terms of the .net framework.
Will provide later findings. My entire team is on the Microsoft space, we do have Linux servers, but porting the code to generate the necessary executables for those servers if needed should be a walk in the park. I am just really intrigued by how many lines of code I was able to cut down from the Go application.
Please note that this could also mean that I am a shit Golang dev, but the cut down of nil err checkings do come somewhere.9 -
Allright, so now I have to extend a brand new application, released to LIVE just weeks ago by devs at out client's company. This application is advertised as very well structured, easy to work on, µservices-based masterpiece.
Well either I lack a loooot of xp to understand the "µservices", "easy to work on" and "well structured" parts in this app or I'm really underpaid to deal with all of this...
- part of business logic is implemented in controllers. Good luck reusing it w/o bringing up all the mappings...
- magic numbers every-fucking-where... I tried adding some constants to make it at least a tiny bit more configurable... I was yelled at by the lead dev of the app for this later.
- crud-only subservices (wrapped by facade-like services, but still.. CRUD (sub)services? Then what's a repository for...?). As a result devs didn't have a place where they could write business logic. So business logic is now in: controllers (also responsible for mapping), helpers (also application layer; used by controllers; using services).
- no transactions wrapping several actions, like removing item from CURRENT table first and then recreating it in HISTORY table. No rollback/recovery mechanism in service layers if things go South.
- no clean-code. One can easily find lines (streams) 400+ cols long.
- no encapsulation. Object fields are accessed directly
- Controllers, once get result from Services (i.e. Facade), must have a tree of: if (result instanceof SomeService.SomeSubservice1.Item1) {...} else if (result instanceof SomeService.SomeSubservice2.Item4) {...} etc. to build a proper DTO. IMO this is not a way to make abstraction - application should NOT know services' internals.
- µservices use different tables (hats off for this one!) but their records must have the same IDs. E.g. if I order a burger and coke - there are 2 order items in my order #442. When I make a payment I create an invoice which must have an id #442. And I'm talking about data layer, not service or application (dto)! Shouldn't µservices be loosely coupled and be able to serve independently...? What happens if I reuse InvoiceµService in some other app?
What are your thoughts?1 -
So there's this place I go to when I sleep sometimes. I call it "The Circus", though it's more like the arcane sanctuary from Diablo II, if the arcane sanctuary was a hip arthouse and shit. Weird place, but I have friends there, they're like oneiric amalgamations of people I know, we all hang out at the Circus from time to time.
Now, each one has their own really bizarre power. One of the girls, for instance, bites off the head of a pidgeon and that heals her and makes her stronger. Think Ozzy Osbourne, but it's actually cutie goth Popeye. Also she's perpetually drunk for some reason.
Anyway, after having a brief reunion at this ornate round table we just happen to have laying around in the kitchen, we go out to hunt. That's the thing we do, we hunt for magical artifacts, and there's these demon gnomes all around trying to fuck us up. They suck, so we fight them with our powers and kung fu, that kinda vibe.
So it was a good hunt, right, but we have like a scoreboard based on mystical prowess and turns out mine is the lowest. Pidgeon Bitter, who is leading my squad, starts mocking me and says "hehe you have no real powers!" and I'm actually mad about that because it's true, I don't have any, I just fly around and do nothing useful in combat.
Anyway, we then bring the artifacts we collected to fucking Zordon, and he's like well done rangers. Turns out bald motherfucker in a tube doesn't discriminate based on mission score, so good on him. Everybody goes to bed, yeah we have bedrooms at the Circus for some reason, and I can't sleep because of what my captain said.
That's when I do something stupid, I think the dream logic here is I'm having a character arc moment or some shit, doesn't matter -- the point is I embark on a hunt all by myself, and I'm overrun by these fucking demon gnomes. I try to fight them with kung fu and escape with this magic crystal I found, but there's too many of them...
And so my true power finally awakens, and it's a fucking explosion. As in, I become a fire elemental, and in the dream this is good because I just cook all the gnomes alive and make off with the artifact, but I wake up before I can run to Pidgeon Bitter and smear my success in her captivating bloodstained drunk ass face.
My thoughts? Fire magic is two-times lame. One, because I was hoping for thunder, or ice, or something edgy like shadow or whatever. But NO, I got fire. Two, it's lame because it's the most uninventive, straight-forward fucking power in a setting where everything is obtuse, so it's out of place. I just go like really really mad and release an explosive pillar of flame, whoa, so original. Also casting this hurts me for some reason and it destroys everything around me.
And given that I've had other dreams of the Circus where it was obliterated and no-one trusts me anymore, I think it's safe to say those were a flash-forward to next season, and what happens next is I just randomly go into BLIND RAGE mode while taking a shit and everyone but me dies. Just a theory.
What is your Circus power? Let us know in the comments below!