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.
 
  • Post
  • Reply
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

redleader posted:

yeah, streamreaders and writers are a little odd in that they will dispose of the underlying stream when you call their Dispose() method (unless you use one particular ctor)

but if your coworkers wag their finger at you for not worrying about memory management, you should consider finding different coworkers

i mean you shouldn’t wag your finger because that’s probably being an rear end in a top hat but you should worry about managing your resources when writing software, and when reviewing your coworkers code it’s a useful thing to bring up

Adbot
ADBOT LOVES YOU

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

feedmegin posted:

Technically I can think of ways of doing that, e.g. System V shared memory segments :sun:

i worked on some data compiler that was split up across 20-30 binaries that used sysv shared mem to pass data between stages.

doing non-stop pointer arithmetic from a few constant addresses instead of just writing out a file made it impossible to port because the entire program depended on everything being at 0x???????? instead and plus now you dont even have to free() anything!

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

pokeyman posted:

i mean you shouldn’t wag your finger because that’s probably being an rear end in a top hat but you should worry about managing your resources when writing software, and when reviewing your coworkers code it’s a useful thing to bring up

yeah, epic had really strict rules about this poo poo in .net code and while some people were overzealous jerkwads about it, on the whole it kept the new code from turning into the kinda of lovely unperforming mess that the vb6 code was.

Space Whale
Nov 6, 2014
Shouldn't I at least bother to ask until I KNOW it's moot?

redleader
Aug 18, 2005

Engage according to operational parameters

Sweeper posted:

I mean you can’t just leak file handles in software that matters, I wouldn’t call wanting to properly close stuff finger wagging


pokeyman posted:

i mean you shouldn’t wag your finger because that’s probably being an rear end in a top hat but you should worry about managing your resources when writing software, and when reviewing your coworkers code it’s a useful thing to bring up

i think it's important to distinguish between memory and other resources, since the mechanisms for managing the two are so different (in .net, different langs have different considerations).

i was def. being too pedantic and 'well-actually,' in my post and came off way more assholish than intended

redleader
Aug 18, 2005

Engage according to operational parameters

Space Whale posted:

Shouldn't I at least bother to ask until I KNOW it's moot?

yep, and yospos has a surprising breadth and depth of posters with experience in all kinds of fields who are happy to share their knowledge. i know i've learnt a shitload just lurking in a couple of threads here.

for .net specifically, the grey forum .net megathread is also pretty good, although a lot quieter.

if you don't mind me asking, what's your background?

homercles
Feb 14, 2010

Below post in short: I've been thinking about how to design and document complex Go processing pipelines. My question comes down to, do people already do this, how do they do it better, and what tools do they use? The direction that I have had success with is doing it visually.

I have complex data pipelines I'm trying to design for data processing of a project. Any time I go down the rabbithole of using mutex/semaphores to solve a nontrivial sub-task I quickly get to the point where I cannot reason any longer with the logic, it feels as though the implementation has far outgrown the complexity of the problem and the chance of new eyes coming into the project and realistically understanding the logic is low.

So, I'm using Go. Go's design is influenced by CSP and as such, I've had success with decomposing each task into a series of broad state machines (as defined by their communication channels), and linking these state machines up in a graph with the directional edges being the data structures I use to communicate. Some state machines that share the same task work in a pool (eg performing independent data compression), and there will be 1->n relationships between senders and receivers.

This graphical decomposition has helped me immensely, I use something primitive like LibreOffice Draw to draw tasks in the processing pipeline without worrying about the data structure specifics and without having written down a single line of code, this captures not only the flow of information but whether the communication channels are 1-N, N-M or N-1. Sometimes it makes sense to have 1-N state machines but have separate communication channels for each of them (this delivers some cool guarantees in processing order but I'm not going to go into specifics, that's not the point I wish to discuss). From there I work on the data structures for the initial state machine set of outputs and as I do that, and focus on implementation, it becomes apparent that many of these state machines were overdesigned and their functions can chained together in the same goroutine.

What I ultimately would like to see is a page or two of A4 describing the flow of an entire program to serve as the most efficient way for a new developer to know the intent of a program. Each state machines would have 1) the filename, 2) the function of the toplevel goroutine that is responsible, 3) short description (<10 words), and the edges between these state machines list the datatype being sent (and enough of the struct contents for intent to be known), and conceivably a decent way to show fanin-fanout relationships

Perhaps I can do the above using GraphViz, describe it all in a relatively simple .dot file, but getting it to generate a graph that looks "right" is another matter. Does anything exist that would make this easy?

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

homercles posted:

So, I'm using Go.

i'm so sorry :eng99:

homercles
Feb 14, 2010

I tallied the positives and negatives and (for me) it still seems a net positive.

I've done up a small descriptive format and turn it into a dot file file with Perl. Later on I'll augment it to extract out the data structures from the Go code and display them in the edges in a verbose mode. The hierarchical format is good enough that i can embed it in a comment or whatever and has enough knobs and whistles in it that I can affect hint to graphviz where to place nodes.

Bulgogi Hoagie
Jun 1, 2012

We
excited for what’s to come! c plus plus needs new blood!

https://twitter.com/rainer_grimm/status/980372405305663489?s=21

Xarn
Jun 26, 2015
It's April...

Space Whale
Nov 6, 2014

redleader posted:

yep, and yospos has a surprising breadth and depth of posters with experience in all kinds of fields who are happy to share their knowledge. i know i've learnt a shitload just lurking in a couple of threads here.

for .net specifically, the grey forum .net megathread is also pretty good, although a lot quieter.

if you don't mind me asking, what's your background?

.net for 5 years

But mostly webshit

mystes
May 31, 2006

Xarn posted:

It's April...
The article in the link is dated March 26th.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

mystes posted:

The article in the link is dated March 26th.

but links to a post dated 04/01

brap
Aug 23, 2004

Grimey Drawer

Shaggar posted:

i cant wait for web rear end to deprecate javascript.

web assembly will never replace javascript and was never intended to.

Xarn
Jun 26, 2015

mystes posted:

The article in the link is dated March 26th.

When you coodinate 5 people april fools, you need to do it before hand I guess :shrug:

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

brap posted:

web assembly will never replace javascript and was never intended to.
JavaScript was never intended to be a server-side language, and yet here we are.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
I wonder how it'll be until we see people pushing server-side web assembly.

mystes
May 31, 2006

Ralith posted:

I wonder how it'll be until we see people pushing server-side web assembly.
Node already supports webasm, so this might happen pretty quickly if there are new languages that only compile to webasm.

Gun Metal Cray
Apr 27, 2005

Pillbug

Peeny Cheez posted:

JavaScript was never intended to be a server-side language, and yet here we are.

Actually...

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
people tend to forget about poo poo like that. javascript was everywhere back in the day. netscape put it on servers, in proxy config files, and for a brief time, as email filters in netscape mail.

this sort of dumb "javascript server" approach has been done quite a lot. mozilla rhino & the java "scripting" api for servers were used quite a lot. macromedia released a beta for "flex server" in 2003 which allowed you to write actionscript (a javascript variant) on both the client and the server. it was hurrah'd at the time because you could share code. the word "isomorphic" wasn't invented yet.

it was then rediscovered in 2006 with "aptana jaxer" which pulled off a similar trick, letting you build one html and "embed" server-side components in it (similar to coldfusion)

finally, in 2008, we saw the release of "v8cgi" which became "teajs", which was a bog-standard cgi server built on top of v8 & javascript. and then in 2009 with "nodejs", which used a lot of the original v8cgi code.

Bulgogi Hoagie
Jun 1, 2012

We
https://twitter.com/justicerage/status/980882087795404806?s=21

https://twitter.com/justicerage/status/980886073567076352?s=21

cinci zoo sniper
Mar 15, 2013





idgi

Bloody
Mar 3, 2013

C finally getting swift features?

Sapozhnik
Jan 2, 2005

Nap Ghost

i'm the contrast

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Bulgogi Hoagie
Jun 1, 2012

We
code:
C99 changelog:
* Added support for emojicode

brand engager
Mar 23, 2011


the only terrible thing going on there is coding without an IDE

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
[code]
//the parameter usually known as argv
//is named 😀
[/code

E: nice, bbcode pratfall

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.

Suspicious Dish posted:

people tend to forget about poo poo like that. javascript was everywhere back in the day. netscape put it on servers, in proxy config files, and for a brief time, as email filters in netscape mail.

this sort of dumb "javascript server" approach has been done quite a lot. mozilla rhino & the java "scripting" api for servers were used quite a lot. macromedia released a beta for "flex server" in 2003 which allowed you to write actionscript (a javascript variant) on both the client and the server. it was hurrah'd at the time because you could share code. the word "isomorphic" wasn't invented yet.

it was then rediscovered in 2006 with "aptana jaxer" which pulled off a similar trick, letting you build one html and "embed" server-side components in it (similar to coldfusion)

finally, in 2008, we saw the release of "v8cgi" which became "teajs", which was a bog-standard cgi server built on top of v8 & javascript. and then in 2009 with "nodejs", which used a lot of the original v8cgi code.

my first intern job in like 1997 was writing server-side js for Sybase's Dynamo language/platform/whatever. Source (unversioned ofc) was stored in the db and deployment was copying your dev db to the prod db.

document.writeline('<html><body>gently caress</body></html>')

Shy
Mar 20, 2010

Hello is Go good or bad?
Feel free to link me to any posts that described Go faults, I may have seen one but I don't remember.

e: oh poo poo it's the one that has github import baked in?

Shy fucked around with this message at 08:54 on Apr 3, 2018

gonadic io
Feb 16, 2011

>>=

Shy posted:

Hello is Go good or bad?
Feel free to link me to any posts that described Go faults, I may have seen one but I don't remember.

e: oh poo poo it's the one that has github import baked in?

Also the one where only the compiler authors are allowed to use generics and everybody else gets to cast to and from Object. (by which I mean interface {})

gonadic io
Feb 16, 2011

>>=
Having said that, my company has a legacy team on azure which they're migrating away from (and also migrating away from c# at the same time for... Reasons?) but they keep bitching about having to learn scala which the rest of our stack is in so they're going to switch to/learn go instead so I guess I might get some first hand experience when I need to interact with their poo poo

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Shy posted:

Hello is Go good or bad?
Feel free to link me to any posts that described Go faults, I may have seen one but I don't remember.

e: oh poo poo it's the one that has github import baked in?

it seems nice enough if you don't want to tangle with C and have a need for speed


on the other hand it's like C soooo i dunno. I interviewed with a company whose backend was written entirely in go for unclear reasons. It was the backend of Vivino, a wine app, and I'm having a hard time telling why it would need such speeds where they could probably develop in python and get more done faster.

comedyblissoption
Mar 15, 2006

go is bad

the talent deficit posted:

do you like garbage languages that fail at basically everything they claim to achieve?

the type system is next to useless. the lack of support for generics and iterator like operators means anything that requires a complex data structure that is not built in will almost certainly be cast to interface{} and then, at some point, downcast to some other type. hopefully it's original type but who really can tell?

channels are a worthless abstraction. they block on send and receive so unless you use some sort of queue they provide only very limited concurrency and they are not preemptible so they are of limited use for parallelism. virtually every modern language has a better solution available as a library

there is next to no type safety. almost any operation can return `nil` despite it's type signature. there is no pattern matching, no option/maybe type and no exceptions so every single operation must be checked for errors manually

this one is pretty minor compared to the above but it's 2015 and go still has statements. there's zero excuse for statements in modern programming languages. there is absolutely no reason `isEven = if x % 2 { true } else { false }` shouldn't work

this one is major. it's 2015 and go has zero support for immutable values. immutable values are the best reason to use erlang, clojure, scala and rust. they are a huge win for productivity and program correctness and go just doesn't have them presumably to simplify compilation


i will concede go is alright if you need to ship something of limited ambition or complexity to customers/users. it's nice they can just download a binary without worrying about dependencies

http://yager.io/programming/go.html
https://github.com/ksimka/go-is-not-good

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Boiled Water posted:

it seems nice enough if you don't want to tangle with C and have a need for speed


on the other hand it's like C soooo i dunno. I interviewed with a company whose backend was written entirely in go for unclear reasons. It was the backend of Vivino, a wine app, and I'm having a hard time telling why it would need such speeds where they could probably develop in python and get more done faster.

hmmm yes I need speed better use a garbage collector from the 70s

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
every quote of rob pike i read makes me want to punch him in the face

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
Near as I can tell, they realized that generics were absolutely needed for maps, but instead of implementing generics they just hard-coded maps into the loving language. When I last checked (admittedly quite a while now), maps didn't allow specifying non-default key comparison, so something like C#'s Dictionary<string, int>(StringComparer.OrdinalIgnoreCase) would not be possible. Nor would it be possible for anyone else to implement properly, seeing as the data type is built into the loving language.

gonadic io
Feb 16, 2011

>>=

Fiedler posted:

Near as I can tell, they realized that generics were absolutely needed for maps, but instead of implementing generics they just hard-coded maps into the loving language. When I last checked (admittedly quite a while now), maps didn't allow specifying non-default key comparison, so something like C#'s Dictionary<string, int>(StringComparer.OrdinalIgnoreCase) would not be possible. Nor would it be possible for anyone else to implement properly, seeing as the data type is built into the loving language.
Just write all your code as compiler plugins

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
go is bad

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply