Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Programming question

Programming question

Scheduled Pinned Locked Moved The Lounge
question
79 Posts 50 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Slacker007

    If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

    Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
    "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

    J Offline
    J Offline
    jesseseger
    wrote on last edited by
    #69

    If he were a good senior dev, wouldn't he subscribe to the the lounge and see all this ramblings about him??

    1 Reply Last reply
    0
    • S Slacker007

      If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

      Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
      "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

      P Offline
      P Offline
      patbob
      wrote on last edited by
      #70

      If the code is one time use, won't be checked in, nobody else will ever see it, and there's no chance you'll ever have to go back into it to make any changes, then yeah, toss all the good practices that don't help you get it done quickly. I've yet to find any work code that has ever met any of those qualities. Only code for my own personal projects sometimes meets all those criteria, and even then, sometimes I've been wrong.

      We can program with only 1's, but if all you've got are zeros, you've got nothing.

      1 Reply Last reply
      0
      • S Slacker007

        If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

        Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
        "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

        J Offline
        J Offline
        jelamid
        wrote on last edited by
        #71

        Always. The next programmer to look at it will be yourself. Why make that future self curse you?

        1 Reply Last reply
        0
        • S Slacker007

          If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

          Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
          "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

          S Offline
          S Offline
          SeattleC
          wrote on last edited by
          #72

          "Best Practices" are called that for a reason; they make your job easier. If you don't think so, then you aren't sufficiently experienced. I always follow best practices because I'm done in fewer hours when I do.

          1 Reply Last reply
          0
          • N Nagy Vilmos

            For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.


            Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

            D Offline
            D Offline
            devenneym
            wrote on last edited by
            #73

            Nagy Vilmos wrote:

            For God's sake, do it right!
             
            I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone.

            So true! I watched something that we started to call the "revolving iterative prototype" slip into production under the radar and then suddenly the business unit using it (yep, real users, not tech savvy IT types who might be understanding if something was a little shaky). The users wanted to start adding features, requesting bug fixes and after a year or so made a formal request to expand it to a suite of applications. :omg: When I left the company some 7 years later some parts of the expanded suite were still in use. I was the last developer in the company who was there when it was born and, luckily, managed to put a good bit of distance between myself and the suite in that time.

            Mike Devenney

            1 Reply Last reply
            0
            • S Slacker007

              If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

              Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
              "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

              S Offline
              S Offline
              Spectre_001
              wrote on last edited by
              #74

              By the tone of the question, I'm assuming that the senior dev has asked you to throw together something quick and dirty to get a specific job done. Under the right conditions, that may be ok. If it is a run-once tool to correct/convert something in persistant storage (example - you have been storing some text data, say xml, in a VARCHAR(MAX) column of a table in the database and need to start compressing the data and storing the compressed byte array in a new IMAGE column to save drive space. Converting the existing entries would be a good job for a one-off run-once tool). It's ok to write something like this without adhearing to all of the "best practices" as long as it runs once and gets the job done correctly. Data import from a legacy application to a new one is another example. However, if it is something that is to be a part of the system, even for a short while, you are right to want to make it as stable and maintainable as is allowed under whatever time constraints you have. That being said, I don't know the office politics climate where you work. If your senior developer is a real tyrant and has the ear of management, there is no need to argue or stress over it, just do it and move on. If he is open to ideas and suggestions, voice your concerns, and once you have, follow whatever decision he comes up with. The reality is that, in the end, you are there to do a job. I recognize and applaud your passion for doing it right, but until you are the one in the position to make those decisions, I'm afraid you're going to be stuck doing as you're told (sometimes called "paying your dues"). As distasteful as it may sometimes seem, you don't need to let that passion die, but you may need to occasionally rein it in a bit, and get the job done.

              Kevin Rucker, Application Programmer QSS Group, Inc. United States Coast Guard OSC Kevin.D.Rucker@uscg.mil "Programming is an art form that fights back." -- Chad Hower

              1 Reply Last reply
              0
              • N Nagy Vilmos

                For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.


                Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                M Offline
                M Offline
                Member 4608898
                wrote on last edited by
                #75

                If you've never had to maintain code, you'll never know the problem when people don't do things properly. I maintain legacy coding and I have to look at everything - even stuff that people think nobody looks at. Code is read more often than it is written so anything that helps the reader understand the code is important. You never know, the person reading your code may be your future employee or employer. They know what your coding is like. Would they trust what you say when they know how you code? They may think Good analyst but can't code to save his life!.

                S 1 Reply Last reply
                0
                • C Corporal Agarn

                  Had a guy who loved classes so much everything was a class. We canned his code when he was asked to make a change and he could not decipher his "classes". Every variable had a class! By the way there were no comments.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #76

                  Yeah, classes are supposed to aid clarity, not obfuscate.

                  ============================== Nothing to say.

                  1 Reply Last reply
                  0
                  • M Member 4608898

                    If you've never had to maintain code, you'll never know the problem when people don't do things properly. I maintain legacy coding and I have to look at everything - even stuff that people think nobody looks at. Code is read more often than it is written so anything that helps the reader understand the code is important. You never know, the person reading your code may be your future employee or employer. They know what your coding is like. Would they trust what you say when they know how you code? They may think Good analyst but can't code to save his life!.

                    S Offline
                    S Offline
                    StarNamer work
                    wrote on last edited by
                    #77

                    Member 4608898 wrote:

                    You never know, the person reading your code may be you!r future employee or employer.

                    FTFY

                    1 Reply Last reply
                    0
                    • N Nagy Vilmos

                      For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.


                      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                      I Offline
                      I Offline
                      ilovecashmere
                      wrote on last edited by
                      #78

                      Agreed

                      1 Reply Last reply
                      0
                      • S Slacker007

                        If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.

                        Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
                        "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

                        I Offline
                        I Offline
                        ilovecashmere
                        wrote on last edited by
                        #79

                        Even in my most complex and hacky code I still use clear flow descriptions. an example in c#:

                        public class CustomerDataService
                        {
                        public Report GetReports()
                        {
                        var IDs = LoadCustomerIDsForProcessing();

                          var Data = LoadRelatedDataForCustomers(IDs);
                        
                          return = RunReport(ProcessCustomers(IDs,Data));
                        

                        }
                        //... Other methods and junk
                        //
                        //also humor is always good to leave behind in code.
                        //especially if you've had a few drinks.
                        }

                        So then all my functionality at least can be explained to the developer that is trying to figure it out. I do make it a point to use implicit variables as It doesn't matter here. All that matters is what we are getting and what "black box" of code it's coming from.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups