|
Toady posted:COBOL is not uncommon in the banking industry.
|
# ? Nov 1, 2011 14:18 |
|
|
# ? Jun 4, 2024 00:04 |
|
qntm posted:I just want you to know that I laughed at this. The other guy didn't get it, but I did. Well done. I don't get it, what the gently caress's a COBOA?
|
# ? Nov 1, 2011 15:04 |
|
SlightlyMadman posted:I don't get it, what the gently caress's a COBOA? The mathematical dual to a Boa Constrictor.
|
# ? Nov 1, 2011 15:13 |
|
Zombywuf posted:The mathematical dual to a Boa Constrictor. A boa relaxer.
|
# ? Nov 1, 2011 15:21 |
|
qntm posted:I just want you to know that I laughed at this. The other guy didn't get it, but I did. Well done. I got it. PrBacterio posted:I know that. I also know that people still use MUMPS in the medical or insurance sectors or wherever it was used for. I was only saying that that's a horror imo COBOL today has classes, .NET and JVM support, C bindings, and other useful stuff. I've never had to work with it, but I wonder if it's such a horror to use in practice since so much high-dollar industry still depends on it.
|
# ? Nov 1, 2011 18:03 |
|
crazyfish posted:While not a specific piece of quotable code, this library (Kernel Mode Linux) horrified me: http://www.yl.is.s.u-tokyo.ac.jp/~tosh/kml/ I know a lot of robotics people using realtime Linux have really big problems with stuff like this, you get stuck either writing very big very complicated kernel modules or else having to implement shared memory which is really tricky. I'm not an OS person so I don't know all the details, I just know it was a big deal at the last place I worked (which was using linux for robotics). You obviously aren't going to put something like that on your web server anyway, it's for embedded systems and stuff. Honestly it's probably better than having grad students write kernel modules.
|
# ? Nov 1, 2011 18:12 |
|
I think I might have posted this before, but I'm going to again because it just bit me in the rear end again and I wouldn't want anyone to miss it. Here's some neat code from a library I'm using: code:
If this doesn't seem bad, think about the fact that it's entirely undocumented. Good thing I have this source so I can recompile the drat thing - I came dangerously close to being able to spend my time constructively.
|
# ? Nov 1, 2011 19:21 |
|
Toady posted:I wonder if it's such a horror to use in practice since so much high-dollar industry still depends on it. Both MUMPS and COBOL (and many other similar languages) originated in an era where decking out your minicomputer with 256kB of RAM was a significant expense, and you might expect 100+ concurrent users in that. Designing interpreted languages and writing code with them to meet those requirements required a lot of horrors. People think the languages are unequivocally awful because they pretty much only ever see MUMPS/COBOL code that was written 30 years ago or written by people who think it still is 30 years ago, (or worse, have to maintain it), because modern code in those languages written with decent style is really dull.
|
# ? Nov 1, 2011 19:24 |
|
GrumpyDoctor posted:I think I might have posted this before, but I'm going to again because it just bit me in the rear end again and I wouldn't want anyone to miss it. Am I broken by thinking that the coding horror was the fact that the function wasn't taking const std::string references? An MMO server process I worked on years ago used 40% of the CPU time in the std::string constructor at one point during it's alpha...
|
# ? Nov 1, 2011 21:23 |
|
Hughlander posted:Am I broken by thinking that the coding horror was the fact that the function wasn't taking const std::string references? It was the first thing I noticed, but I kept reading.
|
# ? Nov 1, 2011 21:37 |
|
Hughlander posted:Am I broken by thinking that the coding horror was the fact that the function wasn't taking const std::string references? I was so pissed off by its mere existence that I didn't even see that. This library is used as a foundational part of a larger library that's advertised as "generally thread-safe." What does that mean? Well, I found out that if you use this foundational library, as opposed to one of three other choices, nothing's thread-safe. A fact which also isn't documented anywhere - I had to email the creators to learn this. I spent so much time making my fancy-pants algorithm parallelizable, too. That was an awkward conversation to have with my boss. "You know how I said the program's algorithm can theoretically use as many cores as you can throw at it? About that..."
|
# ? Nov 1, 2011 22:12 |
|
Hughlander posted:Am I broken by thinking that the coding horror was the fact that the function wasn't taking const std::string references? code:
|
# ? Nov 1, 2011 22:27 |
|
It's just really forward-thinking and supports quantum computing.
|
# ? Nov 2, 2011 02:41 |
|
Zhentar posted:Both MUMPS and COBOL (and many other similar languages) originated in an era where decking out your minicomputer with 256kB of RAM was a significant expense, and you might expect 100+ concurrent users in that. Designing interpreted languages and writing code with them to meet those requirements required a lot of horrors. People think the languages are unequivocally awful because they pretty much only ever see MUMPS/COBOL code that was written 30 years ago or written by people who think it still is 30 years ago, (or worse, have to maintain it), because modern code in those languages written with decent style is really dull. I was exposed to some COBOL when I worked at a telco and I think you're right. The 'new' COBOL being produced by the department was totally different; relatively readable, fast (for COBOL), and had all kinds of neat add ons linked in. Then I would look at the legacy code that they were replacing/updating and it was crazy. It was like reading assembler in another alphabet or something; the commands made almost no sense, and every line of 'feature' code had 10 comments on it explaining why this would explode if certain strong typing conventions (that weren't built into the language) weren't followed.
|
# ? Nov 2, 2011 05:48 |
|
Sedro posted:This part caught my eye No horror here, just treating all warnings as errors. Best practices, really.
|
# ? Nov 2, 2011 10:20 |
|
As you may know, Java doesn't support unsigned integers. In trying to find the reasons for this, I ran into this helpful post.quote:Let us say we store the age of a person. "What if I want to use a signed integer? Then unsigned integers are no good!" quote:The requirement is, only if the users age is above 18 they should be allowed to perform some action. If they didnt specify the age, he should be blocked. Let us see, how to write the code... "You see, if I use this undocumented trick to avoid making the check for unknown age explicit it can lead to errors! Clearly unsigned integers are the problem here." quote:This reason may look weird, but there is not much to achieve introducing 'unsigned' when compared to the drawbacks. The omission of unsigned data types is controversial. There are reasons where unsigned could help. Example, having unsigned will increase the maximum limit for the data type. All other reasons revolve around this reason. But this could be solved by using a bigger numeral. Example, instead of unsigned int, we can use long. similarly for unsigned short, we can use 'int'. Still, 'long' doesnt have any alternative other than 'BigInteger' wrapper classes. Yes the only reason people want unsigned integers is to increase the upper bound. Cryptography, communication standards, these things don't exist.
|
# ? Nov 2, 2011 15:16 |
|
unsigned integers in my java? it is more likely than you think
|
# ? Nov 2, 2011 15:21 |
|
That guy is an idiot, this is the real reason:Gosling posted:For me as a language designer, which I don't really count myself as these days, what "simple" really ended up meaning was could I expect J. Random Developer to hold the spec in his head. That definition says that, for instance, Java isn't -- and in fact a lot of these languages end up with a lot of corner cases, things that nobody really understands. Quiz any C developer about unsigned, and pretty soon you discover that almost no C developers actually understand what goes on with unsigned, what unsigned arithmetic is. Things like that made C complex. The language part of Java is, I think, pretty simple. The libraries you have to look up. Whether Gosling is right or wrong is debatable (I believe he is right, most rank-and-file developers suck absolute rear end and are unwilling to educate themselves), but I have wished for an unsigned type other than char often enough that I think it was a mistake to omit it.
|
# ? Nov 2, 2011 15:29 |
|
quote:On seeing the code, it is common to assume that '-1' is less than '18' if the user didnt specify the age, so he will automatically blocked. Good loving thing 18 is a signed integer constant then
|
# ? Nov 2, 2011 15:29 |
|
quote:Let us say for 'unsigned int', java adds the keyword 'uint'. Then, sets b to -1, blindly casts it to uint without checking its magnitude, yielding the exact same problem
|
# ? Nov 2, 2011 15:39 |
|
code:
|
# ? Nov 2, 2011 15:43 |
|
qntm posted:sets b to -1, blindly casts it to uint without checking its magnitude, yielding the exact same problem numeric towers are hard let's go casting. personally I question why the omission of unsigned but the inclusion of floats given they cause complications similar in nature
|
# ? Nov 2, 2011 17:10 |
tef posted:numeric towers are hard let's go casting. personally I question why the omission of unsigned but the inclusion of floats given they cause complications similar in nature But how else could you write financial applications if you don't have a way for decimal numbers!
|
|
# ? Nov 2, 2011 17:12 |
|
nielsm posted:But how else could you write financial applications if you don't have a way for decimal numbers! You bastard
|
# ? Nov 2, 2011 17:18 |
|
TRex EaterofCars posted:That guy is an idiot, this is the real reason: Personally I think calling c "complicated" because of unsigned ints is a horror too. Even if that was the case I don't buy his argument - if signed were default then those stupid developers (opps, I mean J. Random Developer) could continue blissfully unaware, while people who actually know what they're doing wouldn't have to start doing bit hacking in order to fulfill misguided efforts to keep Java "simple." Besides, unsigned arithmetic is more straightforward to understand than two's compliment arithmetic.
|
# ? Nov 2, 2011 17:32 |
|
HappyHippo posted:Besides, unsigned arithmetic is more straightforward to understand than two's compliment arithmetic. Exactly!
|
# ? Nov 2, 2011 18:01 |
|
two's compliment arithmetic is the same as unsigned arithmetic. What are you talking about?
|
# ? Nov 2, 2011 18:59 |
|
nielsm posted:But how else could you write financial applications if you don't have a way for decimal numbers! I've seen code where php:<? $price1 = mysql_result($dbprice1); $price2 = mysql_result($dbprice2); $price = $price1.'.'.$price2; ?>
|
# ? Nov 2, 2011 19:03 |
|
Biowarfare posted:oh, and the price fields in the database are varchars How else are we supposed to support multiple currencies?!
|
# ? Nov 2, 2011 19:17 |
|
TasteMyHouse posted:two's compliment arithmetic is the same as unsigned arithmetic. What are you talking about? In that you undertake the same operations, yes, but the encoding of negative numbers is not clear to the uninitiated.
|
# ? Nov 2, 2011 19:23 |
|
Doc Hawkins posted:How else are we supposed to support multiple currencies?! Specify all prices in Buttcoins and then convert to your dated paper currencies!
|
# ? Nov 2, 2011 19:27 |
|
Just found this gem of a response on stackoverflow to a question about, well, stack overflows:quote:I found a workaround in VC. Basically I increase the stack size to 100 000 000, don't know if it allows this limit for my application (not dll or library) within VC. The function inside the exe file is recursive but I don't let it go on until completion. I can then call this exe file as many times as I want from another program and dump the intermediate results to disk and continue until the desired result is obained. It's not the fastest way to run the code but at least the results are good and no stack overflows.
|
# ? Nov 2, 2011 21:16 |
|
Biowarfare posted:I've seen code where That'll throw an error too because mysql_result requires two parameters, one for the resource and one for the row. Hammerite posted:That can be used to find out what's stored in the variable named $name. As in, if you have a variable $name and you want to know what's in the variable whose name is the value stored in $name then you can use $$name. It is ridiculous and I have no idea what you would use it for that isn't stupid. There actually is a use I run into every now and then, but it's pretty rare. It usually doesn't hurt, though.
|
# ? Nov 3, 2011 03:30 |
|
Zamujasa posted:That'll throw an error too because mysql_result requires two parameters, one for the resource and one for the row. In older (and possibly modern, gently caress if I know) versions of PHP you could implicitly refer to the connection like that.
|
# ? Nov 3, 2011 13:17 |
|
code:
|
# ? Nov 3, 2011 15:10 |
|
Zamujasa posted:There actually is a use I run into every now and then, but it's pretty rare. It usually doesn't hurt, though. Do go on.
|
# ? Nov 3, 2011 16:08 |
|
TRex EaterofCars posted:In older (and possibly modern, gently caress if I know) versions of PHP you could implicitly refer to the connection like that. Yep, you can still do that. mysql_* has an implicit, invisible connection if you don't specify a connection handler on mysql_connect. Ramsus Lerdorf, stealing a bunch of poo poo from Perl but didn't really understand what Perl was doing.
|
# ? Nov 3, 2011 17:56 |
|
NotShadowStar posted:Yep, you can still do that. mysql_* has an implicit, invisible connection if you don't specify a connection handler on mysql_connect. Ramsus Lerdorf, stealing a bunch of poo poo from Perl but didn't really understand what Perl was doing. I think that's the definition of 90% of PHP, Perl, and Javascript tutorials on the internet. HURR PERL USES COMMA FOR CONCATENATION WHEN USING PRINT HURR
|
# ? Nov 3, 2011 19:41 |
|
NotShadowStar posted:Yep, you can still do that. mysql_* has an implicit, invisible connection if you don't specify a connection handler on mysql_connect. Ramsus Lerdorf, stealing a bunch of poo poo from Perl but didn't really understand what Perl was doing. I have to wonder: is Ramsus just a gigantic meat-head or is PHP an elaborate troll?
|
# ? Nov 3, 2011 21:23 |
|
|
# ? Jun 4, 2024 00:04 |
|
I answered that question for myself years ago when discovering PHP's variables are case sensitive whereas functions are not.
|
# ? Nov 3, 2011 21:42 |