Advertisement
How to add spoiler tags, edit posts, add images etc. How to - a user's guide to the new version of Boards
Mods please check the Moderators Group for an important update on Mod tools. If you do not have access to the group, please PM Niamh. Thanks!

Coding Horror

1356736

Comments



  • 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 >_>




  • 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".




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




  • 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?




  • 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


  • 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.




  • 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.




  • 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?




  • 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?!




  • 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


  • 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.




  • 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.




  • 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. :)




  • 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.




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




  • 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




  • Emacs

    Only text editor/IDE you'll ever need.




  • firefly08 wrote: »
    Emacs

    Only text editor/IDE you'll ever need.

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




  • 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.




  • 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


  • 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 :-)




  • 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:




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

    This is ironically not far off the truth I think.




  • 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




  • 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!




  • 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 $.




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

    Thanks for the pointer.




  • 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.




  • 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


  • 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