|
Uhmm where's the backlight edition??!
|
# ? Mar 31, 2008 19:31 |
|
|
# ? May 16, 2024 17:45 |
|
A piece of code that reads items from a buffer, skips a user-definable amount of items, and processes the rest:code:
The same guy who wrote this also wrote a UserControl that disposed and recreated all its child controls in the OnPaint
|
# ? Mar 31, 2008 19:40 |
|
quote:...the context-sensitive return value of an array... To be honest I like explicitly specifying scalar(@a) for array length as the fact that @a reduces to its length in scalar context (and length(@a) is wrong!) is loving gross.
|
# ? Mar 31, 2008 20:21 |
|
Bonus posted:Ultimate variable naming scheme code:
One of the creators of the MUD had a penchant for naming variables things like bing, blue, rabbit, or womble; and his RCS comments half the time are something like "fixed up the thingy a bit". I think he works for Google now. (If you're reading this, Hi David!)
|
# ? Mar 31, 2008 22:21 |
|
If we had editors that let you have rich symbology, colors, icons, tables, and flow diagrams instead just a static grid of ascii text of course this whole argument we just had would be moot since naming would take a backseat. Fortress doesn't count because you have to run the whole thing through LaTeX, and it's read only. nebby fucked around with this message at 22:39 on Mar 31, 2008 |
# ? Mar 31, 2008 22:37 |
|
nebby posted:Is that a lesbian porn button under the YouTube button? And why is there a Shakespeare button? Is that to solve the "million monkeys at a million typewriters" problem?
|
# ? Mar 31, 2008 23:06 |
|
I never found the appeal of those keyboards because I rarely look at my keyboard and when I need to do stuff quickly I rely on vim's command mode or just on keyboard shortcuts in general while in other applications.
|
# ? Mar 31, 2008 23:09 |
|
nebby posted:If we had editors that let you have rich symbology, colors, icons, tables, and flow diagrams instead just a static grid of ascii text of course this whole argument we just had would be moot since naming would take a backseat. Fortress doesn't count because you have to run the whole thing through LaTeX, and it's read only.
|
# ? Mar 31, 2008 23:09 |
|
This is the best (experimental) graphical implementation of (a subset of) programming I have yet seen. I agree that in principle there are many potential benefits to be had from a more graphical approach to programming, but this has been tried in the past and is at the very least difficult to make more usable than traditional text-based approaches. It is also irrelevant to our choices of variable names in the software we will be writing for the next 5 to 50 years. http://subtextual.org/subtext2.html
|
# ? Mar 31, 2008 23:19 |
|
such a nice boy posted:Is that a lesbian porn button under the YouTube button? And why is there a Shakespeare button? Is that to solve the "million monkeys at a million typewriters" problem? Scaevolus posted:This is sarcasm, right? please?
|
# ? Mar 31, 2008 23:41 |
|
Bonus posted:I never found the appeal of those keyboards because I rarely look at my keyboard and when I need to do stuff quickly I rely on vim's command mode or just on keyboard shortcuts in general while in other applications. I think the amount of modal complexity can probably go up quite a bit if the keyboard helped hold the hand of the programmer until they could run on their own. This type of interface would bring about intuitivity without a loss of efficiency, which is great. What makes this type of thing applicable to higher level domain language based programming is when you can have a UI with a many customizable modes and have it not be a total roadblock to productivity. Right now, you cannot just open up Vim and start using it. With this type of input device (or one similar) you can totally switch between relevant domains and start cranking stuff out relatively easily without up-front memorization. So, if you wanted to start writing code using logic operators, and then switch to a mode that lets you input electrical diagrams, and then switch to a mode optimized for database schema manipulation, you could have the mode reflected on the keyboard and not rely upon memorizing unintuitive commands. Again, I point to CAD/3d modelling apps as inspiration for this approach. Of course, once you spend a few hours in "database schema manipulation mode" you'd have the muscle memory down, just like you do in Vim. One thing I think would be really interesting would be the introduction of a kanji-like symbology so the density of information in code could go way up since the cardinality of characters would be much, much higher.
|
# ? Apr 1, 2008 00:33 |
|
nebby posted:One thing I think would be really interesting would be the introduction of a kanji-like symbology so the density of information in code could go way up since the cardinality of characters would be much, much higher. Do you ever stop masturbating to thoughts of how steeper learning curves could be added to programming?
|
# ? Apr 1, 2008 01:51 |
|
Ryouga Inverse posted:Do you ever stop masturbating to thoughts of how steeper learning curves could be added to programming? Kidding, the kanji thing is just mental masturbation, so you've got me there. That said, the goal of domain specific programming is meant to reduce the barrier to entry by letting domain experts specify the problem using languages they already are familiar with, and decrease the amount of code overall by employing generative programming techniques so there is less work involved. Use the fluffy English readable ambiguous languages high up enough so they are fun and easy to read for humans, and at the bottom you get the dense high learning curve languages that do the actual work on the wavelengths that wizard programmers can be maximally effective. Fundamentally, the idea is you can have it both ways, but currently the paradigm locks you into a single language with a one type of notation and a single level of abstraction, so it's going to be a while before we see this take hold (if ever.) And now, a Coding Horror. Rails' association proxies: code:
|
# ? Apr 1, 2008 02:44 |
|
Our intern programmer makes me laugh some days. For example, he future proofed all his code, just in case the definition for a newline ever changes on Windows:code:
code:
|
# ? Apr 1, 2008 03:09 |
|
Triple Tech posted:These things, as Perl programmer, piss me off: code:
|
# ? Apr 1, 2008 06:46 |
|
Kidane posted:While I am paid to write Perl, I am by no means an expert. However, I'm of the opinion that there is nothing inherent to Perl which requires overly-concise code. No, but concise code is often much easier to read, e.g. code:
As for the Optimus KB; WANT! Really, after having just looked at it I may need a change of underwear.
|
# ? Apr 1, 2008 10:22 |
|
nebby posted:Fortress doesn't count because you have to run the whole thing through LaTeX, and it's read only. I believe you are looking for APL. It needed special keyboard and editors: Also: Dijkstra posted:APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums.
|
# ? Apr 1, 2008 11:39 |
|
Kidane posted:
Then you're no friend of mine. There's a difference between being concise and golfing (which Perl folk love to do) and this isn't golfing. The entire field of computer science has been about a power versus concision payoff. And if you can't see that, then you're hopeless. code:
|
# ? Apr 1, 2008 14:33 |
|
Triple Tech posted:
Same crap in PHP, I just roll my eyes and remember 8-bit BASIC. With PHP you have more options to make it read easier, so its even more retarded. Similar vein is variable substitution like this, but for large HTML/XML blocks: code:
|
# ? Apr 1, 2008 14:57 |
|
quote:Then you're no friend of mine. There's a difference between being concise and golfing (which Perl folk love to do) and this isn't golfing. The entire field of computer science has been about a power versus concision payoff. And if you can't see that, then you're hopeless. You guys are arguing about inelegant code, which can be annoying if there's a lot of it sure, but I have a hard time calling it really a "code horror", unless you're the type of person that gets in a huff about everyone's bike shed. For me, true code horror is when you realize that the author clearly doesn't have any idea whatsoever that what they are doing is terribly dangerous and evil (see my COMMIT in stored procedures rant from earlier), or just so outright incompetent that it's obvious the author doesn't really "get" programming in any way, like in the following (apologies for recycling this from the last thread, it's just too drat hilarious to me): code:
|
# ? Apr 1, 2008 15:11 |
|
Triple Tech posted:Then you're no friend of mine. There's a difference between being concise and golfing (which Perl folk love to do) and this isn't golfing. The entire field of computer science has been about a power versus concision payoff. And if you can't see that, then you're hopeless. I hate to admit it, but your way is much easier to read, and perltidy agrees with you. Like I said, I'm no expert, and I'm not married to my style of coding.
|
# ? Apr 1, 2008 16:59 |
|
tef posted:I believe you are looking for APL. Being able to key in code in the language using plain ASCII or unicode key chords is just a matter of modality, which is what I was talking about. You could project APL in plain text mode for enhanced intuitivity and input, and re-project it as unicode when it was time to dig through code you've already understood. As long as this re-projection is quick and painless, it's a great approach. Fortress fails on this account because it sees the reprojection as a separate offline process altogether, though I suppose tools can get better. A bigger problem though is that Fortress doesn't let you mix domain languages (it's domain is higher mathematics, really) but that's an altogether different problem than the one APL and Fortress are trying to solve with symbology.
|
# ? Apr 1, 2008 17:06 |
|
nebby posted:it doesn't appear APL is considered a universally discarded idea. People liked the point free style and the array operators, but the heiroglyphs haven't been as popular. nebby posted:You could project APL in plain text Infact, K and J are APL variants that use ascii only. And going back a little to the glyphs, space cadet keyboard anyone ? (If you have ever wondered why the keybindings for emacs are a little mental, now you know) nebby posted:A bigger problem though is that Fortress doesn't let you mix domain languages (it's domain is higher mathematics, really) but that's an altogether different problem than the one APL and Fortress are trying to solve with symbology. I think you're looking for katahdin. code:
|
# ? Apr 1, 2008 17:18 |
|
tef posted:I think you're looking for katahdin.
|
# ? Apr 1, 2008 17:40 |
|
Back to crummy code.code:
|
# ? Apr 1, 2008 18:11 |
|
dustgun posted:Back to crummy code.
|
# ? Apr 1, 2008 19:27 |
|
Khorne posted:People write code that bad? I hope it was a first year student. edit oh I see, this is just another "single entry and exit point" abortion it seriously took me three readings to figure out how that code could possibly work
|
# ? Apr 1, 2008 21:51 |
|
Clearly, return is a function.
|
# ? Apr 2, 2008 00:41 |
|
Victor posted:Clearly, return is a function. I should mention, just for the sake of mentioning, that this was written by a coworker of a friend of mine. I changed the method and variable names, but, it's real live code somewhere.
|
# ? Apr 2, 2008 01:16 |
|
A non-profit I do some work for had a webpage donated to them by a volunteer that looked like it was deployed in 1996. After multiple people walked away rather than try to work with the volunteer I got asked to take a look at it. Where a form appears on the page is instead this:code:
code:
the talent deficit fucked around with this message at 01:32 on Apr 2, 2008 |
# ? Apr 2, 2008 01:27 |
|
the talent deficit posted:
jesus christ what the hell
|
# ? Apr 2, 2008 03:32 |
|
rotor posted:jesus christ what the hell Probably some kind of automated obfuscation app? That's loving horrible. Who would write software to DONATE that was entirely unmaintainable? What a douche.
|
# ? Apr 2, 2008 04:08 |
|
Victor posted:Clearly, return is a function. For what it's worth, I have a hunch this was how it was originally written back when C was very young as evidenced by it appearing in UNIX Version 6. I could be wrong, but I knew I'd seen return treated as a function somewhere reputable before.
|
# ? Apr 2, 2008 04:22 |
|
Victor posted:Clearly, return is a function. The SSL library by Reuters has oodles of wonders like this. Basically the API is 20 years old and needs to support every lovely poo poo poo poo compiler and linker out there. To an extreme. It's one function per file as old linkers don't smart link properly.
|
# ? Apr 2, 2008 05:54 |
|
dustgun posted:I should mention, just for the sake of mentioning, that this was written by a coworker of a friend of mine. I changed the method and variable names, but, it's real live code somewhere.
|
# ? Apr 2, 2008 05:59 |
|
the talent deficit posted:So then, in the javascript, I find an eyeframe that's loading this (except it goes on for about six pages):
|
# ? Apr 2, 2008 06:13 |
|
I dunno man, insert some underscores into the obfuscated version and it starts looking like Hungarian...
|
# ? Apr 2, 2008 06:24 |
|
Ha ha. It's obviously even more advanced than Hungarian, it's the elusive md5(rand()) notation.
|
# ? Apr 2, 2008 06:38 |
|
Surge Strip posted:
Woah, OK, this example here takes the cake. Let me see if I can list the problems here: 1. A function that does the intended effect already existed. 2. The function name is purposely misspelled. 3. I've never written Delphi before, so correct me if I'm wrong, but newstring is going to be the old string's ASCII characters shifted down 32. So this fantastic reimplementation doesn't even do anything right. (Your newline is now ASCII -22! Or maybe even 234! ) 4. This is a trivial function for someone a month into their first ever programming class with no prior experience. Yet someone got paid to write this. This simply cannot be topped. This is maximum . (Did I miss anything?)
|
# ? Apr 2, 2008 08:00 |
|
|
# ? May 16, 2024 17:45 |
|
pokeyman posted:(Did I miss anything?) His input variable is named "str" and his aggregating one is named "newstring", if I try to put myself in his position, he probably said to himself, "ok, I'll name the input variable string and the output variable newstring. That makes sense. Oh, god drat it, I can't name a variable string because its one of those special colored in words. I guess I'll just call it str." Surely he did this after having the same mental exercise happen that resulted in Uppercase -> Upercase.
|
# ? Apr 2, 2008 08:09 |