Programming style
Upcoming SlideShare
Loading in...5

Programming style



Evry one have personal workshop. Everything what is part of them.

Evry one have personal workshop. Everything what is part of them.



Total Views
Views on SlideShare
Embed Views



1 Embed 20 20



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Programming style Programming style Presentation Transcript

  • Programming StyleDesign Patterns +Library +Community =Framework
  • IntroductionConceptions
  • You can not be an individualist
  • Code Style● camelCase getName, setName, init, ....● PascalCase (UpperCamelCase) GetName, SetName, Init, ....● Hungarian Notation bBusy, chInitial, fnFunction, ...
  • Design PatternsGolden Rules
  • DRYIn software engineering, Dont RepeatYourself (DRY) or Duplication is Evil (DIE) is aprinciple of software development
  • DRY (Programmers Story #1)Hi.I am Tom. I am writing my backend with PHPand frontend with html5 and JS. Now I amwriting forms of my web shop. I am writingfrontend validator with js and backendvalidation with php....//Say no to Tom
  • KISSKISS is an acronym for the design principle"Keep it simple, Stupid!".
  • KISS (fuck logic #1)#define true falseif(true==false){ cout<<"OK";}else{ cout<<"NO";}
  • KISS (fuck logic #2)try { return true;} finally { return false;}//Return??
  • KISS (fuck logic #3)<?phpvar_dump(NULL < -50); // TRUEvar_dump(NULL < 0); // FALSEvar_dump(FALSE < TRUE); // TRUEvar_dump(FALSE < FALSE); // FALSE
  • Design PatternsOOP
  • SOLIDThe principles when applied together intendsto make it more likely that a programmer willcreate a system that is easy to maintain andextend over time.PS. SOLID (Single responsibility, Open-closed,Liskov substitution, Interface segregation andDependency inversion) - WTF Name??
  • SRP (Single responsibility principle)class RestaurantAndFirstShopOnTheLeft { //Restaurant int waiter_age; char[] waiter_name; float pizzaCost; //Shop float itemsCost;}
  • OCP (Open/closed principle)“software entities … should be open forextension, but closed for modification”.final class HashMap{...} //??final class ArrayList{...} //??final public getItem(...){...} //??
  • LSP (Liskov substitution principle)“objects in a program should be replaceablewith instances of their subtypes withoutaltering the correctness of that program”Object o = new ArrayList();
  • ISP (Interface segregation principle)“many client-specific interfaces are betterthan one general-purpose interface.”class Restaurant : Building { //...}
  • DIP (Dependency inversion principle)@Statelessclass Users{ @PersistenceContext private EntityManager entityManager; //...}
  • Design PatternsApplication
  • MVCModel–view–controller (MVC) is a softwarearchitecture pattern which separates therepresentation of information from the usersinteraction with it.
  • MVC Example: ZendFramework
  • MVP (First View)Model–view–presenter (MVP) is a derivative ofthe model–view–controller (MVC) softwarepattern, also used mostly for building userinterfaces.
  • MVP Example - Java Server Face
  • MVP - form<h:form> <h:outputText value="Enter your name: " /></td> <h:inputText value="#{StoreNameBean.personName}" /> <h:commandButton action="result" value="Say Hello" /></h:form>
  • LibraryOverview
  • LibraryA collection of standard programs andsubroutines that are stored and available forimmediate use.
  • Library - Examples:● C++ (Standard Template Library)● OGRE● jQuery● Allegroand many more...
  • Library Or FrameworkBut my ankle use ZendFrameworkas Library...Do you think Java Platform API is a library??
  • Communitysupport
  • WP7 & Google MapAdobe - Phonegap group:!topic/phonegap/WVb3nvP0WVAGoogle - Community:
  • Google Search Engine & DynamicContentGDG Dublin Group:!topic/gdg-dublin/KfmwVgbRY68+ Private Messages
  • Thank you for attendingsebastian@pozoga.euevents.pozoga.euLinkedIn
  • Sources● http://www.thefreedictionary. com/program+library●● http://en.wikipedia. org/wiki/Software_design_pattern● Clean Code: A Handbook of Agile Software Craftsmanship● The Pragmatic Programmer: From Journeyman to Master