|
sarehu posted:So this article appeared on HN. You'd think functional programmer monoidsplaining was the horror, but actually it's this: For normal pdfs, the mean, mode and median are all the same. I don't feel up to trying to argue for the variance bar right now but one could.
|
# ? Jun 2, 2015 05:17 |
|
|
# ? May 21, 2024 03:33 |
|
rjmccall posted:You don't need types to default to not having mutable state for that; you just need them to not share their mutable state by default. That way, you pass an argument and the function gets its own copy. Rivorous pretty much cracked his skull banging it against the wall trying to explain the benefits of pervasive value semantics to Russ Cox in blog comments (this was part of the initial 'discussion' about generics in Go). It was painful to watch.
|
# ? Jun 2, 2015 05:18 |
|
nielsm posted:This is an argument in favor of starting with C64 Basic, upgrading to Turbo Pascal, taking a little detour to Standard ML or Haskell, then go all C# (or Java if you absolutely must). Perhaps finish off with a trip to Pythonland, or Ruby or JavaScript to show off some more dynamic-ness. Personally I would have gone for ZX Basic BBC Basic Pascal C C++ Assembly VB 6 Java Everything else oh wait - that was how i learnt to program
|
# ? Jun 2, 2015 06:07 |
|
you should learn to program ActionScript 1, exactly how i learned to program
|
# ? Jun 2, 2015 06:08 |
|
Begin with a Babbage Difference Engine.
|
# ? Jun 2, 2015 06:32 |
|
The QCF Design DesktopDungeons.net password input system has different behavior on the web versus in the game itself. It appears to gently caress up on special characters. I did a password reset to a password like ='QCF1DES, and the web site happily accepted it while the game perpetually told me my password was incorrect. The game has been in active development since at least 2011, and they just recently released an iOS/Android port along with a significant update to the PC version. The ability for a bug like this to persist is baffling.
|
# ? Jun 2, 2015 06:58 |
|
Blotto Skorzany posted:Rivorous pretty much cracked his skull banging it against the wall trying to explain the benefits of pervasive value semantics to Russ Cox in blog comments (this was part of the initial 'discussion' about generics in Go). It was painful to watch. Sean Talts posted:Hi everyone, Ian Lance Taylor posted:I'm reluctant to add increasingly special purpose builtin functions. Rob Pike posted:The modern programmer thinks a newline is a thousand times harder to
|
# ? Jun 2, 2015 07:23 |
|
For loops are way better. You can just drop accumulator variables and debug statements without problem, it makes your code more editable and diffable and is better software engineering.
|
# ? Jun 2, 2015 08:03 |
|
fritz posted:For normal pdfs, the mean, mode and median are all the same. I don't feel up to trying to argue for the variance bar right now but one could. It's pretty rare, though, that the mean is the height of the peak.
|
# ? Jun 2, 2015 10:31 |
|
qntm posted:It's pretty rare, though, that the mean is the height of the peak. Uh, I have interpreted the graph like the "mean" refers to the position of the vertical line in the horizontal (x) axis, and the "variance" as the width between -sigma +sigma. Of course that's incorrect (it is the SD, not the variance). The graph is quite confusing, but I've seen worse things trying to ilustrate the normal distribution.
|
# ? Jun 2, 2015 13:02 |
|
Amberskin posted:Uh, I have interpreted the graph like the "mean" refers to the position of the vertical line in the horizontal (x) axis, and the "variance" as the width between -sigma +sigma. Of course that's incorrect (it is the SD, not the variance). But then why is it that for one line the length is significant while for the other it's the position that's significant? Even accepting your charitable interpretation, the visual strategy is totally confused. And the most important thing you want to achieve in creating an explanatory diagram/aid to understanding is to be clear and not mislead people, so if it's confusing then the creator has certainly not done a good job.
|
# ? Jun 2, 2015 15:30 |
|
Hammerite posted:But then why is it that for one line the length is significant while for the other it's the position that's significant? Even accepting your charitable interpretation, the visual strategy is totally confused. And the most important thing you want to achieve in creating an explanatory diagram/aid to understanding is to be clear and not mislead people, so if it's confusing then the creator has certainly not done a good job. Agreed. One can make sense of that graph just if he has previous knowledge on the subject. As an attempt to show a neophyte how a normal distribution works, it is poo poo.
|
# ? Jun 2, 2015 18:06 |
|
I inherited something. It's in Java, because of no reason I can tell. This is a thing in it, which I have checked to see if it is actually called from anywhere in the code. It isn't: code:
another: code:
|
# ? Jun 4, 2015 07:28 |
|
Is the thing you inherited is a first year CS assignment?
|
# ? Jun 4, 2015 07:55 |
|
FeloniousDrunk posted:I inherited something. It's in Java, because of no reason I can tell. And then the person who coded this went on to rant about Java being a poo poo language where nothing loving works.
|
# ? Jun 4, 2015 08:12 |
|
FeloniousDrunk posted:I inherited something. It's in Java, because of no reason I can tell. This is probably code that predates java having variadic functions/autoboxing, which were both added in java 2 standard edition 5.0 1.5.0. edit: Huh, generics were java 5 also. I thought they were added earlier than that, but I guess not.
|
# ? Jun 4, 2015 08:31 |
|
b0lt posted:This is probably code that predates java having variadic functions/autoboxing, which were both added in java 2 standard edition 5.0 1.5.0. Pretty sure String.format() was also only added in Java 5, so there was no point at which this code was acceptable. I mean, even allowing for the fact that it's just a really inefficient reimplementation of Integer.toString().
|
# ? Jun 4, 2015 08:52 |
|
I really want to know the thought process that went into converting an int primitive into an Integer object, encapsulating that into a 1-element Object array then using String.format to output it... as an integer string. Without any special formatting, like field widths or leading zeros or anything. Spoiler alert, It's actually "loving Java is such a loving poo poo language gently caress why do I have to type all this loving boilerplate to convert an integer to a string goddamn"
|
# ? Jun 4, 2015 09:01 |
|
Wheany posted:I really want to know the thought process that went into converting an int primitive into an Integer object, encapsulating that into a 1-element Object array then using String.format to output it... as an integer string. Without any special formatting, like field widths or leading zeros or anything. I think i have seen a lot of this, Its where they get an error once, and find the solution there and apply that solution as boilerplate everywhere. Like some code i saw in a minecraft mod source String playername = (String)Server.getPlayerName(); When Server.getPlayerName() returns a string.
|
# ? Jun 4, 2015 09:06 |
|
They read a thing about varargs that mentioned object arrays, so...
|
# ? Jun 4, 2015 09:09 |
|
TheresaJayne posted:I think i have seen a lot of this, Its where they get an error once, and find the solution there and apply that solution as boilerplate everywhere. Or more likely, paste some codes they got from the internet. Otherwise known as Cargo Cult programming.
|
# ? Jun 4, 2015 10:20 |
|
Zopotantor posted:Or more likely, paste some codes they got from the internet. I've had to deal with people pasting code between projects (without them really knowing why they are pasting this particular bit of code), and asking me why this thing doesn't work. Trying to understand the reasoning behind this took me a couple of minutes.
|
# ? Jun 4, 2015 13:28 |
|
canis minor posted:I've had to deal with people pasting code between projects (without them really knowing why they are pasting this particular bit of code), and asking me why this thing doesn't work. Trying to understand the reasoning behind this took me a couple of minutes. Was the conclusion you reached was that it was faster for them to throw poo poo at the wall and get you to fix it than for them to reason through it on their own?
|
# ? Jun 4, 2015 14:02 |
|
FeloniousDrunk posted:I inherited something. It's in Java, because of no reason I can tell. First one is a bad implementation of Integer.toString() that doesn't make any sense. I have no idea how he ended up with that. Second one is, I think, done because he's declared the parameter as an ArrayList and not an ArrayList<Integer>, and then he just kept adding code until it worked. Also, as a bonus, it returns 0 if all the numbers are negative.
|
# ? Jun 4, 2015 14:39 |
|
I've noticed that inexperienced programmers dealing with strong typing have a tendency towards using strings as a sort of universal data type, either by using them as an intermediate in converting values, or by using them in place of better strongly typed options like enums, bools or even numbers. It's basically a way of embedding a weakly typed system into a strongly typed one.
HappyHippo fucked around with this message at 15:22 on Jun 4, 2015 |
# ? Jun 4, 2015 14:49 |
|
This behavior is sometimes called "stringly-typed programming", although it is not restricted to supposedly strongly typed languages. Stubbornness... finds a way.
|
# ? Jun 4, 2015 15:41 |
|
HappyHippo posted:I've noticed that inexperienced programmers dealing with strong typing have a tendency towards using strings as a sort of universal data type, either by using them as an intermediate in converting values, or by using them in place of better strongly typed options like enums, bools or even numbers. It's basically a way of embedding a weakly typed system into a strongly typed one. It's sadly common in a lot of APIs.
|
# ? Jun 4, 2015 16:18 |
|
It's easy to add ad hoc structure to strings, which points to a usability gap in most languages IMO.
|
# ? Jun 4, 2015 16:20 |
|
Hammerite posted:But then why is it that for one line the length is significant while for the other it's the position that's significant? Even accepting your charitable interpretation, the visual strategy is totally confused. And the most important thing you want to achieve in creating an explanatory diagram/aid to understanding is to be clear and not mislead people, so if it's confusing then the creator has certainly not done a good job. Yeah, it's not the best depiction but it's not that far off. Put two small vertical lines on the edges of the "variance" line to indicate it's an extent, not a y location, and you have pretty much what you'd see in an intro stats textbook. You'd also want to extend the mean line to the edges of the figure so it's clear you're not measuring the height of the peak. (and yeah, it should be SD, not variance) I teach stats and I try to use animations (or poor man's animations on the whiteboard) to avoid those kinds of misunderstandings. But go to any undergrad-level stats course and you'll see worse figures pretty much guaranteed.
|
# ? Jun 4, 2015 17:08 |
|
Hughlander posted:Was the conclusion you reached was that it was faster for them to throw poo poo at the wall and get you to fix it than for them to reason through it on their own? Oh, looking at some other code the person in question committed, it sometimes felt like it - but I had a long conversation regarding the thought process behind this - nothing malicious, bear in mind, he didn't want to bother me and as he copy/pasted some things on other project and it worked, he thought that he'll do it the same way here. But the thought of "why", or any sense of curiosity - no, this didn't occur to him. To be fair he wasn't a programmer, if that's an excuse - but yeah, just a cargo cult.
|
# ? Jun 4, 2015 17:20 |
|
Subjunctive posted:It's easy to add ad hoc structure to strings, which points to a usability gap in most languages IMO. It's easy to add ad hoc structure to everything-is-a-hashmap scripting languages like JavaScript and that still doesn't stop anybody from using strings as a universal data structure. I think it's more accurately described as stubbornness or an education gap than a language usability problem. Everyone who reads this thread should be familiar with the phenomenon that many employed programmers have an anti-intellectual streak a mile wide and no interest in learning new concepts.
|
# ? Jun 4, 2015 22:17 |
|
On the subject of abuse of strings: the people who had written our back end prior to my being hired had decided to use "singular noun" to refer to row objects (e.g. Car) and "plural noun" to refer to the DAO (e.g. Cars). They then went and used a bunch of nouns with irregular plurals, e.g. Geography/Geographies or Ox/Oxen etc., along with a bunch of reflection-type stuff where Car had to be converted to Cars and vice versa. So, just refactor everything to something sensible, right? Like Car_Row and Car_DAO, Geography_Row and Geography_DAO, or whatever. Nope. Okay, use a lookup table of some sort, so key = Car and value = Cars (with an inverse key-value mapping). Nope. Instead, let's use Wordnet to do the singular-plural and plural-singular conversions for us! Brilliant! And do this lookup every single time, rather than caching the results. So I killed the reflection crap. The singular/plural stuff stayed because after killing the reflection crap there was no reason to fix it. But still... goddamn.
|
# ? Jun 4, 2015 23:52 |
|
Wheany posted:And then the person who coded this went on to rant about Java being a poo poo language where nothing loving works. No matter how good or bad the language you use is, and no matter how powerful the IDE, the limiting factor to the quality of code is going to be that dumb rear end in a top hat sitting next to you (or more likely you). I saw someone do 'new Function("whole bunch of code in here")' in a codebase the other day. No matter how bad of a language you think Javascript is I think there should at least be the assumption that that is not a good way of doing things ever and certainly not the only way to do it. It wasn't even a short function, it was at least 7 lines all condensed in to one. And all it did was appear to trigger some kind of animation on clicking a button, instead of just using a CSS selector or just not. And it was also applied globally to all links on each page, and made it so that if it wasn't a postback URL (we're using Webforms, I know) and was just a regular <a href=fart> link then it wouldn't actually submit the link, it made it so that any external link just wouldn't do anything. Did I mention that using 'new Function("fart")' is basically doing Eval() and will make it so that your developer tools won't show you were the handler is coming from? Instead (in Chrome) it shows it as coming from the VM so you have to search through your files for something that looks the same as the function.
|
# ? Jun 5, 2015 00:56 |
|
Internet Janitor posted:It's easy to add ad hoc structure to everything-is-a-hashmap scripting languages like JavaScript and that still doesn't stop anybody from using strings as a universal data structure. I think it's more accurately described as stubbornness or an education gap than a language usability problem. Everyone who reads this thread should be familiar with the phenomenon that many employed programmers have an anti-intellectual streak a mile wide and no interest in learning new concepts. To be fair, it's not like intellectuals are much better in this case. I've seen so much code that's just duct-taped together string-built shell calls in C++ at the universities I've attended. Sure, the code usually does something fascinating like a new method for human speech recognition or something, but there's a huge mess to get there. Granted a lot of this is because most academic code is made of throwaway scripts. (Hell, right now I'm working on a Frankenstinian monstrosity that's stitched together Go/Java/Python due to time constraints and library availabilty).
|
# ? Jun 5, 2015 01:00 |
|
loinburger posted:On the subject of abuse of strings: the people who had written our back end prior to my being hired had decided to use "singular noun" to refer to row objects (e.g. Car) and "plural noun" to refer to the DAO (e.g. Cars). They then went and used a bunch of nouns with irregular plurals, e.g. Geography/Geographies or Ox/Oxen etc., along with a bunch of reflection-type stuff where Car had to be converted to Cars and vice versa. So, just refactor everything to something sensible, right? Like Car_Row and Car_DAO, Geography_Row and Geography_DAO, or whatever. Nope. Okay, use a lookup table of some sort, so key = Car and value = Cars (with an inverse key-value mapping). Nope. Instead, let's use Wordnet to do the singular-plural and plural-singular conversions for us! Brilliant! And do this lookup every single time, rather than caching the results. So they were calling a third party system to figure out how to parse their data, and using reflection to do it? I'm not sure I can believe this.
|
# ? Jun 5, 2015 01:00 |
|
Jsor posted:To be fair, it's not like intellectuals are much better in this case. I've seen so much code that's just duct-taped together string-built shell calls in C++ at the universities I've attended. Sure, the code usually does something fascinating like a new method for human speech recognition or something, but there's a huge mess to get there. Granted a lot of this is because most academic code is made of throwaway scripts. I think you missed his point. The point is that an anti-intellectual attitude of refusing to learn/improve is what results in this "stringly typed code." Strings are capable of (poorly) representing all kinds of data, so after these people learn string manipulation they basically stop trying to improve their understanding of their language and just mangle every problem into strings.
|
# ? Jun 5, 2015 01:20 |
|
loinburger posted:Instead, let's use Wordnet to do the singular-plural and plural-singular conversions for us! Brilliant! It's amazing that this existed.
|
# ? Jun 5, 2015 01:29 |
|
Blotto Skorzany posted:That wasn't documentation from an expensive toolchain, just a lovely one. Expensive toolchains give you features like "is the only way to compile code for the chip your EEs have picked, and oftentimes does so correctly" and "refuses to work when the network is down because it can't contact its licensing server". So the value proposition is obvious IAR buddy. Other exciting features include error dialogs designed to fail if using VNC or other screensharing to work on a lab computer from your office, requiring you to walk over, badge into the lab, move the mouse to the dialog box and click 'OK'. Generally found in the unusual circumstance of the jtag debugger crashing when you do obscure things like "single step". PIC is worse though, in every possible way. I don't think I've found a PIC compiler that's actually close to C compliant.
|
# ? Jun 5, 2015 05:22 |
|
loinburger posted:On the subject of abuse of strings: the people who had written our back end prior to my being hired had decided to use "singular noun" to refer to row objects (e.g. Car) and "plural noun" to refer to the DAO (e.g. Cars). They then went and used a bunch of nouns with irregular plurals, e.g. Geography/Geographies or Ox/Oxen etc., along with a bunch of reflection-type stuff where Car had to be converted to Cars and vice versa. So, just refactor everything to something sensible, right? Like Car_Row and Car_DAO, Geography_Row and Geography_DAO, or whatever. Nope. Okay, use a lookup table of some sort, so key = Car and value = Cars (with an inverse key-value mapping). Nope. Instead, let's use Wordnet to do the singular-plural and plural-singular conversions for us! Brilliant! And do this lookup every single time, rather than caching the results. Holy poo poo.
|
# ? Jun 5, 2015 06:19 |
|
|
# ? May 21, 2024 03:33 |
|
More! This is stuck on the end of every function that does a database call:code:
Also naturally there is the mandatory C&P 25 times block of code with one parameter changed per paste. So at my work, we have job classifications. They start at "A". He is a "C", which is pretty much entry level for a programmer. He's been here for about 12 years I guess. I am an "E", which is as close to management you can get without going over. I've been here for 7 years, started at "D". But I am still under a Manager (E) who told me to "enhance" this thing (with actual written requirements, which is a refreshing change) so, I dunno. The app was highly regarded when it launched, but holy poo poo it is a pig with not a lot of lipstick.
|
# ? Jun 5, 2015 06:52 |