|
I fear most the programmer that does not think what they wrote is a mistake.
|
# ? Sep 15, 2017 18:56 |
|
|
# ? Jun 5, 2024 08:21 |
|
It's really amazing how many times I'll write something and think it's pretty great, only to look at it the next day (or week, month, whatever) and wonder who the hell could ever write such garbage.
|
# ? Sep 15, 2017 18:59 |
|
The more experience I gain, the less impactful are the mistakes that I make, at least I think. I've also learned to accept that mistakes will be made, to never be sure about anything and to test, test, test, document, document and test that code.
|
# ? Sep 15, 2017 18:59 |
|
Apologism: I figure you make a lot of tiny tradeoffs that were correct, but aren't obvious or even applicable anymore when you come back months later.
|
# ? Sep 15, 2017 19:14 |
|
Vanadium posted:Apologism: I figure you make a lot of tiny tradeoffs that were correct, but aren't obvious or even applicable anymore when you come back months later. This is an insightful point that rings true to me as an explanation for at least part of the phenomenon of "WTF did i write?".
|
# ? Sep 15, 2017 19:16 |
|
TooMuchAbstraction posted:Ten thousand mistakes! This is a pretty awesome site. Thanks for linking it, I'd never read it before.
|
# ? Sep 15, 2017 22:10 |
|
LongSack posted:I have yet to come across a problem that required functional programming. Quite probably, this is because of the types of problems that I need to solve. I have yet to come across a problem that required any specific style of programming. I'm not sure how such a problem could even exist.
|
# ? Sep 15, 2017 22:28 |
|
Plorkyeran posted:I have yet to come across a problem that required any specific style of programming. I'm not sure how such a problem could even exist. About all I can think of is enforced domain-specific styles, like having to write assembly because your target platform doesn't have a compiler. LLSix posted:This is a pretty awesome site. Thanks for linking it, I'd never read it before. I would take its stories with a grain of salt, but they can be amusing and occasionally insightful.
|
# ? Sep 15, 2017 22:31 |
|
Kilson posted:It's really amazing how many times I'll write something and think it's pretty great, only to look at it the next day (or week, month, whatever) and wonder who the hell could ever write such garbage. but also
|
# ? Sep 15, 2017 22:38 |
|
VikingofRock posted:I'd argue that LISPs have very nice syntax. Sure there are a lot of parentheses, but the syntactical simplicity makes it very easy to tell what is going on. It does get a bit bothersome when some commands break the syntax rules. Setq/setf are way harder to understand as exceptions than they need to be.
|
# ? Sep 15, 2017 22:54 |
|
VikingofRock posted:the syntactical simplicity makes it very easy to tell what is going on. Don't worry, all the macros fix that. code:
|
# ? Sep 15, 2017 23:25 |
|
Ruby def with no closing parentheses on the arg list? Real easy to read. And no parentheses on the function call, that took a few looks. He who wrote this mess has clearly never tried to support it.
|
# ? Sep 15, 2017 23:31 |
|
Just lol if you don't laugh at your dumb coding mistakes from last week. Because we all make mistakes, what matters is how we handle them.
|
# ? Sep 15, 2017 23:50 |
|
Ghost of Reagan Past posted:Just lol if you don't laugh at your dumb coding mistakes from last week. I joke about my dumb coding mistakes with the other coders all the time.
|
# ? Sep 16, 2017 02:44 |
|
People always wonder why I'm so great at debugging stuff. My secret is that I've spent over ten thousand hours debugging my own gently caress ups...
|
# ? Sep 16, 2017 05:08 |
|
I was debugging a rather hastily written program; I can't remember what the problem was, but I fixed it right away and left a comment with the problem. A coworker was surprised that I fixed it that quickly, and I was like, "yeah, I've made that same mistake like 100 times so it went pretty quick this time." Honestly I'd say the mark of a good programmer is the having the ability to use debugging tools effectively.
|
# ? Sep 16, 2017 14:03 |
|
This is just currently making my head ache.code:
|
# ? Sep 17, 2017 20:30 |
|
code:
code:
|
# ? Sep 17, 2017 21:05 |
|
It looks like they're filling in all the values of the array and just assigning array[5] = array[4] = 0; I don't get why the same isn't done with array[3] though if this is the case. Or why the parentheses are there.
|
# ? Sep 17, 2017 21:12 |
|
Colonel Taint posted:It looks like they're filling in all the values of the array and just assigning array[5] = array[4] = 0; Someone thinks they're being clever. FrantzX posted:
FrantzX posted:Shouldn't that be
|
# ? Sep 17, 2017 22:20 |
|
https://blog.fuzzing-project.org/60-Optionsbleed-HTTP-OPTIONS-method-can-leak-Apaches-server-memory.html tl;dr: Any bad method on a Limit directive in any .htaccess file causes Apache to spew random memory to an OPTIONS request. Bonus: The methods for Limit are case sensitive.
|
# ? Sep 19, 2017 17:56 |
|
vOv posted:Don't worry, all the macros fix that. Oh loop macro, how I miss thee . The loop syntax was the only documentation I printed out and hung up on the wall behind me. Working with python relatively anemic loop constructs has made me literally look back fondly. On the topic of syntax and macros: syntactic simplicity/uniformity is an important element in enabling user-defined syntactic abstractions. Any small additional syntactic element complicates doing macros in your language.
|
# ? Sep 20, 2017 09:58 |
|
Beef posted:Oh loop macro, how I miss thee . The loop syntax was the only documentation I printed out and hung up on the wall behind me. Working with python relatively anemic loop constructs has made me literally look back fondly. You could use Go, which only has for loops!
|
# ? Sep 20, 2017 15:42 |
|
Not quite coding but https://twitter.com/selenalarson/status/910536229451579393
|
# ? Sep 20, 2017 17:52 |
|
TooMuchAbstraction posted:You could use Go, which only has for loops! And it doesn't support the traditional syntax for(var i = 0; i < max; i++) right? Kind of curious if in that environment it's because it's rarely needed or if it's just a really weird opinion on what for loops should be.
|
# ? Sep 20, 2017 18:10 |
No, go supports traditional loops. code:
does exactly what you'd expect.
|
|
# ? Sep 20, 2017 18:36 |
|
Eela6 posted:No, go supports traditional loops. I'd expect it to throw a compiler parsing error for missing parentheses and a warning about superfluous spaces.
|
# ? Sep 21, 2017 00:29 |
|
PhantomOfTheCopier posted:I'd expect it to throw a compiler parsing error for missing parentheses and a warning about superfluous spaces. Go will yell at you for putting the parentheses in.
|
# ? Sep 21, 2017 01:05 |
|
So are there any actual upsides to Go because all I ever hear about it is whining. Or (realtalk) is it like PHP in that it does what it does very well but anyone well versed in it is going to hate it?
|
# ? Sep 21, 2017 01:14 |
McGlockenshire posted:So are there any actual upsides to Go because all I ever hear about it is whining. Or (realtalk) is it like PHP in that it does what it does very well but anyone well versed in it is going to hate it? It's the latter. Go is good for simple things that you want to compile to a binary. If you want to work on the back-end, you could do a lot worse. It works just fine, it's just ugly, boring and verbose (but nor as verbose as Java). Go is infuriating because it's not too hard to see a world where it's actually good, rather than 'fine, I guess'.
|
|
# ? Sep 21, 2017 02:00 |
|
McGlockenshire posted:So are there any actual upsides to Go because all I ever hear about it is whining. Or (realtalk) is it like PHP in that it does what it does very well but anyone well versed in it is going to hate it? It's pretty easy to deploy, it's strongly-typed, it has decent webserver libraries, probably a few more benefits that I haven't encountered because they're outside my use cases. Honestly I think a lot of the griping is because people want something like Go, but they didn't want all the weird decisions it made. If it had been an actually awful language then nobody would use it and so there'd be no complaints. Instead it feels like it's legitimately close to being a really good language, if only they'd done things a bit differently.
|
# ? Sep 21, 2017 02:04 |
|
Eela6 posted:Go is infuriating because it's not too hard to see a world where it's actually good, rather than 'fine, I guess'. The #1 thing requested on the user survey is "generics", so if Rob Pike can get over himself in time for Go 2.0, maybe there's some hope? Personally, not having generics hasn't honestly bothered me. If I were given a choice between generics or better package management/richer ways of dealing with slices/better error handling, I would pick any one of those three as a bigger priority. My primary gripe is the amount of boilerplate that Go mandates, to the point where it feels like the language actively encourages copypasta. code:
|
# ? Sep 21, 2017 03:09 |
|
Generics are what keep the language from having better slices, functional-style programming, and a bunch of other juicy stuff. The lack of good exceptions/error handling is irritating, absolutely, but generics are waaaaay more important. Sadly, I hear (thirdhand, so grain of salt and all that) that the way Go is implemented makes generics really hard to add, so I'm not holding my breath for them to be added.
|
# ? Sep 21, 2017 03:43 |
|
chutwig posted:The #1 thing requested on the user survey is "generics", so if Rob Pike can get over himself in time for Go 2.0, maybe there's some hope? Personally, not having generics hasn't honestly bothered me. If I were given a choice between generics or better package management/richer ways of dealing with slices/better error handling, I would pick any one of those three as a bigger priority. My primary gripe is the amount of boilerplate that Go mandates, to the point where it feels like the language actively encourages copypasta. I don't why people refer to Rob Pike so much when he hasn't worked on the project for like a year at this point. Also, your code sample is completely the opposite of what is recommended. Go has a lot of warts or w/e, but sometimes y'all write incredibly strange code just in general. Write something like this instead code:
Anyways, I suggest people just read Ian Lance Taylor's many generic proposals, such as https://github.com/golang/proposal/blob/master/design/15292-generics.md if they actually care about this problem. Something something metaprogramming and parametric polymorphism. For the record, we wanted to try the same approach as C++ wants to eventually do with concepts (http://en.cppreference.com/w/cpp/language/constraints), but it didn't work out. Oh well.
|
# ? Sep 21, 2017 04:10 |
|
I love this example because in one short source file it does a lovely job of illustrating that Rob Pike has a weak grasp of functional idioms, zero self-awareness and that his language is extremely clunky to use: https://github.com/robpike/filter/blob/master/reduce.go 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.
|
# ? Sep 21, 2017 04:33 |
|
quote:someShit, err := doAThing(toAThing) we have had an unequivocally better solution to this problem since the nineteen-loving-seventies. designing this "idiom" into a new language is absolutely inexcusable
|
# ? Sep 21, 2017 06:50 |
|
JewKiller 3000 posted:we have had an unequivocally better solution to this problem since the nineteen-loving-seventies. designing this "idiom" into a new language is absolutely inexcusable What "unequivocally better solution" are you referring to? Please don't say exceptions because those are also horrible and go recognized the problem, but like everything else in that language the attempted fix fell way short of its potential.
|
# ? Sep 21, 2017 12:48 |
|
I would have said monads, but those are a slightly more recent development.
|
# ? Sep 21, 2017 12:51 |
JewKiller 3000 posted:we have had an unequivocally better solution to this problem since the nineteen-loving-seventies. designing this "idiom" into a new language is absolutely inexcusable What did programmers do when Java gave them checked exceptions? try { thingThatCanFail(); } catch (Exception e) { /* gotta catch 'em all */ }
|
|
# ? Sep 21, 2017 14:23 |
|
|
# ? Jun 5, 2024 08:21 |
|
nielsm posted:What did programmers do when Java gave them checked exceptions? I fail to see how this is any worse (or better) than the Go equivalent: code:
code:
Languages should make it easy to do the right thing. But far more important than making it easy to do the right thing is making it harder to do the wrong thing. Go's mistake here is that the mechanism it came up with becomes useless when misused, and misusing it is what lazy programmers are going to do because it saves them a little typing/thinking in the short term.
|
# ? Sep 21, 2017 16:36 |