|
AWWNAW posted:try saving your changes every once in a while. that happens automatically when you build. vs also has auto recover i did save though?? this has happened before: i hit save and the little "unsaved changes" asterix goes away but then it don't actually save
|
# ? Apr 14, 2016 21:20 |
|
|
# ? May 25, 2024 15:35 |
|
asterisk
|
# ? Apr 14, 2016 21:24 |
|
*asterisk also that comic was cool
|
# ? Apr 14, 2016 21:26 |
|
HoboMan posted:i did save though?? this has happened before: i hit save and the little "unsaved changes" asterix goes away but then it don't actually save did you like blow away your local copy with whatever was in source control before you committed or something? ive never heard of saving just failing like that.
|
# ? Apr 14, 2016 21:41 |
|
Bloody posted:yeah megaparsec seems to allow it but pretty much just documents it with inscrutable type signatures heh business as usual
|
# ? Apr 14, 2016 21:44 |
|
Notorious QIG posted:depends on how often you actually apply that operation i guess. plus im generally of the opinion that fewer functions = better (within reason, of course) what is the purpose of reducing the number of functions? i make functions that are only ever called once. i like the idea that i give a discrete bit of computation a name and an identity.
|
# ? Apr 14, 2016 22:22 |
Bloody posted:while ur here do you happen to know how to interact or at least capture state from megaparsec it's clearly a thing that can be done but is either lightly documented or i don't understand how to read the docs for it. i wanna be able to tag all this stuff im parsing out with where it came from so later when im doing stuff with it i can say "hey this thing is never used, it was declared on line 16" I looked into this for you, and I agree it was a pain (especially figuring out how to create a State properly--I cheated and looked at the source for runParser). Anyways hopefully this example will get you started: code:
|
|
# ? Apr 14, 2016 22:25 |
|
Fergus Mac Roich posted:i like the idea that i give a discrete bit of computation a name and an identity. im reading the clean code book right now and they advocate exactly this
|
# ? Apr 14, 2016 22:27 |
|
Fergus Mac Roich posted:what is the purpose of reducing the number of functions? keeps anybody reading the code (yourself included) from having to jump around in a file (or multiple files!) to figure out what the code is doing. if you need code that does One Thing, write a function that does it. don't then separate One Thing into Nine Subthings and write nine functions
|
# ? Apr 14, 2016 22:27 |
|
example from my current neural network code for job: one function trainFromCsv that opens a csv file, reads data out of it, closes the csv file, and then trains itself based on that data i could do, in theory (pseudocode before someone jumps down my loving throat) code:
|
# ? Apr 14, 2016 22:31 |
Notorious QIG posted:again because it's a simple example to demonstrate the general gist of what im talking about Fair enough, I actually misread your post so I thought you were complaining about the awkward map syntax. My bad. I totally agree that C++03 is really awkward and verbose since you don't have lambdas or auto.
|
|
# ? Apr 14, 2016 22:34 |
|
Notorious QIG posted:example from my current neural network code for job: uh the reason you do it like that is because its way easier to read. if youre working in a language with a functional ide the cost of jumping to a method implementation is trivial, and then each thing is actually readable without the noise of unrelated tasks surrounding it. its precisely the 'write a function that does one thing' notion that you just stated. reading a csv file and training a neural net are 2 things
|
# ? Apr 14, 2016 22:36 |
|
I wonder if there's some middle ground between linear machine code and over factored function spaghetti. nah never write a function unless it's called from more than one place
|
# ? Apr 14, 2016 22:38 |
|
VikingofRock posted:I looked into this for you, and I agree it was a pain (especially figuring out how to create a State properly--I cheated and looked at the source for runParser). Anyways hopefully this example will get you started: this is very useful tyvm
|
# ? Apr 14, 2016 22:47 |
|
if you must insist on keeping all your functionality in one function you'll end up putting comments in between each 'block' of logic anyway, so it's pretty much the same thing with less discipline, more likelihood of sharing state. with JavaScript there can be a benefit of a structure like this if you really don't wanna split it out of that single function: code:
Still the risk of sharing state in a dumb way due to the closure, but it still breaks up logical blocks, showing the overall flow and structure first, then showing the details of each step. you could always force yourself to pull the functions out of that closure too. anything is better than a long as gently caress singular function.
|
# ? Apr 14, 2016 22:51 |
|
JimboMaloi posted:uh the reason you do it like that is because its way easier to read. if youre working in a language with a functional ide the cost of jumping to a method implementation is trivial, and then each thing is actually readable without the noise of unrelated tasks surrounding it. its precisely the 'write a function that does one thing' notion that you just stated. reading a csv file and training a neural net are 2 things i mean i run vim/ctags so it's literally as easy as :ta <name of function> or C-] on the function name itself. that still doesn't change the fact that it's an additional step other than "scrolling down"
|
# ? Apr 14, 2016 22:53 |
|
Notorious QIG posted:but why should i when i can just do it all in one function? if i need to break it up later i can do that later, no reason to add complexity now no reason not to inhabit simplicity now
|
# ? Apr 14, 2016 22:58 |
|
i have a job writing erlang (for services and control plane), clojure (for monitoring), scala (for spark) and elm (for dashboards). functional languages rule
|
# ? Apr 14, 2016 23:08 |
|
i have a job writing verilog. verilog is non-functional (that is, broken)
|
# ? Apr 14, 2016 23:10 |
|
verilog's most common form of flow control is a convoluted version of goto
|
# ? Apr 14, 2016 23:11 |
|
Bloody posted:verilog's most common form of flow control is a convoluted version of goto *hits blunt* all programs are just applications of subleq, maaaaaaan
|
# ? Apr 14, 2016 23:14 |
|
yeah and verilog is a really lovely form of subleq
|
# ? Apr 14, 2016 23:24 |
|
Notorious QIG posted:i mean i run vim/ctags so it's literally as easy as :ta <name of function> or C-] on the function name itself. that still doesn't change the fact that it's an additional step other than "scrolling down" The ideal is that you don't need to scroll down or look at the other function at all because it does exactly what the function name says
|
# ? Apr 14, 2016 23:28 |
|
imagine you wanted to do some sort of series of operations in a sequential manner here's some code snippets for doing that in verilog: code:
|
# ? Apr 14, 2016 23:28 |
|
like yeah its a language that lives in some wonky concurrent-as-default space instead of the typical sequential-as-default space but goddamn is it tedious to do anything sequential, which sucks rear end when doing sequential work in a concurrent-as-default space is a hideously common pattern
|
# ? Apr 14, 2016 23:29 |
|
equivalent C would just be like while (!do_a_thing); do_a_fart = 1; butt_counter = 69; while(butt_counter != 0) butt_counter--; do_a_fart = 0;
|
# ? Apr 14, 2016 23:30 |
|
once my parser-linter works well enough i am going to create verilog++ which will first allow for implicit state declaration (note how we had to declare each valid state as a separate compile-time constant numeric value; the synthesis tools straight up throw these out as soon as they realize you're making a state machine and encode it however they want. its loving ridiculously dumb)
|
# ? Apr 14, 2016 23:32 |
|
thats my intoxicated pentapost about how loving dumb verilog is thanks for reading
|
# ? Apr 14, 2016 23:32 |
|
can anyone recommend a course or book or open source project that makes java seem worth learning? i hate basically everything i know about the language but people keep making interesting things in it so i guess i should stop trying to avoid it an figure out why everyone uses it for everything
|
# ? Apr 14, 2016 23:37 |
|
people make interesting things in java? since when? i thought everyone used it in a kind of lowest common denominator/cant shoot yourself in the foot sort of way
|
# ? Apr 14, 2016 23:39 |
|
Illusive gently caress Man posted:The ideal is that you don't need to scroll down or look at the other function at all because it does exactly what the function name says and trainFromCsv() trains the network from a .csv your point?
|
# ? Apr 14, 2016 23:40 |
|
Bloody posted:people make interesting things in java? since when? i thought everyone used it in a kind of lowest common denominator/cant shoot yourself in the foot sort of way basically everything relating to distributed computation is in java or sometimes a java-based other language, i do not know why
|
# ? Apr 14, 2016 23:44 |
|
weird langs get picked for odd tasks all the time; see also lua and machine learning
|
# ? Apr 14, 2016 23:50 |
|
Corla Plankun posted:can anyone recommend a course or book or open source project that makes java seem worth learning? What other programming experience do you have?
|
# ? Apr 14, 2016 23:59 |
i like java
|
|
# ? Apr 15, 2016 00:05 |
|
it turns out that this parser state business does not do what i hoped and also i have no idea what i am doing
|
# ? Apr 15, 2016 00:21 |
|
same good thing I have this hardware debugger for arduinos
|
# ? Apr 15, 2016 00:23 |
|
PokeJoe posted:i like java me too kinda
|
# ? Apr 15, 2016 00:26 |
|
i like that ive cobbled together a language parser in haskell without a drat clue at all what's going on
|
# ? Apr 15, 2016 00:28 |
|
|
# ? May 25, 2024 15:35 |
|
Bloody posted:i like that ive cobbled together a language parser in haskell without a drat clue at all what's going on that's how I feel all the time when programming racket. it's so easy to slowly build up something that does something useful, then at the end have no clue how it works
|
# ? Apr 15, 2016 00:34 |