|
Bleh, the whole attitude that makes people resistant to libraries sucks. Use a goddamn library, losers. (I can see being cautious about adding another dependency, and how big a deal that is will depend on your environment, audience, and product.)
|
# ? Aug 15, 2013 18:07 |
|
|
# ? Jun 5, 2024 06:07 |
|
Huh, I could use a library, glue poo poo together, and be done today. Oooooor I could rewrite all the functionality myself and be entertained all week!!
|
# ? Aug 15, 2013 18:10 |
|
There is also the issue that some libraries are awful, which some people use as an excuse to never use another one. Which is somewhat understandable, imagine if your first exposure to a library was urllib2.
|
# ? Aug 15, 2013 18:15 |
|
That Turkey Story posted:I guess, but on the other hand, when a library is small I often hear a similar but opposite rationale to avoid it, perhaps especially if the problem is seemingly simple: In the specific case of C and C++, this is because dependency management is terrible. In Python, Ruby, Javascript, Objective-C (and a bunch of other languages I haven't used for real projects), adding a new dependency consists of adding a single line to the config file and everything just works. Unsurprisingly, it's common to end up with small projects that use 30 simple single-purpose libraries. In C++ I have to add poo poo to the configure script for each library (which may involve writing some custom autoconf macros), telling people where to get the library, describing how to build it (because Debian only has a 8-year-old version of it packaged, and some distros don't have it at all), and now the number of steps involved in building my application is greater than the acceptable maximum (one). Alternatively, I can spend two weeks trying to automate dependency fetching and end up with something that half-works but annoys all the people that want to use the system copies of libraries. Or I could just spend a few days reinventing the wheel because it's less work than using the existing wheel.
|
# ? Aug 15, 2013 18:16 |
|
There's also the problem of ABI bumps. C++ libraries in particular seem to care less about ABI stability, where libstdc++ will get a soname bump and the rest of the world will have to rebuild to accommodate. Complexity of dynamic linking, especially when caring about Windows / POSIX portability, is such a hassle that sometimes long dependency chains are hard to manage. We use a lot of GNU and POSIX libraries in the GNOME/GTK+ stack, but some developers focused on Windows aren't particularly keen about that.
|
# ? Aug 15, 2013 18:19 |
|
Zombywuf posted:Which is somewhat understandable, imagine if your first exposure to a library was urllib2. Oh man, this is truth. Plorkyeran posted:Unsurprisingly, it's common to end up with small projects that use 30 simple single-purpose libraries. I have a pretty simple database-backed site in Python and the requirements.txt file is 46 lines long.
|
# ? Aug 15, 2013 18:21 |
|
And then you get the guy at work that didn't like having to use existing terminal programs and wrote one in Python. Edit: You know, because it's fast.
|
# ? Aug 15, 2013 18:30 |
|
Zombywuf posted:imagine if your first exposure to a library was urllib2. I once used urllib2 to make a simple web spider but didn't look too deep into it. What's wrong with it? (Disclaimer: I am not a Python programmer)
|
# ? Aug 15, 2013 19:25 |
|
Thermopyle posted:Bleh, the whole attitude that makes people resistant to libraries sucks. Use a goddamn library, losers. In some lines of work, this can actually be problematic. If you're on an isolated network where installing a new library may be a 3 month process (for example, some government systems), and you just need one function out of that library, it can be easier to just code the function yourself and be done with it. If you have a library or easy access to a library, then you may as well just use it instead of reinventing the wheel over and over. This was the philosophy behind MIT's change from Scheme to PYthon in their intro programming course. Of course, if getting that library into your build process is actually a week-long project, then it may be better to reinvent the wheel.
|
# ? Aug 15, 2013 19:43 |
|
Shinku ABOOKEN posted:I once used urllib2 to make a simple web spider but didn't look too deep into it. https://gist.github.com/kennethreitz/973705
|
# ? Aug 15, 2013 19:51 |
|
OzyMandrill posted:In C++, most operator= overloads I have seen tend to be: Well, yeah, it's C++. I wanted to avoid talking about C++ because its assignment behavior is user-definable (at least for non-POD types). Of course, for POD types, I assume it behaves the same way it does for C, where, as it turns out, neither IBM nor Microsoft agree with me (although Wikipedia does!). I'm apparently wrong for Java, but right for C#. And I can't actually find an Objective-C language reference, which is I guess what started all this.
|
# ? Aug 15, 2013 19:53 |
|
GrumpyDoctor posted:Of course, for POD types, I assume it behaves the same way it does for C, where, as it turns out, neither IBM nor Microsoft agree with me (although Wikipedia does!). C99 6.5.16 posted:An assignment expression has the value of the left operand after the assignment, but is not an lvalue. "C++11 5.17 [expr.rear end posted:"]All [assignment operators] require a modifiable lvalue as their left operand and return an lvalue referring to the left operand.
|
# ? Aug 15, 2013 20:33 |
|
QuarkJets posted:In some lines of work, this can actually be problematic. If you're on an isolated network where installing a new library may be a 3 month process (for example, some government systems), and you just need one function out of that library, it can be easier to just code the function yourself and be done with it. Hahahahahaha you have the worst job.
|
# ? Aug 15, 2013 20:33 |
|
Dren posted:Hahahahahaha you have the worst job. Large corporations often have similar policies I'm finding where I work now. We can't get the lawyers to white list by license type. Instead they want to look over every license for everything we might want to pull in.
|
# ? Aug 15, 2013 20:53 |
|
HFX posted:Large corporations often have similar policies I'm finding where I work now. We can't get the lawyers to white list by license type. Instead they want to look over every license for everything we might want to pull in. Yeah, how bad is it? That government stuff he's talking about is awful. Put request in for something incredibly normal like, say, Maven. Hear back 3 months later if you're lucky. gently caress that. Never again.
|
# ? Aug 15, 2013 20:56 |
|
Dren posted:Yeah, how bad is it? That government stuff he's talking about is awful. Put request in for something incredibly normal like, say, Maven. Hear back 3 months later if you're lucky. gently caress that. Never again. It is about 1-2 months here at GM. To be fair, they got screwed by a contractor on some source code related to the Volt. However, they should be able to white list things like BSD, Creative Commons, Apache, Eclipse, etc rather then being on a library by library need.
|
# ? Aug 15, 2013 21:46 |
|
xtal posted:Abusing alias like that is a horror. Especially because if that was properly in a file called git-yolo, you'd be able to use "git yolo" on the command line! code:
|
# ? Aug 15, 2013 22:02 |
|
HFX posted:Large corporations often have similar policies I'm finding where I work now. We can't get the lawyers to white list by license type. Instead they want to look over every license for everything we might want to pull in.
|
# ? Aug 15, 2013 22:59 |
|
JawnV6 posted:Huh, I could use a library, glue poo poo together, and be done today. Oooooor I could rewrite all the functionality myself and be entertained all week!! Or better yet, be entertained months/years down the road when your code fails on some corner case you failed to account for, but the library had covered! My own coding horror lately is the BlackBerry 7 browser which delightfully kills any javascript execution that takes longer than 10 seconds. Of course, this wouldn't be so bad if the actual BB devices weren't painfully slow. Our testing failed to pick this up because the BlackBerry simulators are actually faster than the actual phones. I've had to rewrite a significant portion of an AngularJS application to get the fucker to work on BB7 devices.
|
# ? Aug 16, 2013 01:57 |
|
Thermopyle posted:Bleh, the whole attitude that makes people resistant to libraries sucks. Use a goddamn library, losers. Though if you already include a library as a dependency and you reinvent the wheel anyway, gently caress you. code:
Currently I'm looking through a file that has a whole lot of bad variable/function names. Nothing overly horrifying, but here's a sample of the names used: date (todays date) date2 (todays date) date3 (a date 3 days in the past) datee (todays date formatted in DD/MM/YYYY) 10_days (a date 50 days in the past) 20_days (a date 40 days in the past) 30_days (a date 30 days in the past) display_interface (a function that sets the date format mask) email_header (a function that opens a file) email_body (a function that builds and sends an email with some complicated logic) write_header1 (a function that writes the header of an email) write_header2 (a function that writes the header of an email, one word differs from the above function) write_header3 (a function that writes the body of an email) write_body1 (a function that writes the body of an email) write_body2 (a function that writes a complete email) write_body3 (a function that writes the body of an email, using the text from write_body1 - copy/pasted - with an added paragraph) write_textN (four functions that wrote one line each to a file, but are never actually called)
|
# ? Aug 16, 2013 02:01 |
|
Ephphatha posted:10_days (a date 50 days in the past) Ahaha "I don't see the problem with this, each function's name says very clearly the number of days since 60 days ago!"
|
# ? Aug 16, 2013 03:03 |
|
Ephphatha posted:Currently I'm looking through a file that has a whole lot of bad variable/function names. Nothing overly horrifying, but here's a sample of the names used: It feels like you have a programmer in your midst that doesn't know that they could rename the variables / functions and they have one master template they copy/pasted together seven years ago.
|
# ? Aug 16, 2013 04:09 |
|
These are all from an SQR program. SQR defaults to using the global namespace for everything, unless you declare a function as local or specify the parameters it takes. It is very rare to see a function taking explicit parameters in our codebase, so everything is global. You also can't have multiple select statements pull out columns with the same name in the same namespace, so it's common to see things like "&id" "&id2" "&my_func_id" scattered throughout a file. Hell, thanks to the magic of SQRs concept of includes we have multiple mutually dependent files. File A declares x y z, never uses them. Uses foo bar baz without ever declaring or defining them. File B includes File A and declares foo bar baz, never uses them. File B uses x y z. File C includes File A and declares foo bar baz but uses different values to File B. File C uses x and z only, and in a different context to File B. None of this is documented.
|
# ? Aug 16, 2013 04:27 |
|
I'm just trying to get over SQR as an actual thing. I had never even heard of it before. Is it actually that common? I'm having a hard time coming to terms with people not technically inclined going way out of their way to find something specialized and obscure and then crapping inside it.
|
# ? Aug 16, 2013 04:34 |
|
quiggy posted:Smart people use whitespace like this. Dumb people use whitespace like this. It doesn't really have anything to do with tabs vs spaces, though--at least where I work, it seems to be more "this script won't run, so I'll just add more braces at the end until it will" kind of stuff.
|
# ? Aug 16, 2013 06:49 |
|
At one of my old jobs, we had a contractor that decided it'd be a good idea to cache employee-specific JSON and HTML data for a Drupal site's header and footer... in a MySQL table. When I left the table was at least 2 GB. It was also the common cache table for a Wordpress installation. And it was backed up nightly along with the rest of the DB. sturgeon general fucked around with this message at 07:17 on Aug 16, 2013 |
# ? Aug 16, 2013 07:15 |
|
HFX posted:Large corporations often have similar policies I'm finding where I work now. We can't get the lawyers to white list by license type. Instead they want to look over every license for everything we might want to pull in. This makes me glad that the big M has pre-approved policies for using OSS. Releasing code as Open source is another question entirely.
|
# ? Aug 16, 2013 08:01 |
|
code:
|
# ? Aug 16, 2013 08:04 |
|
erotic dad posted:At one of my old jobs, we had a contractor that decided it'd be a good idea to cache employee-specific JSON and HTML data for a Drupal site's header and footer... in a MySQL table. I love the idea of backing up user-specific cached HTML every night. It's just pure essence of incompetence.
|
# ? Aug 16, 2013 08:06 |
|
Extortionist posted:I wish I could dump large bits of my company's codebase on here, because I could demonstrate quite clearly the ways in which dumb people use whitespace. Should've use Go and gofmt, scrubs
|
# ? Aug 16, 2013 09:52 |
|
Whoops. Still at least the software was well tested apparently. E: my friend sold this to me as a Java horror. I'm not too clued up on Java but by the looks of it it could have been easily avoided. NtotheTC fucked around with this message at 11:42 on Aug 16, 2013 |
# ? Aug 16, 2013 11:21 |
|
That's incredible - "hmm, I just totalled millions of dollars worth of equipment - hire a competent software dev? Re-examine testing methodology? Nah, I'll just post to stack overflow and try again, that'll be cheaper"
|
# ? Aug 16, 2013 11:55 |
|
..btt posted:That's incredible - "hmm, I just totalled millions of dollars worth of equipment - hire a competent software dev? Re-examine testing methodology? Nah, I'll just post to stack overflow and try again, that'll be cheaper" True, a smart dev would've posted to SO before trying to run thread-safe Java.
|
# ? Aug 16, 2013 12:53 |
|
Watching Java devs struggle understand concurrent access is just delicious.
|
# ? Aug 16, 2013 13:37 |
|
Today in bad commit messages:quote:checking in unknown changes that are hanging around <unnamed machine account>
|
# ? Aug 16, 2013 14:11 |
Going through one of our forms to add some functionality and I needed to add an addition to our validate field only to learn this is how the person had programmed it:code:
|
|
# ? Aug 16, 2013 18:56 |
|
Zombywuf posted:Watching Java devs struggle understand concurrent access is just delicious. Is the problem just that the compiler happily reorders the object initialization until after the assignment of the pointer to the (now uninitialized) object?
|
# ? Aug 16, 2013 19:26 |
|
Vanadium posted:Is the problem just that the compiler happily reorders the object initialization until after the assignment of the pointer to the (now uninitialized) object?
|
# ? Aug 16, 2013 19:36 |
|
Vanadium posted:Is the problem just that the compiler happily reorders the object initialization until after the assignment of the pointer to the (now uninitialized) object? It looks to me that x + 1 == y is the bit that fucks up because the object may change between each side of the equality operator being read. The empty synchronised block appears to be some sort of magical ward against it but as far as I'm aware it does basically nothing in this case. I'm not really up to date on Java though so maybe it does actually do something useful.
|
# ? Aug 16, 2013 20:18 |
|
|
# ? Jun 5, 2024 06:07 |
|
Zombywuf posted:It looks to me that x + 1 == y is the bit that fucks up because the object may change between each side of the equality operator being read. The empty synchronised block appears to be some sort of magical ward against it but as far as I'm aware it does basically nothing in this case. I'm not really up to date on Java though so maybe it does actually do something useful. According to the SO thread it's only there to get the behavior to reproduce in the example.
|
# ? Aug 16, 2013 20:56 |