Successfully reported this slideshow.
Your SlideShare is downloading. ×

Engineering Highly Maintainable Code: Maintain or Innovate

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 26 Ad

Engineering Highly Maintainable Code: Maintain or Innovate

How long does it take your company to implement a new feature? Fix a bug? Ramp up a new developer? To re-write your code every five to ten years because it turns into spaghetti? At the end of the day, developers can do one of two things: maintain or innovate. In this session, Steve will dive in to code and show you tips, tricks, techniques, and real-world examples to help you better engineer highly maintainable code, keep your software relevant, reduce development costs, increase developer job satisfaction, and stay innovative.

How long does it take your company to implement a new feature? Fix a bug? Ramp up a new developer? To re-write your code every five to ten years because it turns into spaghetti? At the end of the day, developers can do one of two things: maintain or innovate. In this session, Steve will dive in to code and show you tips, tricks, techniques, and real-world examples to help you better engineer highly maintainable code, keep your software relevant, reduce development costs, increase developer job satisfaction, and stay innovative.

Advertisement
Advertisement

More Related Content

Similar to Engineering Highly Maintainable Code: Maintain or Innovate (20)

Recently uploaded (20)

Advertisement

Engineering Highly Maintainable Code: Maintain or Innovate

  1. 1. Engineering Highly Maintainable Code Steve Andrews steve@platinumbay.com
  2. 2. Speaker Profile Steve ANDREWS Founder/Executive Director Platinum Bay Technologies Software Architect with 16 Years Experience Four-Time Microsoft MVP Award Recipient Microsoft Alumni Speaker at Over 120 Technology Events Microsoft and IBM Certifications Non-Profit Board Experience (x3) Autism Advocate Experience Dedicated to applying his talents and experience in the technology sector along with his personal knowledge of life on the Autism Spectrum and prior business experience to create a program with an empowering environment where ASD individuals can find their own personal success. Short Biography
  3. 3. Platinum Bay Technologies Expert People. Expert Solutions. Social Good. www.platinumbay.com
  4. 4. What is Maintainability? Keeping in good condition and working order by testing it, fixing it, and updating it regularly.
  5. 5. Why Maintainability? The cost to maintain today is significantly less than the cost to maintain tomorrow.
  6. 6. Maintenance Costs Distance 1 hour 1 day 1 week 1 month 6 months 1 year Effort 1 minute 5 minutes 25 minutes 2 hours 10.5 hours 52 hours Cost $1.67 $8.33 $41.67 $208.33 $1,041.67 $5,208.33 Calculating long-term code cost with interest.
  7. 7. How Maintainability? Using process and rigor to reduce long-term code cost.
  8. 8. Developer Ramp-Up
  9. 9. Organizing Code
  10. 10. Naming Things Private m_nOrhID As Int32 = 0 Public Property objDataSet() As System.Data.DataSet Private Function CreateCciName(ByVal nCctID As Int32, ByVal sCciCardNumber As String) As String Dim nZlgLanguageID As Int32 = m_oData.nZlgLanguageID Private Function FindUserOrgID(ByVal nUserID As Int32) As Int32 v_raw_array = Split(v_raw_data, Environment.NewLine)
  11. 11. Spelling Things m_nTruckingRevenu = m_oData.objOrderData.nLineHaulRevenue ' Build stirng to return ' Invoice is beeing generated flag Protected m_bInvoiceCration As Boolean = False ''' <summary> ''' Invoice under creation ''' </summary> Public Property bInvoiceCration() As Boolean Get bInvoiceCration = m_bInvoiceCration
  12. 12. Code Formatting With objFreightOrderHeaders .nOrhID = objOH.nID .LoadList(0) Public Sub SetShippedReportDS(ByVal nPickUpID As Int32, ByVal nLineHaulID As Int32, ByVal nDeliveryID As Int32, _ ByVal nStatusID As Short, ByVal nZorCarrierID As Int32, ByVal dFromDate As Date, _ ByVal dToDate As Date, ByVal bPrinterFriendly As Boolean, ByVal bFormatHtml As Boolean, _ ByVal sOrgAddress As String, ByVal sOrgZip As String, ByVal sOrgCity As String, _ ByVal sOrgState As String, ByVal sDestAddress As String, ByVal sDestZip As String, _ ByVal sDestCity As String, ByVal sDestState As String, ByVal nShipType As Int32)
  13. 13. Linear Code objOrderHeaders.nMaxRows = 90000 objOrderHeaders.sSpName = "dp_GetOrderRowsHistory” objOrderHeaders.LoadList(0) m_objDataSet = objOrderHeaders.objDataSet objOrderHeaders.LoadList(9000, "dp_GetOrderRowsHistory", 0) versus
  14. 14. Deleting Code ''#### Dev1 ''Dim objCarrierSettings As New Global.Zippers.Data.clsCarrierSettings(m_sConnect) ''Dim objCarrierSetting As Global.Zippers.Data.clsCarrierSetting ''objCarrierSettings.sWhere = "nZorID IN (" + m_objOrderData.sZorCarrierIDs + ")“ ''objCarrierSettings.LoadList(0) ''For i As Int32 = 1 To objCarrierSettings.Count '' objCarrierSetting = CType(objCarrierSettings.Item(i), Global.Zippers.Data.clsCarrierSetting) '' ' Email specified? '' If objCarrierSetting.sCasInternationalEmail.Length > 0 Then '' ' Send the order confirmation by e-mail to the customer '' Dim objMailSender As New Global.Zippers.Data.Misc.clsMisc(m_sConnect) '' Dim nZusInvoiceSenderID As Int32 = m_oData.Email_nZusPasswordSenderID '' objMailSender.PutMailInSendQueue(nZusInvoiceSenderID, "", 0, objCarrierSetting…. '' End If ''Next ' Completed OK
  15. 15. Single Responsibility Principle Imports System.Collections.Generic Imports System.Dynamic Imports ExpertPdf.HtmlToPdf Imports Zippers.zpprsFreight.Business Imports Zippers.RightWay_GUI Imports Zippers.Data Imports System.Text Imports System.Data.SqlClient Imports System.IO Imports System.Media Imports System.Security
  16. 16. Separation of Concerns Dim sWordCommodity As String = "Commodity“ If m_bTranslate Then sWordCommodity = Web.Functions.TranslateText("Word_Commodity", sWordCommodity) sbReturn.Append("<div class=""xqh_LabelFieldPair"">") sbReturn.Append(" <div class=""xqh_FieldLabel"">" + sWordCommodity + ":</div>") sbReturn.Append(" <div class=""xqh_Field"">" + sTruckloadCommodity + "</div>") sbReturn.Append("</div>") sbReturn.Append("")
  17. 17. TODOs and Comments ''' <summary> ''' Message ''' </summary> Public Property sMessage() As String ' Replace tag [LIST_OF_ITEMS] and [#Step2_TotalWeight#] sBody = sBody.Replace("[#Step2_TotalWeight#]", m_oData.objOrderData… sBody = sBody.Replace("[LIST_OF_ITEMS]", m_oData.objOrderData.sTruckloadCommodity…
  18. 18. Lines of Code
  19. 19. Error Messages
  20. 20. Testing Things
  21. 21. Extensibility '### Dev1. 2013-06-04. Customer1 enhancements. ' DEMO: Extensibility objOrderHeader.nOrhLTLSubType = m_oData.objOrderData.LTLSubTypeSelection
  22. 22. Languages, Tools, and Frameworks ' Return Error Message from OrderProcessTool Protected m_sErrorMessage As String = "" ''‘ <summary> ''' Error Message string ''' </summary> Public Property sErrorMessage() As String Get sErrorMessage = m_sErrorMessage End Get Set(ByVal Value As String) m_sErrorMessage = Value End Set End Property Dim sbReturn As StringBuilder = New StringBuilder()
  23. 23. Developer Knowledge and Responsibility Dim sSupportEmailAddr As String = "dev.three@zippersolutions.com"
  24. 24. Code Metrics
  25. 25. Thank You Contact us for exceptional quality work, allowing you to significantly reduce long-term development costs. How can we help you? steve@ platinumbay.com Platinum Bay Technologies Expert People. Expert Solutions. Social Good.

×