|
Searching for "if 1" in my code base here finds enough results that I'm not sure if it's in the tens of thousands or hundreds of thousands.
|
# ¿ Aug 28, 2008 18:33 |
|
|
# ¿ Apr 19, 2024 20:49 |
|
I've been reluctant to post in here, since most of the things I see would take too much explaining to be funny. But this one takes the cake, and I have to share it:code:
This code is almost equivalent: code:
|
# ¿ Sep 9, 2008 19:03 |
|
RegonaldPointdexter posted:What language is that? MUMPS
|
# ¿ Sep 11, 2008 15:25 |
|
PnP Bios posted:Why are you still using dead software? Microsoft posted:Non-Supported Phase
|
# ¿ Jan 10, 2009 07:10 |
|
While investigating an issue today, I noticed a form that should be pure UI takes 4 RPCs to the database server to open. I indulged my curiosity and began investigating. 1. Checks if we can get a lock on a certain record. Does not keep lock. The lock will not be needed at any point in the work flow. 2. Checks if the work flow's context is still valid. It's avoidable, but legitimate. 3. Checks if we are allowed to create new records of a certain type. The work flow does not involve creating any records of any type. 4. Tries to load the name of a record. No record is specified. Doesn't matter because no names are supposed to be displayed anywhere. #3 seemed especially curious, so I dug deeper. As it turns out, the form is multi-purpose, and there is one situation where new records are created. This situation represents somewhere between 0.01% and 0.001% of the instances where the form is used. The situation is also easy to test for in an if statement, as it is already identified in a boolean variable. Then I took a look at the server code in the RPC. 7 lines of code, with a logic hole big enough to drive a truck through. It doesn't address the majority of cases at all. Given a certain (unusual) configuration, it will get several cases wrong. Of the few cases it does handle correctly, one was an accident. With that, I pulled up the documentation for the development. The summary (which is used for release notes) states that these changes were removed.
|
# ¿ Feb 5, 2009 21:23 |
|
UberJumper posted:I think the old coop student (who will become a wind-chime soon) didn't use a decompiler. I looked a bit into java Decompilers, but from my understanding is that in java it will return the original functions names, etc. It also keeps comments Even if this is the case, an obfuscation program could still have been used to strip any useful names or comments.
|
# ¿ Feb 23, 2009 04:09 |
|
Wheany posted:Well, it doesn't really show from those lines, but there is no need for the flag to even exist in device.c. That's still not much of a horror; it just looks like useless cruft that's accumulated over many revisions. To contribute, I just came across some code I wrote 6 months ago.... code:
|
# ¿ Apr 8, 2009 19:53 |
|
Gazpacho posted:I understand that everyone has their own sense of code aesthetics, I just wouldn't use it as the basis for calling something a coding horror when my solution is not really much better in production. The horror is not the original programmer's failure to use negation, so much as the comment suggesting that the original programmer is unaware that negation is even possible.
|
# ¿ Apr 13, 2009 02:28 |
|
Goat Bastard posted:code Alternatively, if duplicated function calls murdered your father and raped your mother: code:
|
# ¿ Jul 25, 2009 01:31 |
|
BattleMaster posted:Hint: Not everyone programs for desktop/server/laptop computers. A lot of embedded devices have compilers that aren't so hot at optimization. For example, MPLAB C18 for PIC microcontrollers never generates jump tables out of if/else chains. It instead turns it into a big chain of comparisons. Small Device C Compiler doesn't either, though its jump-table generation for switch/case is pretty bad as it is. A year later the inefficiency from forcing things into difficult to maintain code is going to dwarf the overhead of extra conditional branches.
|
# ¿ Jul 25, 2009 01:36 |
|
sex offendin Link posted:Autoindenting is one thing, but moving code around vertically would throw me off all the time. I don't know where most of my code is vertically. It's convenient having two related functions next to each other, but otherwise I'm just Ctrl+F/jumping to what I'm looking for. What really sucks is when.... Otto Skorzeny posted:Perhaps you should all try the Forth way of organizing code You're working in MUMPS and you have a 32k routine size limit and you have to spread your code across 17 different routines.
|
# ¿ Aug 8, 2009 06:15 |
|
Avenging Dentist posted:just loving quit, it's not worth it. I like it. (My job, not MUMPS) Otto Skorzeny posted:"what is stackholm syndrome?" - Zhentar, 2009
|
# ¿ Aug 8, 2009 14:19 |
|
HatfulOfHollow posted:That still doesn't forgive this... Nor the fact that he named it RoundOff because Round is already taken by a standard VB function.
|
# ¿ Aug 12, 2009 21:29 |
|
Insurrectum posted:Goddamn. Looks like I made the right choice. MUMPS is totally awesome and will train you into a programming legend! code:
code:
|
# ¿ Aug 24, 2009 22:03 |
|
golgo13sf posted:He's actually a very good database guy, just lazy sometimes. Who isn't? That's what you have code review for.
|
# ¿ Nov 19, 2009 20:15 |
|
king_kilr posted:[url]http://74.125.95.132/search?q=cache:2HHNAk2SB6EJ:https://www.codinghorror.com/blog/archives/001045.html+site:codinghorror.com+backup&cd=1&hl=en&ct=clnk&gl=us&client=firefox-a[/url] I love this comment: Coding Horror commenter posted:My backup strategy? I post my important data in base64-encoded little chunks in the comments on the blogs of people who actually take the necessary steps to backup their data.
|
# ¿ Dec 12, 2009 01:31 |
|
Lumpy posted:I want to see the thought process on the variable name.... I'd bet it was originally written within a function that had both s and ss already in use. Then the developer realized that it was long and functions shouldn't be long so they should split things up with cut+paste into a new function.
|
# ¿ Jan 6, 2010 05:57 |
|
You know you've been using MUMPS too long when... you need to sort a list alphabetically and you aren't sure what to do or how to do that. (It's also a sign you need to stop using other archaic languages when the correct answer does not involve calling a standard library function or property of the list object)
|
# ¿ Jan 7, 2010 22:16 |
|
Yakattak posted:It's more like encryption rather than a programming language. The wikipedia article intentionally uses especially dense, confusing examples. No one (at least around these parts) still writes code that lovely and unreadable these days. Jonnty posted:This is the problem with languages like this, it's not like people (often) start writing new projects in them. It's always maintaining old stuff, which is often hard enough with normal languages. We are still actively developing software using MUMPS and have no plans to ever stop doing so.
|
# ¿ Jan 8, 2010 17:55 |
|
rt4 posted:Are you worried about hurting your career by staying at a place where the core technology you use has little relevance outside your current workplace? Not too much, no. Partly because we're moving away from VB6 on the client side (thank loving god) to C#. And partly because I actually enjoy doing legacy code maintenance, and I'm picking up plenty of applicable experience in that area.
|
# ¿ Jan 8, 2010 18:17 |
|
Zombywuf posted:Butthurt much? I'm no fan of java, but I cannot possibly take anyone who thinks this is an acceptable presentation of data seriously. Edit: (1/(Speed/Fastest Speed)) Zhentar fucked around with this message at 23:32 on Jan 28, 2010 |
# ¿ Jan 28, 2010 23:30 |
|
Dijkstracula posted:Well, you know, maybe the VB6 interpreter will just go ahead and unroll that "loop", inline what PD(1),PD(2) and PD(3) evaluate to, and strip out all the dead code blocks...right, guys? VB6 can compile to C object code which is then compiled to binary by VC6, so it will get optimized as well as the VC6 compiler can manage.
|
# ¿ Feb 1, 2010 19:36 |
|
Milotic posted:We have blades at work which restart if a sensor fails - even temporarily. I can see why it makes sense from an ops perspective, but as a developer whose code is running on there, it terrifies the poo poo out of me that it might do it a certain critical juncture. But there's always the possibility that your code could be unexpectedly terminated... if it's making you more aware of that fact, that's a good thing. tef posted:it's easier to crash on an error and restart than recover in some cases. There are some failure-resistant CPU architectures that will run everything in duplicate. Run the same thing side by side; if at the end you get two different answers, flush everything and try again.
|
# ¿ Mar 25, 2010 04:04 |
|
^^^^ Woo re-implementing standard library functions with unusual names! Brilliant!LockeNess Monster posted:What is wrong with complicated conditions and/or math in for loop? It can make sense and be elegant in certain ways. "Elegant" is not the word I'd choose for needing to search through 6 lines of code to find the semicolons needed to even begin understanding what the loop is doing.
|
# ¿ Mar 26, 2010 18:59 |
|
mr_jim posted:K&R supremacy. 1TBS is accurately named.
|
# ¿ Mar 27, 2010 04:29 |
|
Hammerite posted:I think BODMAS (or whatever you learnt it as) is sufficiently basic to be assumed. Obviously some base level of knowledge could be assumed in all instances. I find it easier to just always use parenthesis rather than try to keep track of whether or not whatever I'm using today actually correctly follows order of operations.
|
# ¿ Mar 27, 2010 23:31 |
|
My money would be on a poor understanding of the syntax involved, or not understanding beforehand what values need to be passed. Either way, it means extra work switching back and forth between from the header trying to correctly define the function.
|
# ¿ Apr 16, 2010 15:27 |
|
|
# ¿ Apr 20, 2010 23:10 |
|
Plorkyeran posted:There's a difference between invalid input and input that has to be escaped. "gently caress you" in a phone number field should probably be rejected by the UI, but "O'Connor" in a name field certainly shouldn't be rejected. It might need to be escaped prior to being sent to the database, but that should be handled by the code that actually calls the database, not some higher level module. There's also the small matter of free text comment fields, where there essentially is no invalid input; someone can enter "Comment' DROP TABLE TRANSACTIONS" if they want to, and there shouldn't be anything wrong with that. Edit: Avenging Dentist posted:with no indication in any of the documentation that that's how it actually worked. Zhentar fucked around with this message at 02:35 on Apr 21, 2010 |
# ¿ Apr 21, 2010 02:28 |
|
Insurrectum posted:Does Epic have a thing for physics grads? They tried to recruit me last year as I was graduating. Thankfully, grad school went through. Physics is one of several majors (math too, and maybe music) that they target to hire into technical services to support customers. The position involves a lot of troubleshooting and debugging, plus potentially developing fixes or custom programming. They're looking for people with logic/reasoning skills that can be taught to program adequately well, while saving the serious programmers for R&D.
|
# ¿ Apr 22, 2010 06:07 |
|
Avenging Dentist posted:the CEO is a fruit loop. The CEO is also a workaholic, and has built a company culture that expects everyone else to be too (my boss got a call once from someone who heard me mention I only average 42 hours a week). I like my job well enough, and they pay very well, but I don't think most CoCers could handle the VB6+MUMPS thing. Jethro posted:http://thedailywtf.com/Articles/A_Case_of_the_MUMPS.aspx Not to defend MUMPS, but that article is terribly inaccurate. It also misses a lot of good reasons to hate MUMPS.
|
# ¿ Apr 22, 2010 22:52 |
|
It's pretty easy to write obfuscated MUMPS, but with some decent coding standards (and not trying to be clever) it's easy to understand. The abbreviated commands can be confusing if you aren't familiar with it, but it's actually quite nice.
|
# ¿ Apr 23, 2010 00:26 |
|
rt4 posted:Nicer than what? Not trying to be snarky; I just don't get it. The abbreviated syntax is nicer than the not-abrreviated syntax. Plorkyeran posted:Can you post an example of some MUMPS code that you would consider easy to understand? I've never seen any that did anything not completely trivial that wasn't hideous. I don't have anything handy that would be understandable without a whole lot of context. I'll check out the programming competition thread and put together a solution for something quick, unless you have any specific ideas.
|
# ¿ Apr 23, 2010 01:47 |
|
rt4 posted:Write fizzbuzz code:
|
# ¿ Apr 23, 2010 02:11 |
|
^^^ Yeah, it does. And I've got more for you too! I decided to do Project Euler problem #10 http://projecteuler.net/index.php?section=problems&id=10 posted:The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. code:
|
# ¿ Apr 23, 2010 03:07 |
|
pseudorandom name posted:Does that print Fizz/Buzz/FizzBuzz instead of or in addition to the number? Oops. Should've read the description more carefully.
|
# ¿ Apr 23, 2010 05:50 |
|
Shumagorath posted:Am I alone in liking that for loop structure (start:increment:end)? Maybe it's because I got my start in OOT and Pascal. I'm cool with the for loop structure. It's the foreach structure that gets a bit awkward, although it makes up for it by being very flexible. code:
|
# ¿ Apr 23, 2010 18:02 |
|
Avenging Dentist posted:QUIT:num="" says "break out of this loop, but only when num is the empty string. Just to clarify, the empty string is not a legal subscript. When $ORDER returns "", that means you've reached the end of the array. Internet Janitor posted:<job security> Not really. This stuff can be easily trained in under a week.
|
# ¿ Apr 24, 2010 19:33 |
|
Avenging Dentist posted:Which is why the training period is (was?) three months for developers. And that's excluding application training and project-level training. All told, it was about 7 months before I committed a single thing. Was. They've cut it down to about 2 1/2 months. But of that, only one week was MUMPs specific; the rest was VB, framework, and application training (so I don't know why you would think that was excluded...). By my 6 month mark, I'd completed a project to be delivered to a customer shortly, so I'm guessing your team was weird. BP posted:As of a recent version, Caché is now compiled to byte code and comments no longer cause a performance hit. By recent, I mean in the last year or two. Caché has compiled to byte code for a long time. Comments at the end of lines were stripped, however lines that were pure comments were compiled as noops, to preserve line numbering for jumps to offsets. Recent improvements have allowed lines that are pure comments to be removed entirely.
|
# ¿ Apr 24, 2010 23:07 |
|
|
# ¿ Apr 19, 2024 20:49 |
|
Avenging Dentist posted:so in the absence of actual performance data, they relied on superstition to tune their code. Incidentally, this is still the case at Epic, or was when I was there; people who went through training at different times received vastly divergent advice about performance (and it wasn't due to compiler/interpreter changes). There are still plenty of people who attempt tune their code without gathering performance data, misunderstand recommendations, and disseminate incorrect information. Although this thread is proof that the problem is hardly unique to Epic or MUMPS. There has been some substantial effort recently to improve the quality of performance training and documentation, which has helped. Avenging Dentist posted:Also global variables were infinitesimally faster than local variables Local variables are much faster than globals for a relatively small number of subscripts. However, globals scale much better.
|
# ¿ Apr 24, 2010 23:24 |