Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Coding Horror

1356737

Comments

  • Registered Users Posts: 7,231 ✭✭✭Fad


    lil_lisa wrote: »
    Someone discovered this over in AH in the source code of a website:

    [HTML]<!--
    -\-
    \-- \-
    \ - -\
    \ \\
    \ \
    \ \\
    \ \\
    \ \\
    \ \\\
    \ \\
    \ \\
    \. . \\
    \ . \\
    \ . \\
    \ . \\
    \ . \\
    \ <=)
    \ <==)
    \ <=)
    \ .\\ _-
    \ . \\ _-//
    \ . \\ _-_/ /
    \ . . . \\ _--_/ _/
    \ \\ _- _/ _/
    \ \\ ___-(O) _/ _/
    \ \ __-- __ /_ / ***********************************
    \ \\ ____--__---- / \_ I AM A MOTHER****ING PTERODACTYL!
    \ \\
    / \_ \_ HERE TO PTERO-YOU A NEW ASSHOLE
    \ \ // // \__ \_ [url]HTTP://PTERODACTYL.ME[/url]
    \ \\ // // \_ \_ **********************************
    \ \\ /// // \__-
    \ - \\///////// //
    \ - \_ //
    / - //
    / - ///
    / - //
    __--/ ///
    __________/ // |
    //-_________ ___ //// |
    ____\__--/ ///// |
    ______ -/---________//// |
    _______/ --/ \ |
    /_________-/ \ |
    // \ /
    \. /
    \ . /
    \ . /
    \\ . /
    \ /
    \ __|
    \ ==/
    / //
    / . //
    / . . //
    /. /
    / //
    / /
    / //
    / //
    --/ /
    / //
    //// //
    ///_________////


    -->[/HTML]

    **Phil, I'm assuming since we shouldn't name companies, the same goes for websites?

    It does unless you want to get banned for a week >_>


  • Registered Users Posts: 1,407 ✭✭✭Promac


    Not a coding thing as such but a developer with 20-odd years experience just asked me what "ide" we used for java development. Not IDE, the accronym, but "ide", as in rhymes with "hide".


  • Registered Users Posts: 981 ✭✭✭fasty


    I know a developer who didn't get passing by reference and immutable objects.


  • Registered Users Posts: 20 dropstar


    Hi there

    I'm a software developer for a small company. I've been working here for about 18 months, and it's only now that some of the flaws in the way we do things have become apparent.

    Our codebase is very large - about 900,000 LOC, in mostly C++, though a lot of new projects are being written as .NET DLL plugins and the thing is patched together using COM interop. I say patched because it's a crappy, flimsy way to architect and you spend as much time fixing DLL-hell related issues such as interface registration, multiple side-by-side DLL versions and so on as you do implementing new code.

    We have 4 other full-time developers and two QA staff. So that works out at 180,000 lines of code per developer.
    I accept that most of the changes that take place are centred around a much smaller subset of that code, but it still seems like a ridiculous ratio. The codebase smacks of mid-90's Windows apps - a mess of C++, COM and ActiveX components and MFC-based UI, and this trend continues, due to the amount of legacy code that new features must interoperate with, and long-time developers being stuck in their ways.

    Our current project was due to be released three weeks ago - we're still here fixing bugs though. Every time we are about to hit RC status, QA find a new showstopper that forces us to perform another build. This I believe is due to a mixture of undirected feature creep/poor project planning, the codebase having reached critical mass, and understaffing. In fairness to QA, they are punching well above their weight in terms of the thoroughness with which they test our code. Given that there are only two of them, they apply due diligence at all stages of testing.

    There was no official spec for our current project; each developer was just emailed individually with the details of the features assigned to them. No group meetings between development (the people who know the codebase) and management (the people who don't) to discuss the feasibility and implications of changes needed for new features. Mind you, requirements were not set in stone either - they are big fans of "verbally speccing" new features i.e. just sitting down and firing ideas back and forth and going "yeah, let's change that, that sounds good". I worked late nights for weeks on end, and the process became increasingly annoying as when I got so far, repeatedly mgmt would pull the rug out from underneath my feet and say "hmmmmm, maybe we were on the wrong path here - let's change X to do Y instead." This makes the late nights feel like a waste of time, and it feels like trying to shoot a moving target while blindfolded. Your code is destined to deteriorate too as deadlines loom and you're subjecting it to rewrite after rewrite.

    It's a totally ad-hoc, trial-and-error implementation methodology. I know requirements gathering is hard, but hell we have dedicated sales and support teams, they KNOW what customers want to a degree that a formal spec can be delivered, mgmt don't seem to listen to them enough though.

    A great example was last week, when we were about to go RC, and our CEO comes over to our development team lead and suggests a new feature - while we're testing to go RC. The mental thing is, they put it in. So we're writing new code while testing what is supposedly a finished product. That flies in the face of everything I know about sound development methodologies. No cut-off point for new code, just fling it in there. Because our codebase is at critical mass, inevitably those changes create more bugs, which may take another couple of build-QA iterations to fix.


    Anyway, rant over - I needed to get that out of my system. Does anyone have any comment on or had to similar experiences to what I've described?


  • Registered Users Posts: 1,529 ✭✭✭zynaps


    dropstar wrote: »
    A great example was last week, when we were about to go RC, and our CEO comes over to our development team lead and suggests a new feature - while we're testing to go RC. The mental thing is, they put it in. So we're writing new code while testing what is supposedly a finished product.
    Argh! I would go nuts at the team lead for doing this and pretty much derailing the development/release process. He/she should have said "no, but we can add it to the list for the next release", unless it was absolutely critical (in which case, why didn't the team know about it weeks/months ago?).

    If middle/upper management are going to constantly move the goalposts and literally waste hours or days of your time, nobody should be putting in overtime - because the mess can continue for an unbounded length of time and unbounded overtime = major stress, major demotivation and even relationship and health problems.

    I hope things turn around or people start saying "no" to unreasonable requests a bit more often!


  • Advertisement
  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    I've seen all that and then it all mirrored on the database with DBA's on MS SQL or Oracle. I'd have to agree that saying no, is the solution. But too often its one specific manager that can't no and won't stop developing and start managing.

    I was asked recently how we could get out of a similar firefighting rut. The only answer I could think was to stop all development. Because it was just causing more work rather than reducing it. Especially certain people who just broke every rule in the book with every line of code. Causing two bugs for everyone they fixed.

    So I'd qualify that, stop all development except development that reduces the workload. But it has to have metrics on it, that are measurable.


  • Registered Users Posts: 7,182 ✭✭✭Genghiz Cohen


    Gentlemen,
    I come to you as your king.
    This code crashes with an exception. (message sent to dealloc'd instance)
    Brought to you in part, by Objective-C.
    	//checkIData is an NSMutableArray alloc'd elsewhere
    	if (checkIData != nil) 
    	{
    		@try
    		{
    			NSLog(@"RC: %i",[checkIData retainCount]);//I crash here!
    			[checkIData release];
    			
    		}
    		@catch (id e) {
    			//wtf!
    			int i = 0;
    		}
    	}
    
    Srsly, if anyone knows what's up with an 'if' check and a 'try' block failing, let me know.


  • Registered Users Posts: 1,529 ✭✭✭zynaps


    Gentlemen,
    I come to you as your king.
    This code crashes with an exception. (message sent to dealloc'd instance)
    I don't know Obj-C, but could checkIData not have been deallocated (or never initialised), so it would pass the not-nil check and then crash?
    Or is the wtf that it's uncaught?


  • Registered Users Posts: 5,618 ✭✭✭Civilian_Target


    Ooof - I was adding some new features to old code the other day (in java), and I came across an entire class, implementing an interface, defined.... in a method call!

    I mean, you can, but WHY?!


  • Registered Users Posts: 16,402 ✭✭✭✭Trojan


    dropstar wrote: »
    I'm a software developer for a small company. I've been working here for about 18 months, and it's only now that some of the flaws in the way we do things have become apparent... Does anyone have any comment on or had to similar experiences to what I've described?

    Polish up the CV and move before you get tainted so badly by the experience that you become a poor software developer by osmosis.

    I'm surprise the company is still in business, but then again the sales guys might be world class (Oracle in the 80s/90s).


  • Advertisement
  • Registered Users Posts: 16,402 ✭✭✭✭Trojan


    Ooof - I was adding some new features to old code the other day (in java), and I came across an entire class, implementing an interface, defined.... in a method call!

    I mean, you can, but WHY?!

    Years ago I remember seeing UNIX implemented in 2 LOC (a while and a for loop), can't find it on a quick search but it was an interesting demonstration.


  • Closed Accounts Posts: 2,930 ✭✭✭COYW


    Trojan wrote: »
    Polish up the CV and move before you get tainted so badly by the experience that you become a poor software developer by osmosis.

    I'm surprise the company is still in business, but then again the sales guys might be world class (Oracle in the 80s/90s).

    I agree in relation to the OP. Educate yourself in your own time and get up to speed with the latest technologies while you have get your CV out and about. I too have come to breaking point with my current company.


  • Registered Users Posts: 1,235 ✭✭✭Odaise Gaelach


    I worked for one semester as an assistant demonstrator in a computer lab for a university.

    The students were learning data structures in Java, so almost everyone was using BlueJ or Net Beans. Except for this one guy who insisted on writing everything in Notepad and compiling it in the command prompt. Every second line was a system.out.println() call.

    I asked him why he wasn't using a proper IDE. He said that when he starts work for a company he would have to learn another IDE. Then he asked me for help to see why his code wasn't working. The bloody stuff was impossible to read with no indentations and '{' brackets all over the place.

    The first thing he asked my help for was a compiler error. Notepad, of course, doesn't have line numbers so I had to count down the lines until I came to the right one. A few minutes later he asked for my help again since his code was throwing an Exception. I ran it two or three times, gave up and told him to use an actual IDE with a debugger. I don't think he was that impressed. :)


  • Registered Users Posts: 1,529 ✭✭✭zynaps


    The first thing he asked my help for was a compiler error. Notepad, of course, doesn't have line numbers so I had to count down the lines until I came to the right one. A few minutes later he asked for my help again since his code was throwing an Exception. I ran it two or three times, gave up and told him to use an actual IDE with a debugger. I don't think he was that impressed. :)
    Actually... Notepad does have a "Goto line" function if you turn word wrap off.

    But yeah, from similar lab tutoring work I noticed a very strong correlation between people who used IDEs (even EditPlus or another decent editor, and batch scripts and other simple tools) passing and those who insisted on using Notepad not passing. It might actually be an interesting study...

    If I was lecturing a programming course, I'd probably mandate the use of a text editor and command prompt only for the first lab or two, then the use of an IDE (almost any one) for all subsequent labs.


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    They should be taught to use an IDE with some source control.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 90,537 Mod ✭✭✭✭Capt'n Midnight


    I thought you were supposed to learn the basics in a text editor without syntax highlighting so you would learn it better.

    Still gedit or notepad2 might sort out a lot of basic stuff before they start on an IDE


  • Registered Users Posts: 856 ✭✭✭firefly08


    Emacs

    Only text editor/IDE you'll ever need.


  • Registered Users Posts: 16,402 ✭✭✭✭Trojan


    firefly08 wrote: »
    Emacs

    Only text editor/IDE you'll ever need.

    "emacs is a great operating system, but lacks a decent text editor"


  • Registered Users Posts: 8,219 ✭✭✭Calina


    I thought you were supposed to learn the basics in a text editor without syntax highlighting so you would learn it better.

    Still gedit or notepad2 might sort out a lot of basic stuff before they start on an IDE

    We learned on notepad initially, recommended move to Editplus shortly afterwards. This was about 7 years ago mind. Shortly after that I discovered Eclipse and Netbeans. Then I stopped writing anything more modern than assembler.

    Looking at dusting off the Java and downloaded Eclipse and Netbeans. Get the impression that while Eclipse was the star the last time I was looking at it, Netbeans appears to better now.

    While I can understand the need to learn how to write code down at the coalface, I can't understand why people don't format their code properly, even in Notepad. At least then you see if there is any reasonable structure to it.


  • Closed Accounts Posts: 8,200 ✭✭✭G-Money


    Perl. I hate it.

    It is very hard to read and some of the code editors add in full stops instead of spaces/tabs so sometimes I can't tell if I'm looking at a tab/space or specially written code (I think Perl uses a full stop to concatenate strings just to confuse matters).

    Also annoying to be working in a development environment that I don't understand with perl modules all over the place and no good test environment with which to test my changes.

    A massively, massively frustrating experience.


  • Advertisement
  • Registered Users Posts: 558 ✭✭✭wobbles-grogan


    Perl. I hate it.

    It is very hard to read and some of the code editors add in full stops instead of spaces/tabs so sometimes I can't tell if I'm looking at a tab/space or specially written code (I think Perl uses a full stop to concatenate strings just to confuse matters).

    Also annoying to be working in a development environment that I don't understand with perl modules all over the place and no good test environment with which to test my changes.

    A massively, massively frustrating experience.

    You should probably tell your boss you dont understand the environment properly and to get someone to show you the works.

    He'll probably like you a lot more for asking than he would when you make a breaking change :-)


  • Registered Users Posts: 2,534 ✭✭✭FruitLover


    You should probably tell your boss you dont understand the environment properly and to get someone to show you the works.

    Sounds like you've never been involved in a Perl team :rolleyes:


  • Closed Accounts Posts: 8,200 ✭✭✭G-Money


    FruitLover wrote: »
    Sounds like you've never been involved in a Perl team :rolleyes:

    This is ironically not far off the truth I think.


  • Registered Users Posts: 1,109 ✭✭✭Skrynesaver


    Perl. I hate it.
    Then use a different language
    It is very hard to read
    Only if the person writing it doesn't write clearly, any language can suffer from obfuscation
    and some of the code editors add in full stops instead of spaces/tabs so sometimes I can't tell if I'm looking at a tab/space or specially written code (I think Perl uses a full stop to concatenate strings just to confuse matters).
    Don't show non printing characters, should be a configurable setting in most editors
    Also annoying to be working in a development environment that I don't understand
    that could be the issue alright
    with perl modules all over the place
    There are core modules that are part of the standard distribution and additional modules that can be added via CPAN, these additional modules can be packaged with the code you are writing for distribution.
    and no good test environment with which to test my changes.
    Test::More is a core module, try
    perldoc Test::More
    
    A massively, massively frustrating experience.

    Sorry to hear that, but it sounds as though you were dropped into a dev environment that you are unprepared for, I would ask for training if I were you.

    I work in a Perl environment and love it myself, can't stand that Java muck though but that might be because I haven't used it as much as I have Perl


  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    Only if the person writing it doesn't write clearly, any language can suffer from obfuscation
    While that's completely true, it's also completely true that Perl suffers from write-only coding a lot more than other languages.
    Sorry to hear that, but it sounds as though you were dropped into a dev environment that you are unprepared for, I would ask for training if I were you.
    +1
    You can't be expected to operate in a custom dev environment that doesn't exist outside of your company without some degree of training!


  • Registered Users Posts: 1,109 ✭✭✭Skrynesaver


    Sparks wrote: »
    While that's completely true, it's also completely true that Perl suffers from write-only coding a lot more than other languages.

    This is true, however if some one commits an illegible ragbag of fancy tricks I will rip the face off them and tell them to take it to an entertainment forum.

    You can write code that is legible in Perl, there are some aspects of the current default operand and special variables that can reduce your typing time by 5 minutes and add days to each iteration of maintenance so write explicit code and "use English" (a little module that is one of the core modules) which allows you refer to the current line number of the file open for input as $INPUT_LINE_NUMBER as opposed to $.


  • Registered Users Posts: 14,715 ✭✭✭✭Earthhorse


    Joseph... wrote: »
    dont bring troubles
    Joseph... wrote: »
    *trouble

    Thanks for the pointer.


  • Registered Users Posts: 1,657 ✭✭✭komodosp


    I'm sick of code that's not properly indented! FFS, D********r has the ability to indent a block of code at a time so you've no excuses

    And maybe there's something I don't get here, but why have a <?php .... ?> on every line of php code? It makes it very hard to read and edit - just have a <?php at the start and ?> at the end of the block of code.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    komodosp wrote: »
    I'm sick of code that's not properly indented! FFS, D********r has the ability to indent a block of code at a time so you've no excuses

    And maybe there's something I don't get here, but why have a <?php .... ?> on every line of php code? It makes it very hard to read and edit - just have a <?php at the start and ?> at the end of the block of code.

    Of all things to rage about :rolleyes: You realise most editors will just let you hit ctrl+I or whatever to autoindent everything? Stop using notepad ffs.

    Also perl is terrible and only good for writing hacky scripts. There is no such thing as a perl programmer, just jumped-up sysadmins.


  • Advertisement
  • Registered Users Posts: 3,992 ✭✭✭Korvanica


    WHY CANT PEOPLE COMMENT CODE!

    F**K SAKE...

    started a new job a while ago, NONE of the code is commented.... 80k lines of code? Lovely thanks for that...


Advertisement