Recent comments in /f/programming
twovests wrote
Reply to comment by Dogmantra in i like this programming suggestion by mm_
holy shit i love this
emma wrote
Reply to comment by voxpoplar in i like this programming suggestion by mm_
#
is the hashtag operator, it adds hashtags to your strings
voxpoplar wrote
Reply to comment by hollyhoppet in i like this programming suggestion by mm_
because it's shorthand for number and it would represent the number of items in a list/array/map/whatever
hollyhoppet wrote
Reply to comment by voxpoplar in i like this programming suggestion by mm_
how does # mean length of something?
Personally if I were to choose something for comments i'd say -- is pretty good but then again i have a huge soft spot for ada
Dogmantra wrote
Reply to comment by voxpoplar in i like this programming suggestion by mm_
it's ok because all comments should be written in the format xXx_comment here_xXx
hollyhoppet wrote
Reply to i like this programming suggestion by mm_
...huh
The worst part is as far as I can tell the use of **
for exponent predates the use of //
for comments so yeah what the heck
voxpoplar wrote
Reply to i like this programming suggestion by mm_
ok but he suggests all comments should be # when # could be used as a perfectly good operator to get the length of something
Moonside wrote
Reply to a critique of TDD i just overheard: "i don't know how i want it to work before i write it; i know i should but it's a stream of consciousness." "yeah it's art; it's freestyle" by twovests
"i don't know how i want it to work before i write it;
What is specification, what is implementation, what is the difference, yada yada.
i know i should but it's a stream of consciousness."
The Greeks called this ataraxia, weakness of the will. Jesus. It's ok to be weak in the moment, but you probably could make a commitment to change and grow for the future.
twovests OP wrote
Reply to comment by voxpoplar in idea: storing data as a neural network by twovests
Maybe sort of?
There's probably some cool implications about the study of artificial neural networks for real-life neural networks, and ANNs are based off biological NNs, but I definitely don't know enough about either to say
twovests OP wrote
Reply to comment by flabberghaster in I love named parameters in Python by twovests
omg! i never knew you could do that! I knew about *args and **kwargs for variable-argument functions but I never saw this usage
voxpoplar wrote
Reply to idea: storing data as a neural network by twovests
I mean this is basically just what human memory is right?
flabberghaster wrote
Reply to I love named parameters in Python by twovests
I think my favorite feature along these lines is splatting.
def draw_circle(x, y, r, line_color="#ff0000", fill_color="#00ff00"):
...
args = [10, 20, 2]
kwargs = {"line_color": "#0000ff", "fill_color": "#ff0000"}
draw_circle(*args, **kwargs)
it works the other way too. It's such a useful feature!
Dogmantra wrote
Reply to comment by Dogmantra in What "weird" but useful programming environments have you used? by twovests
also I write security software for offices in scratch
Dogmantra wrote
I haven't really done very much programming, but I think Warcraft 3's world editor counts. There's Jass which I never learnt, but the trigger system is quirky and weird and the hoops you have to jump through to avoid memory leaks are fun.
musou wrote
i looooove emacs. the main reason i don't write more of my own stuff in elisp is because the language shows its age in terms of multithreading and background computation.
i also really like _why's projects hackety hack and potion.
twovests OP wrote
Reply to comment by Moonside in What "weird" but useful programming environments have you used? by twovests
oh man i gotta check out Coq, that sounds Really Rad tbh
i also definitely need to check out Pico 8 someday (i blame you oakreef for this interest)
Moonside wrote
I think Emacs must count for being very idiosyncratic, at the very least, even if it's well known. I wish it was more robust though.
CoqIDE is for the Coq theorem prover and using it has this weird video gamey vibe to it. When you're proving a theorem in Coq, you're essentially manipulating equations until they "match" the target one. In essence, you write a "sentence" in Coq - commands actually do end with periods, then hit the next step command and Coq checks whether your command compiles or not. If it does, your reasoning was valid in a way that Coq could verify. I think it would be possible to write a very good puzzle game along these lines, actually.
There's this fantasy video game console called Pico-8 that actually houses a development environment in itself, including a music sequencer, sprite editor and an editor. It uses Lua, which is honestly a bit too quirky a language for me.
Also any time there's an actually usable repl, it's both weird and quite welcome. Weird because they're rare, welcome because it's such a fast way of trying out things. But I do feel they could be loads better if they weren't subject to the idiosyncrasies of terminal emulators. Like setting up a custom prompt for each language is a lot of work for such a little thing. For GHCi (for Haskell), I have the current working directory, loaded modules and a pink lowercase lambda as my prompt which is cool since now I can distinguish between terminal windows at a glance, but of course I had to assimilate a bunch of tutorials all around the place to make it happen.
flabberghaster wrote
Reply to comment by Moonside in it has come to the point where I realize I have No Idea How To Use Git by twovests
mercurial is also a heck of a lot easier to write plugins and extensions for so it's much easier to hook it in to other, larger scale source control systems.
Moonside wrote
Reply to comment by musou in it has come to the point where I realize I have No Idea How To Use Git by twovests
Facebook wrote a blogpost on the topic, it's four years old by now though.
musou wrote
Reply to comment by Moonside in it has come to the point where I realize I have No Idea How To Use Git by twovests
huh that's interesting. i have used hg in the past and thought it was very easy to understand compared to git but moved to git because mercurial was too slow. i guess its speed has improved over the years, i'll have to give it another shot!
Moonside wrote
Reply to comment by flabberghaster in it has come to the point where I realize I have No Idea How To Use Git by twovests
Facebook uses Mercurial because Git was too slow.
flabberghaster wrote
Reply to comment by Moonside in it has come to the point where I realize I have No Idea How To Use Git by twovests
i agree; git is good but for some reason people act like it's the only DVCS out there; I've always found mercurial to be easier to use and less convoluted and easier to learn.
Moonside wrote
My controversial opinion: what Git does is valuable enough, but the way everything works is super convoluted.
Moonside wrote
Reply to comment by hollyhoppet in i like this programming suggestion by mm_