|
https://github.com/robpike/filter Simple apply/filter/reduce package. rob pike posted:I wanted to see how hard it was to implement this sort of thing in Go, with as nice an API as I could manage. It wasn't hard.
|
# ¿ May 23, 2015 02:34 |
|
|
# ¿ May 10, 2024 18:36 |
|
https://groups.google.com/d/topic/golang-nuts/RKymTuSCHS0/discussionSean Talts posted:Hi everyone, quote:I'm reluctant to add increasingly special purpose builtin functions. quote:The modern programmer thinks a newline is a thousand times harder to
|
# ¿ May 23, 2015 02:36 |
|
why go is not good
|
# ¿ May 23, 2015 02:37 |
|
dont use go when better alternatives exist lol
|
# ¿ May 23, 2015 02:37 |
|
pram posted:why do procedural languages need more functional garbage
|
# ¿ May 23, 2015 03:08 |
|
benefits of higher order functions over manually written for loops:
|
# ¿ May 23, 2015 03:22 |
|
contrived C# code that i havent checked for compilation providing an example:code:
unfortunately C# sucks on generalizing over all primitive numbers, but there are other languages that can do that
|
# ¿ May 23, 2015 03:28 |
|
equivalent janitored for loop that i havent compiled because im bored:code:
edit: lol i forgot the sum part of it because janitoring for loops is dumb comedyblissoption fucked around with this message at 03:59 on May 23, 2015 |
# ¿ May 23, 2015 03:33 |
|
java, javascript, c#, and python all have this "functional poo poo" and are as mainstream as it gets idk if php supports it
|
# ¿ May 23, 2015 03:38 |
|
for loops are minimalist but i would argue that branch jump is more minimalist and therefore should be more preferred
|
# ¿ May 23, 2015 03:42 |
|
my goal here is mainly to educate the benefits of using alternatives to for loops i'm mostly tired of having to reverse engineer intent from looking at the code instead of an alternative of the code declaratively telling me its intent
|
# ¿ May 23, 2015 03:57 |
|
at the very least we can warn the innocent away from go
|
# ¿ May 23, 2015 04:08 |
|
Fanged Lawn Wormy posted:thanks that's reassuring. http://stackoverflow.com/questions/13488957/interpolate-from-one-color-to-another pass in the initial time, elapsed time, and fade times as parameters to determine how much interpolation there should be between an initial colour and end colour. then use this decided interpolation to return the interpolated colour. your program will be more composable if you have separate functions for:
a recursive function for colour interpolation over time sounds like a bad idea encapsulating these colour interpolation functions so they don't reference global or static variables will make them re-usable for multiple ui components comedyblissoption fucked around with this message at 14:49 on Jun 7, 2015 |
# ¿ Jun 7, 2015 14:47 |
|
gonadic io posted:jesus loving christ thanks microsoft for convincing me that i was going insane: http://stackoverflow.com/questions/5918534/why-cant-i-add-a-subfolder-in-a-f-project
|
# ¿ Jun 10, 2015 00:12 |
|
if you search online more about this F# limitation, youll find a bunch of stockholmed programmers defending it as making your code better because this is obviously the only way to prevent cycles in your definitions
|
# ¿ Jun 10, 2015 00:13 |
|
qntm posted:I ask you, is there a worse code smell than people using "theValue" and "theStatus" for variable names
|
# ¿ Jun 10, 2015 02:55 |
|
that doesnt help much when you need to print out your code
|
# ¿ Jun 10, 2015 03:25 |
|
coloured ink is worth more than my blood by volume
|
# ¿ Jun 10, 2015 03:39 |
|
camel case is such idiot garbage prized by those who value screen real estate over being able to loving read anything im the idiot in the codebase who randomly omits vowels on identifiers for no loving reason
|
# ¿ Jun 10, 2015 03:43 |
|
xs and ys for collections are fine too btn and pn for button and pane are not fine
|
# ¿ Jun 10, 2015 03:51 |
|
cnt
|
# ¿ Jun 10, 2015 03:52 |
|
Valeyard posted:This reminds me of another thing I hate, when the same variable is used multiple times in the same scope but for different reasons. Like at some point in the logic that value isn't needed anymore, so next time we need a new variable let's just use that old onwt seeing this also usually means the function is way too loving big function size too big should be a configureable compiler warning for all compilers comedyblissoption fucked around with this message at 04:45 on Jun 10, 2015 |
# ¿ Jun 10, 2015 04:43 |
|
gonadic io posted:Turns out that the VS extension f# power tools will do this (although the feature is not turned on by default??) . It's a VS limitation, not a f# one.
|
# ¿ Jun 10, 2015 15:12 |
|
VikingofRock posted:My biggest problem with python is that "fail fast" is not one of their design goals. You don't have a compiler to catch anything but the most basic syntax errors, you don't have a type system which keeps you from doing stupid stuff, and a bunch of stuff that should throw an exception doesn't. (lol)
|
# ¿ Jun 11, 2015 00:31 |
|
duck typing is a repulsive abomination foisted as a feature
|
# ¿ Jun 11, 2015 00:38 |
|
im honestly a little bit baffled how dynamically typed languages are actually getting more popular than statically typed langs burn everything to the ground
|
# ¿ Jun 11, 2015 00:44 |
|
fidel sarcastro posted:it's a solution to a problem no one was having, since you should be coding to an interface anyway.
|
# ¿ Jun 11, 2015 00:48 |
|
unfortunately such a decision can have awful effects once you move beyond a toy program i think a lot of damage has been done in the computer industry based on showing trivial toy examples and people not asking how such an approach might scale in complexity edit: where complexity here means program complexity
|
# ¿ Jun 11, 2015 00:50 |
|
uncurable mlady posted:so I have a discussion question for the thread Otherwise, I would suggest heavily against rewriting it. I would incrementally refactor and write unit tests as you do fixes and add features. You should prioritize your time on refactoring (by this I mean don't go off refactoring something that doesn't need fixing or is a rarely used component of the system or works just fine and doesn't need to be touched). Identify sub-systems/modules/whatever of functionality. Refactor by using unit tests. The unit tests should test the input and output of an entire module. Ideally you would write the unit tests and get them to pass w/ minimal refactoring before you start refactoring. You will probably have to reverse engineer the code to come up with unit tests and also send in data into the current system and use the debugger to figure out the outputs. This is very time consuming. You should refactor in small incremental steps and make sure all the tests pass ever time and put these commits in source control. Not taking small incremental steps can potentially put you in a special hell. You could alternatively YOLO it and ride by the seat of your pants and refactor a bunch of poo poo all at once without tests and you might somehow not have broken something. This might be faster if you're lucky. Be very careful of deleting or changing lines of code that you don't fully understand the reason for their existence. AFAIK, businesses will not reward you and will criticize you for trying to improve the maintainability of applications in maintenance mode. They just want you to shovel through a bunch of poo poo and ask you to do the impossible of not breaking things in an unmaintainable hell. Every single refactoring is time consuming and carries the risk of causing bugs that didn't exist before. Economically, you'd need to weigh if improved long-term maintainability outweighs these risks. A business and manager will almost always be short sighted and choose the shoot yourself in the foot method. comedyblissoption fucked around with this message at 05:56 on Jun 11, 2015 |
# ¿ Jun 11, 2015 05:45 |
|
Barnyard Protein posted:whats a good resource to learn how to architect an application The Good Way? like a case study, or a good example of a well designed open source java application that i could study? its frustrating, it feels like being competent at hammering nails into a board, but not having any clue about how to build a house. Pithy and very important ways to accomplish this:
Knowing this is a lot more important than some design patterns bullshit. Learning a functional programming lang will probably make you a better Java programmer than reading some random Java book. This is all anathema to popular OOP practices and sensibilities though even though you could do these things in Java.
|
# ¿ Jun 12, 2015 00:02 |
|
the only good thing about go is it lets you immediately realize when someone has terrible opinions about programming languages
|
# ¿ Jun 21, 2015 22:36 |
|
only nerds in their ivory towers would care about making their own container data types with static type safety if you can't just rely on the static type safety of the built in container types, you're doing something wrong and need to rethink how you're going about the problem nobody would ever need a different hashtable than the built in golang one that's just reinventing the wheel
|
# ¿ Jun 21, 2015 22:39 |
|
golang is for programmers who get poo poo done and dont jack off in their ivory towers about type systems
|
# ¿ Jun 21, 2015 22:42 |
|
interface{} is just like duck typing and you dont see people complain about that in python
|
# ¿ Jun 21, 2015 22:43 |
|
rob pike is stealing the blood and sweat and tears of a great amount of naive programmers lol
|
# ¿ Jun 21, 2015 23:02 |
|
i forgot about poe's law there are actually people that defend the lack of generics in go http://andlabs.lostsig.com/blog/2014/12/09/189/thoughts-on-generics http://blog.jonathanoliver.com/golang-has-generics/ https://splice.com/blog/golang-improved-simplicity-reduced-maintenance/
|
# ¿ Jun 21, 2015 23:10 |
|
i wasnt even trying to troll i was being sarcastic immediately after i said golang is poo poo golang is so bad that you can say something sarcastic right after you bash golang and people will think youre being serious b/c this is what golangers actually believe
|
# ¿ Jun 21, 2015 23:15 |
|
the funniest part is that golang will still be a bad language even if they inevitably add in decent generics but it'd still be over 8 years since the language's public inception in which every single year involved everyone that wasn't blind to the development of programming languages for the past 5 decades asking for generics
|
# ¿ Jun 21, 2015 23:19 |
|
i agree i'm mad mainly at rob pike, google, et al. for hyping a bad language for naive programmers trying to break out of the hellhole of dynamic typing that is ruby or python or w/e i think the most we can do is just educate people away from voluntarily choosing the language
|
# ¿ Jun 21, 2015 23:31 |
|
|
# ¿ May 10, 2024 18:36 |
|
i actually prefer golang's approach of functional composition over java/c# where everything has OOP kool-aid boilerplate for no good reason i also like that you can't do subtype polymorphism and must use interfaces i think moving away from the OOP madness is part of the appeal of golang but it's not compelling when you replace OOP madness with another form of madness that is actually worse
|
# ¿ Jun 21, 2015 23:38 |