|
Jabor posted:It's basically this. It makes no sense to waste half your screen area displaying a river of blank space just because some lines occasionally break into it - limiting lines to 80 characters allows you to make better use of that space, at the cost of having to wrap longer lines occasionally.
|
# ? Jun 21, 2013 23:36 |
|
|
# ? May 16, 2024 06:18 |
|
RICHUNCLEPENNYBAGS posted:vi and emacs ahve linewrap so even if you're working in an 80 x 20 terminal window for some reason it's not a problem. Automatic line wrap is loving awful.
|
# ? Jun 21, 2013 23:37 |
|
The option to switch between the two has been loving useful for line-break sensitive scripting languages, though.
|
# ? Jun 21, 2013 23:39 |
|
RoadCrewWorker posted:That makes the most sense Sounds like a yospos rule #36 call. I don't see any reason why one has to lower oneself to suit people buying ridiculously small laptops. I get plenty of ribbing already at work for only a single 20" panel. Glassfish WSDL importing has yielded some of the most entertainingly long function calls I have ever seen, almost wrapping twice on a normal monitor.
|
# ? Jun 21, 2013 23:51 |
|
MrMoo posted:Sounds like a yospos rule #36 call. I don't see any reason why one has to lower oneself to suit people buying ridiculously small laptops. I get plenty of ribbing already at work for only a single 20" panel. I don't see why we have to lower our standards for people who can't be hosed to format their code to reasonable line lengths. I'm no PEP8 zealot, but it serves it's purpose and inordinately long statement lines are bad for reading, which you spend a great deal more time doing than writing.
|
# ? Jun 22, 2013 00:26 |
|
Today at work I saw a 59-argument function. That's a loving horror.
|
# ? Jun 22, 2013 00:53 |
|
Jabor posted:Java is obnoxiously verbose though, so 80 columns really isn't enough there - limit it to 120 or something. (120 is nice because then you fit two Java windows in the space that fits three other-language ones)
|
# ? Jun 22, 2013 01:12 |
|
yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. how
|
# ? Jun 22, 2013 01:30 |
|
Lysidas posted:Variable names like that make sense when you're in the middle of implementing an algorithm from a paper or textbook, but you rename them after you get it working It's also fun that the constructor returns an int some of the time (why does it return this int? And why 4? No one knows, not even the coder)
|
# ? Jun 22, 2013 01:37 |
|
I would have mentioned that too, but I figured it was a side effect of you typing pseudocode from memory. That "works" in 2.4 but not 2.6, and I don't have a 2.5 installation handy to see whether it works in that version.Python code:
Python code:
Python code:
|
# ? Jun 22, 2013 01:50 |
|
Codepad runs 2.5 It fails. 2.5 was released 7 years ago.
|
# ? Jun 22, 2013 02:01 |
|
Plorkyeran posted:Automatic line wrap is loving awful. I don't know about vi but emacs has an indicator so you know if it's a "real" linebreak (unless you turn on visual-line-mode or whatever) and anyway, it sure beats poo poo running off the screen. yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. Been automating Office products, huh?
|
# ? Jun 22, 2013 03:09 |
|
yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. how many of them ended up being NULL ?
|
# ? Jun 22, 2013 03:17 |
|
Lysidas posted:I would have mentioned that too, but I figured it was a side effect of you typing pseudocode from memory. That "works" in 2.4 but not 2.6, and I don't have a 2.5 installation handy to see whether it works in that version. Would the int even be accessible in any way? IE, if I called MyObject(args) would I get an int instances instead of a MyObject instance if that's what the constructor returns?
|
# ? Jun 22, 2013 03:44 |
|
QuarkJets posted:Would the int even be accessible in any way? IE, if I called MyObject(args) would I get an int instances instead of a MyObject instance if that's what the constructor returns? No; the value returned by __init__ is lost. Remember that all Python functions return None unless you specify otherwise -- if the return value of __init__ was used as the instantiated object you'd get None when creating an instance of any class. Python __init__ methods are better described as "initializers" than "constructors". You can define a real constructor that returns the wrong thing, if you really want to: Python code:
|
# ? Jun 22, 2013 04:02 |
|
Jerry SanDisky posted:how many of them ended up being NULL ? I don't remember, I didn't try searching for it in the codebase. I just closed my tab and tried to forget. Anyway, PHP just did a beta redesign of their site! It looks very nice, very Web 2.0. Except all the links go back to the old version. Opinion Haver fucked around with this message at 07:27 on Jun 22, 2013 |
# ? Jun 22, 2013 06:15 |
|
usually if you are using __new__ in python, you are either doing some hacker metaprogramming poo poo or you are making a mistake. Or quite possibly both.
|
# ? Jun 22, 2013 07:19 |
|
Lysidas posted:No; the value returned by __init__ is lost. Remember that all Python functions return None unless you specify otherwise -- if the return value of __init__ was used as the instantiated object you'd get None when creating an instance of any class. Look at what you've done; now you are the coding horror.
|
# ? Jun 22, 2013 09:22 |
|
Maluco Marinero posted:I don't see why we have to lower our standards for people who can't be hosed to format their code to reasonable line lengths. I'm no PEP8 zealot, but it serves it's purpose and inordinately long statement lines are bad for reading, which you spend a great deal more time doing than writing. Yeah this. If we didn't PEP8 at work, we'd spend all day trying to decode each others 300 character multi-layered list comprehensions. The 80-character limit is just a little check to prevent you from outsmarting yourself.
|
# ? Jun 22, 2013 18:02 |
|
yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. Let me guess: someone didn't understand the concept of passing arrays, and instead had input1 through input50, along with a few other arguments.
|
# ? Jun 23, 2013 02:10 |
|
Volmarias posted:Let me guess: someone didn't understand the concept of passing arrays, and instead had input1 through input50, along with a few other arguments. The only legitimate reason I can think of doing that is if you're doing function dispatch and you need to keep the signature the same so that other functions can use the arguments. You could use the *args, **kwargs pattern but that way can look cleaner if there's not too many arguments and I guess it makes the fact you're ignoring certain arguments more explicit.
|
# ? Jun 23, 2013 02:17 |
|
I guess I can imagine something like a window class that has a ton of arguments for construction, but unless the language/library supports named parameter passing and defaults it's probably a lot better to just pass in an object with datamembers that represent the parameters.
|
# ? Jun 23, 2013 02:36 |
|
I'm guessing it's just a series of customizations that clients asked for over an extended period and were hacked in the most immediately convenient way possible.
|
# ? Jun 23, 2013 06:07 |
|
Our sample order emailing system crapped out today. The business problem is "When an order gets shipped, send an e-mail to the customer that tells them it's been shipped." The solution was developed by a space cadet who was on a crusade to make the database server do literally everything. He would frequently work for a good two weeks on something before showing it to me and the other developers to see if we thought it was a good idea. The answer was always "No, that's insane", but his response would always be "Well, I already finished it, sooooo...." I'm going to quote the email I sent to the program owner on why it broke today. quote:The problem was that *SALES REP* put in a quantity on a test order of 999,999.
|
# ? Jun 24, 2013 17:29 |
|
I'm tempted to post this whole code segment, but I think it's better to meditate on what someone was thinking when they wrote this line:C# code:
|
# ? Jun 24, 2013 20:31 |
|
yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. How the gently caress does this happen
|
# ? Jun 24, 2013 20:49 |
|
One possible scenario was explained in this very thread.
|
# ? Jun 24, 2013 20:59 |
|
npe posted:One possible scenario was explained in this very thread. Holy poo poo I forgot about the loving plane
|
# ? Jun 24, 2013 21:02 |
|
yaoi prophet posted:Today at work I saw a 59-argument function. That's a loving horror. tell me this was autogenerated somehow or done by an intern so I can put down the pitchfork npe posted:One possible scenario was explained in this very thread. Oh dear lord. I... I... er... I can't even speak. That's just.... ...... quiggy posted:Holy poo poo I forgot about the loving plane I seriously just lost my poo poo. Luckily my boss already went home for the day, because that was hilarious. Zaphod42 fucked around with this message at 23:14 on Jun 24, 2013 |
# ? Jun 24, 2013 23:06 |
|
This is horrifying but also justified?Jonathan Garrett, Insomniac Games posted:(s)elf-exploitation
|
# ? Jun 25, 2013 00:32 |
|
quiggy posted:Holy poo poo I forgot about the loving plane Oh my god. I just saw that for the first time. Everyone on the train was staring at me
|
# ? Jun 25, 2013 01:27 |
|
Aleksei Vasiliev posted:This is horrifying but also justified? Holy poo poo that is wonderful
|
# ? Jun 25, 2013 01:30 |
|
Aleksei Vasiliev posted:This is horrifying but also justified? This reminds me of the story of AOL using a buffer overflow in their own AIM software as a means to identify unofficial clients and kick them off. http://www.geoffchappell.com/notes/security/aim/index.htm
|
# ? Jun 25, 2013 01:40 |
|
Bunny Cuddlin posted:I'm tempted to post this whole code segment, but I think it's better to meditate on what someone was thinking when they wrote this line:
|
# ? Jun 25, 2013 04:00 |
|
Shudder:::: Well I once worked for a large media company in the London UK area, They do the websites for people like Womens Tennis Association, Premier League Football sites, Big Brother (the TV series) website to do the Video Streaming. And their system works on a huge in house CRM with Drag and Drop Layout system. The main class in the application is called article.java 15773 lines 113 import statements 800 lines of variable / static variable definitions 2000 lines of Getters and Setters with some SQL calls dropped in Then the rest is all business logic. Only the Senior Architects were allowed to touch this file although EVERY new dev wanted to get it refactored.
|
# ? Jun 25, 2013 12:34 |
|
Aleksei Vasiliev posted:This is horrifying but also justified? Holy. loving. poo poo. I.... I just don't even know how that's possible. Insomiac games, what the hell? That was 2004. You're a major developer with many, many successful shipped games under your belt. Wow. Every part of that is solid loving gold. I really love their hack solution too, and when it gets to garbling the data to avoid null terminators in the EULA string, that's just the best coding horror I've ever read. Between the for-switch loop and this, I feel like the thread has to be all down hill from here. Prove me wrong. kitten smoothie posted:This reminds me of the story of AOL using a buffer overflow in their own AIM software as a means to identify unofficial clients and kick them off. Well that's... creative? Zaphod42 fucked around with this message at 22:34 on Jun 25, 2013 |
# ? Jun 25, 2013 22:28 |
|
Zaphod42 posted:Holy. loving. poo poo.
|
# ? Jun 25, 2013 22:31 |
|
Zaphod42 posted:Wow. Every part of that is solid loving gold. I really love their hack solution too, and when it gets to garbling the data to avoid null terminators in the EULA string, that's just the best coding horror I've ever read. This is pretty standard stuff when writing an exploit. You write scripts to clean up your payload code and make running them a step in your build process.
|
# ? Jun 25, 2013 23:10 |
|
Zaphod42 posted:Wow. Every part of that is solid loving gold. I really love their hack solution too, and when it gets to garbling the data to avoid null terminators in the EULA string, that's just the best coding horror I've ever read. Slammer had to do the same thing. Didn't fix it up after, but it's pretty common to craft a payload to avoid a null byte.
|
# ? Jun 25, 2013 23:31 |
|
|
# ? May 16, 2024 06:18 |
|
Finally something to contribute. The following is from a dev that has been around for over 6 months, and apparently has over 10 years of experience. code:
|
# ? Jun 26, 2013 05:48 |