SlideShare uma empresa Scribd logo
1 de 14
Art of Writing Small Code
                Sumit Misra
          General Manager
 RS Software (India) Limited
Code is developed to address a Problem Space




                                Problem Space




Learning by knowledge sharing
Code maps the Problem Plane to a Solution Plane

Higher the Solution Plane in abstraction – smaller would the
code be
                       Code

                                                 Solution Plane



                                 Problem Plane




 Learning by knowledge sharing
MASHUP CODE                 Abstraction
     LARGE GRAIN                          CODE
                                        ASSEMBLY CODE
                                    SCRIPTS
           << GRAIN >>




     ASSEMBLY CODE
      SMALL GRAIN               Problem Plane
Learning by knowledge sharing
Partitioning the Problem
            1                       2
                                          space such that the
                                          solution planes are
                                                consistent

                                                   IS

        3                       4         The prelude to the


            Problem Space
Learning by knowledge sharing
Large Code Base                                 Small Code Base


                                    Problem Plane




    1           2      3        4                   1   2           3     4




Learning by knowledge sharing
World's smallest TETRIS program - one line
                        of BBC BASIC, 256 bytes in all written by
                        Olly Betts



     0MODE9:OFF:GCOL-9:CLG:REPEATs=s+VPOS:PRINTCHR$30s:REPEATSYS6,135TOi,p,d:PRINTTAB
     (p=0)CHR$9;:IFPOS=22VDU3100;VPOS,21;6667;:UNTIL0ELSEUNTILVPOS=25:v=ABSRNDMOD7:VD
     U31:COLOUR3:REPEATm=9-INKEY(INKEYTRUEOR6)MOD3:FORr=TRUETO1:t=rANDSGNt:IFt=rCOLOU
     Rv-15:VDUrEORm:i+=m=7AND9-6*r:IF0ELSEFORn=0TO11:d=nDIV3OR2EORd:VDUd:IF1<<(n+i)MO
     D12AND&C2590ECDIV8^vAND975t+=POINT(p*POS,31-VPOS<<5):IFrVDUp,8:IF0ELSENEXT,:VDU2
     0:UNTILt*LOGm:UNTILVPOS=3:Z




             Is this the type of small code we want to write ?


Learning by knowledge sharing
High




                                          Meta Language (Haxe/Neko)
                       Web Programming Language (Dart – Google)

                       Distributed / Meta Program / Reflection
  Abstraction




                                           Internet / RAD

                                 Internet / Web

                        Object Oriented

                                  Structured Programs
  Low




                1950   1960    1970   1980       1990       2000   2010   >>


Learning by knowledge sharing
Problem Plane is Expanding

                                Web Services
                                                          Solution Plane


                                               Internet
                                Web Services




                                Web Services




Learning by knowledge sharing
Mobile Service


   LOCATION

                                             Web Services

    EMAIL
                                                     Smart
                                Internet /           Mobile    User Experience
                                  Web /
                                  Cloud
  APPLICATION                                GPS                CODE
                                             Gyro-meter         (HTML5)
                                             Magnetometer
    SOC IAL
                                             Pyrometer
   NETWORK                                   Light Sensor
                                             Face Detector
                                             Fingerprint Det
                                             … more …

Learning by knowledge sharing
Source: online.wsj.com



Learning by knowledge sharing
Stop Watch program



                  20 lines    HTML/Java Script


                   25 lines
User Experience




                                   Windows 7 Phone


                        43 lines          Java / AWT


                                           120 lines   Windows / C++




Learning by knowledge sharing
SMALL CODE would need
  BETTER DESIGN and
  GOOD KNOWLEDGE of the
  available frameworks and
  services

 “ I'm sorry for the long letter, my dear, but I did not have
 time to make it short. “ – Winston Churchill

Learning by knowledge sharing
Thank you


                       sumit@rssoftware.co.in

Learning by knowledge sharing

Mais conteúdo relacionado

Semelhante a Art of Writing Small Code by Sumit misra

Brokerage 2007 presentation multimedia
Brokerage 2007 presentation multimediaBrokerage 2007 presentation multimedia
Brokerage 2007 presentation multimedia
imec.archive
 
Alpha script George Delaportas
Alpha script George DelaportasAlpha script George Delaportas
Alpha script George Delaportas
Ignite_Athens
 
ALPHA Script - Ignite Athens 2012
ALPHA Script - Ignite Athens 2012ALPHA Script - Ignite Athens 2012
ALPHA Script - Ignite Athens 2012
PROBOTEK
 
Presenter manual android development (specially for summer interns)
Presenter manual   android development (specially for summer interns)Presenter manual   android development (specially for summer interns)
Presenter manual android development (specially for summer interns)
XPERT INFOTECH
 
Shape 2013 developing multi targeting windows store and windows phone apps
Shape 2013   developing multi targeting windows store and windows phone appsShape 2013   developing multi targeting windows store and windows phone apps
Shape 2013 developing multi targeting windows store and windows phone apps
Jose Luis Latorre Millas
 
Cisco Presentation 1
Cisco Presentation 1Cisco Presentation 1
Cisco Presentation 1
changcai
 

Semelhante a Art of Writing Small Code by Sumit misra (20)

Embracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codeEmbracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler code
 
Kamaelia lightning2010opensource
Kamaelia lightning2010opensourceKamaelia lightning2010opensource
Kamaelia lightning2010opensource
 
Lsms SUPSI DTI ISIN
Lsms SUPSI DTI ISINLsms SUPSI DTI ISIN
Lsms SUPSI DTI ISIN
 
3-Way Scripts as a Base Unit for Flexible Scale-Out Code
3-Way Scripts as a Base Unit for Flexible Scale-Out Code3-Way Scripts as a Base Unit for Flexible Scale-Out Code
3-Way Scripts as a Base Unit for Flexible Scale-Out Code
 
AR
ARAR
AR
 
Device+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesseDevice+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesse
 
IoT Week 2022-NGIoT session_Micha vor dem Berge presentation
IoT Week 2022-NGIoT session_Micha vor dem Berge presentationIoT Week 2022-NGIoT session_Micha vor dem Berge presentation
IoT Week 2022-NGIoT session_Micha vor dem Berge presentation
 
microsoft windows phone for government and citizens
microsoft  windows phone for government and citizensmicrosoft  windows phone for government and citizens
microsoft windows phone for government and citizens
 
Brokerage 2007 presentation multimedia
Brokerage 2007 presentation multimediaBrokerage 2007 presentation multimedia
Brokerage 2007 presentation multimedia
 
Distributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson LabsDistributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson Labs
 
Alpha script George Delaportas
Alpha script George DelaportasAlpha script George Delaportas
Alpha script George Delaportas
 
ALPHA Script - Ignite Athens 2012
ALPHA Script - Ignite Athens 2012ALPHA Script - Ignite Athens 2012
ALPHA Script - Ignite Athens 2012
 
Presenter manual android development (specially for summer interns)
Presenter manual   android development (specially for summer interns)Presenter manual   android development (specially for summer interns)
Presenter manual android development (specially for summer interns)
 
Developing i phone, android and windows phone 7 applications with c#
Developing i phone, android and windows phone 7 applications with c#Developing i phone, android and windows phone 7 applications with c#
Developing i phone, android and windows phone 7 applications with c#
 
Shape 2013 developing multi targeting windows store and windows phone apps
Shape 2013   developing multi targeting windows store and windows phone appsShape 2013   developing multi targeting windows store and windows phone apps
Shape 2013 developing multi targeting windows store and windows phone apps
 
Blackberrymobile Application Development Casestudy
Blackberrymobile Application Development CasestudyBlackberrymobile Application Development Casestudy
Blackberrymobile Application Development Casestudy
 
100108 Cloud Age Kawauso
100108 Cloud Age Kawauso100108 Cloud Age Kawauso
100108 Cloud Age Kawauso
 
100108 Cloud Age Kawauso
100108 Cloud Age Kawauso100108 Cloud Age Kawauso
100108 Cloud Age Kawauso
 
100108 Cloud Age Kawauso
100108 Cloud Age Kawauso100108 Cloud Age Kawauso
100108 Cloud Age Kawauso
 
Cisco Presentation 1
Cisco Presentation 1Cisco Presentation 1
Cisco Presentation 1
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Art of Writing Small Code by Sumit misra

  • 1. Art of Writing Small Code Sumit Misra General Manager RS Software (India) Limited
  • 2. Code is developed to address a Problem Space Problem Space Learning by knowledge sharing
  • 3. Code maps the Problem Plane to a Solution Plane Higher the Solution Plane in abstraction – smaller would the code be Code Solution Plane Problem Plane Learning by knowledge sharing
  • 4. MASHUP CODE Abstraction LARGE GRAIN CODE ASSEMBLY CODE SCRIPTS << GRAIN >> ASSEMBLY CODE SMALL GRAIN Problem Plane Learning by knowledge sharing
  • 5. Partitioning the Problem 1 2 space such that the solution planes are consistent IS 3 4 The prelude to the Problem Space Learning by knowledge sharing
  • 6. Large Code Base Small Code Base Problem Plane 1 2 3 4 1 2 3 4 Learning by knowledge sharing
  • 7. World's smallest TETRIS program - one line of BBC BASIC, 256 bytes in all written by Olly Betts 0MODE9:OFF:GCOL-9:CLG:REPEATs=s+VPOS:PRINTCHR$30s:REPEATSYS6,135TOi,p,d:PRINTTAB (p=0)CHR$9;:IFPOS=22VDU3100;VPOS,21;6667;:UNTIL0ELSEUNTILVPOS=25:v=ABSRNDMOD7:VD U31:COLOUR3:REPEATm=9-INKEY(INKEYTRUEOR6)MOD3:FORr=TRUETO1:t=rANDSGNt:IFt=rCOLOU Rv-15:VDUrEORm:i+=m=7AND9-6*r:IF0ELSEFORn=0TO11:d=nDIV3OR2EORd:VDUd:IF1<<(n+i)MO D12AND&C2590ECDIV8^vAND975t+=POINT(p*POS,31-VPOS<<5):IFrVDUp,8:IF0ELSENEXT,:VDU2 0:UNTILt*LOGm:UNTILVPOS=3:Z Is this the type of small code we want to write ? Learning by knowledge sharing
  • 8. High Meta Language (Haxe/Neko) Web Programming Language (Dart – Google) Distributed / Meta Program / Reflection Abstraction Internet / RAD Internet / Web Object Oriented Structured Programs Low 1950 1960 1970 1980 1990 2000 2010 >> Learning by knowledge sharing
  • 9. Problem Plane is Expanding Web Services Solution Plane Internet Web Services Web Services Learning by knowledge sharing
  • 10. Mobile Service LOCATION Web Services EMAIL Smart Internet / Mobile User Experience Web / Cloud APPLICATION GPS CODE Gyro-meter (HTML5) Magnetometer SOC IAL Pyrometer NETWORK Light Sensor Face Detector Fingerprint Det … more … Learning by knowledge sharing
  • 12. Stop Watch program 20 lines HTML/Java Script 25 lines User Experience Windows 7 Phone 43 lines Java / AWT 120 lines Windows / C++ Learning by knowledge sharing
  • 13. SMALL CODE would need BETTER DESIGN and GOOD KNOWLEDGE of the available frameworks and services “ I'm sorry for the long letter, my dear, but I did not have time to make it short. “ – Winston Churchill Learning by knowledge sharing
  • 14. Thank you sumit@rssoftware.co.in Learning by knowledge sharing

Notas do Editor

  1. Stopwatch programHTML/JavaScript: 20 linesWindows 7 Phone : 25 linesJava AWT: 43 linesWindows C++: 120 lines