|
what about lojban
|
# ? Feb 22, 2017 16:55 |
|
|
# ? May 22, 2024 06:19 |
|
Shinku ABOOKEN posted:there are real world languages where you only write what you say. hangul and arabic come to mind there really aren't though. both those scripts encode things that are not pronounced (and omit things that are). yes, even hangul, despite korean propaganda claiming otherwise. fart simpson posted:what about lojban that's not a real language
|
# ? Feb 22, 2017 18:52 |
|
tef posted:real chat: readable things have redundancy in them to aid meaning
|
# ? Feb 22, 2017 19:35 |
|
comedyblissoption posted:redundancy for the sake of redundancy can hurt readability is my point. creating intermediate variables when you could alternatively just simply describe the data flow can be worse to read. it can also be better; there are no one size fits all approaches
|
# ? Feb 22, 2017 20:16 |
|
this is p. silly, goes back to kolmogorov that you will be expressing things with redundancy if you don't have infinite time to express yourself ffs
|
# ? Feb 22, 2017 20:42 |
|
comedyblissoption posted:redundancy for the sake of redundancy can hurt readability is my point. creating intermediate variables when you could alternatively just simply describe the data flow can be worse to read. counterpoint: the atrocity that is "point free style"
|
# ? Feb 22, 2017 20:51 |
|
that said, in languages that have a |> operator I loving love it and use it all over the place
|
# ? Feb 22, 2017 20:52 |
|
Arcsech posted:counterpoint: the atrocity that is "point free style" which pointfree style, code:
code:
|
# ? Feb 22, 2017 20:56 |
|
Asymmetrikon posted:which pointfree style, both if you are defining a function that takes arguments, then name the loving arguments
|
# ? Feb 22, 2017 20:58 |
|
Arcsech posted:both also don't name them poo poo like "a" and "b", come up with actual names that describe what they are
|
# ? Feb 22, 2017 20:59 |
|
kx k makes some weird choices, but i generally find that the fact that the default arguments for all functions are x, y and z (arity decided by use) actually does make for some readability it is not like you ever, outside of intentional obfuscation, get anyone using x, y and z for anything but the first, second and third argument, and the compactness it brings makes it easy to give up stuff like currying and specialized rules for composition (though, granted, k has those too, which may not be as wise) e.g. {x+y} is a function and you can fold it over a list like {x+y}/l. if you want to name stuff you go {[arg1;a2;etc] ...} it is one of those things people like to think is obfuscating the language, but it is so trivial to remember that x is always the first argument that no one stumbles on that detail past the first five minutes, and it removes a lot of noise which in these kinds of circumstances really does distract from what is actually being done
|
# ? Feb 22, 2017 21:07 |
|
Cybernetic Vermin posted:kx k makes some weird choices, but i generally find that the fact that the default arguments for all functions are x, y and z (arity decided by use) actually does make for some readability it also does nothing to describe what the gently caress "x" means variable names are documentation of the most essential kind. if you do not use descriptive names, you might as well use uuids for your variable/function names instead, saves you the effort of making sure you only have one "x" or "arg1" in a context
|
# ? Feb 22, 2017 22:46 |
|
leper khan posted:it can also be better; there are no one size fits all approaches except your mom she really fits ALL
|
# ? Feb 22, 2017 23:17 |
|
most of the time a longer name for a local variable is just longer. {[number;number] number*number} is not clearer than {x*x}. how many times have you written a loop with an induction variable and named it index or counter or i or whatever? it's a stereotypical pattern, not documentation. K makes x and y always have the same semantic meaning when you encounter them. stereotypical patterns like ,// and {x@<x} always look exactly the same, and there's a very good chance that two trained K programmers will come up with character for character identical programs to solve a given problem. this kind of uniformity is actually an extremely good thing for readability and maintenance, it just disagrees with conventional wisdom.
|
# ? Feb 23, 2017 01:57 |
|
Internet Janitor posted:most of the time a longer name for a local variable is just longer. ok but [number length * number width] is much clearer as it gives some idea as to your intent.
|
# ? Feb 23, 2017 02:01 |
|
Clojure has the same feature, it works great as far as I can tell. Scala's underscore functions are like this too.
|
# ? Feb 23, 2017 03:11 |
|
Arcsech posted:it also does nothing to describe what the gently caress "x" means this is precisely in the contexts where it is very small functions and the way they are being fitted together is more important to see than it is to interrupt the flow of the code with explanation the pipelining and currying stuff, being a bit of specialized syntax, is a greater load than just making sure defining a small function can be done compactly enough to not obscure what the code is actually doing is what i am saying
|
# ? Feb 23, 2017 07:51 |
|
Arcsech posted:that said, in languages that have a |> operator I loving love it and use it all over the place same. i love it so much i sometimes catch myself writing value |> func even when i have just one function
|
# ? Feb 23, 2017 08:16 |
|
Arcsech posted:both but what about all the bytes that are saved by naming alternating index variables i and j
|
# ? Feb 23, 2017 14:38 |
|
all those compiler parsing cycles or just general execution speed in a dynamic lang without a jit....
|
# ? Feb 23, 2017 14:45 |
|
i prefer the (_|_) operater myself
|
# ? Feb 23, 2017 17:05 |
|
Arcsech posted:it also does nothing to describe what the gently caress "x" means Gazpacho fucked around with this message at 17:20 on Feb 23, 2017 |
# ? Feb 23, 2017 17:15 |
|
people who insist that every variable needs a descriptive name irregardless of context are only a slight evolution of the student turning in a programming assignment, having heard that the code should be well commented, with a mass of comments on the form // add 1 to the variable "numberOfElements", as another element has been counted
|
# ? Feb 23, 2017 17:44 |
|
Cybernetic Vermin posted:people who insist that every variable needs a descriptive name irregardless of context are only a slight evolution of the student turning in a programming assignment, having heard that the code should be well commented, with a mass of comments on the form // add 1 to the variable "numberOfElements", as another element has been counted otoh, a slightly-renamed function from our actual standard library: code:
|
# ? Feb 23, 2017 17:52 |
|
true, but insisting on variable names may not even represent the function well. i am personally of the view that any function on it's own line should get a description as to what it is there to achieve, and while i am personally fine with a huge one-liner (pipeline if you wish) i feel the trade is that you describe what it achieves well enough that it can be rewritten if the programmer coming in later really cannot decipher the thing the defensive way, of course, is to just demand all kinds of documentation at once, but you can really very easily obfuscate a clean implementation of something by requiring a ton of inline information
|
# ? Feb 23, 2017 18:09 |
|
for (int arrayIndex
|
# ? Feb 23, 2017 18:11 |
|
cis autodrag posted:otoh, a slightly-renamed function from our actual standard library:
|
# ? Feb 23, 2017 18:13 |
|
Gazpacho posted:is it a leap year bug, if so its not particularly obscure there is a leap year bug, but there's also a float precision bug that's easy to miss because the 365 makes your brain jump right to leap year. and like i said, it's still bad because if you just see a call to that function it's gonna be hard to decipher unless the programmer who called it was kind enough to put the values they passed in into nicely named variables.
|
# ? Feb 23, 2017 18:21 |
|
i gotta say as late 1960s low-resource relic languages go, forth beats mumps all to hell
|
# ? Feb 23, 2017 18:57 |
|
oh yeah, forth would be 100% legit if it wasn't so different in approach and how a lot of the standard techniques don't go well with parallelism etc.
|
# ? Feb 23, 2017 19:06 |
|
i is a perfectly unambiguous name for a variable, it means "outermost loop index". j likewise means "second loop index" and so on. Of course, if you're using i as the name of something other than the outermost loop index variable, you have indeed given your variable a bad name.
|
# ? Feb 23, 2017 21:50 |
|
i and j are good, k is okay, if you get into l/m/n you've probably hosed up also "l" is the worst character
|
# ? Feb 23, 2017 21:52 |
|
no its "u"
|
# ? Feb 23, 2017 22:50 |
|
Shinku ABOOKEN posted:there are real world languages where you only write what you say. hangul and arabic come to mind /heh/
|
# ? Feb 23, 2017 23:14 |
|
Just want to say that readable code can be created if programmers had good interpersonal communication skills and therefore would be able to figure out what some other person, who is not themselves, needs to know when reading code that they written, being able to put themselves in someone else's shoes and empathise. Which means we're all hosed.
|
# ? Feb 24, 2017 04:56 |
|
Richard Stallman posted:To learn to be a good programmer, you'll need to recognize that certain ways of writing code, even if they make sense to you and they are correct, they're not good because other people will have trouble understanding them. Good code is clear code that others will have an easy time working on when they need to make further changes. all we gotta do is convince humanity to empathize
|
# ? Feb 24, 2017 05:24 |
|
Gazpacho posted:i prefer the (_|_) operater myself Bottom?
|
# ? Feb 24, 2017 06:09 |
|
floatman posted:Just want to say that readable code can be created if programmers had good interpersonal communication skills and therefore would be able to figure out what some other person, who is not themselves, needs to know when reading code that they written, being able to put themselves in someone else's shoes and empathise. all the knowledge in the world can't save the douchebag
|
# ? Feb 24, 2017 08:33 |
|
page 444 of this haskell book and the authors still havent introduced monads we havent even written a full program yet (that's not until chapter 13) im burned out on this poo poo and going do something more relaxing this weekend c++ networking
|
# ? Feb 25, 2017 04:15 |
|
|
# ? May 22, 2024 06:19 |
Gazpacho posted:i prefer the ( o Y o ) operater myself
|
|
# ? Feb 25, 2017 05:04 |