• Coding

    Namespace in PHP considered harmful

    I’ll give you a rant about PHP 5.3′s “latest” addition of namespaces. I think this is a harmful concept in PHP, a “new” feature that needs to be understood correctly before using. My short advice for all PHP developers is: DO NOT USE NAMESPACES. I’ve seen many PHP developers in our own company and customer projects, who have started to use namespaces just fort the sake that they are new, and not knowing what they are really doing. With my background as a Java developer I can give a better perspective.

    In Java there is an actual use for namespaces. Java features package visibility, which I nowadays favor over public or protected (and protected over private) because package visibility (and namespaces) can be used to create nice unit tests by putting the tested class and unit test in the same namespace. In PHP there is no package visibility, so there is no need for namespaces.

    In Java, the namespaces (packages) are a very rigid system that cannot be configured in any way. However, the greatness of PHP is that there is a very dynamic and powerful mechanism called autoloader, which can be used to configure your “namespaces” as you wish. A typical legacy way to build PHP package-like -structures was for example in ZendFramework a convention to put conceptual modules in separate directories, and have an autoloader to load the classes from the corresponding directory.

    However, now when an actual namespace is implemented in PHP core, many developers like to give it a try and start to use it everywhere. The outcome is that all good parts of PHP start to fade away. The classes start to get polluted with useless boilerplate just for the sake of having namespaces. Useless, hard-to-read and difficult to write use-statements have appeared to PHP classes from C and Java (and other legacy 3rd generation low-productivity languages). This is clearly bad at least from project management and productivity perspective.

    When you are using PHP namespaces, all changes to everything become difficult. You are also lacking IDE tools from Java that would auto-generate your “use” statements. Since there is no real benefit in using namespaces, you will just shoot yourself in your own leg by using namespaces in PHP.

    The only legitimate use of namespaces that comes in my mind is when you develop some open source, abstract, non-concrete (see http://stackoverflow.com/questions/1031135/what-is-abstractness-vs-instability-graph ) library software that would be included to your composer.json by thousands of other projects. However, if you are developing your own, concrete, non-library software for your customer or own use, all classes that you define should be in your “root namespace” and adding any other namespaces will just make you hurt. You are not probably going to offer your software publicly available to the Internet, in which case there is no need to publish a public namespace to the world, and slow your development work by adding all the boilerplate required to do so. In 99% of the cases you are doing the first, and you don’t need any namespaces for you own software.

    So, DO NOT USE NAMESPACES IN PHP, unless you know what you are doing.

     

    Published by:
  • Products

    Solution: Nokia Lumia 820 Windows Phone Outlook 2010 email sync error 800C0000

    We found out a problem with Nokia Lumia 820 and Windows Phone Outlook 2010 not syncing emails but giving error 800C0000. After some debugging we found the following solution that is now added on on our email usage instructions page:

    https://phz.fi/services/email-and-webmail-usage-instructions/

    Problem: Nokia Lumia 820 Windows Phone Outlook 2010 says error code 800C0000 while synchronizing emails.
    Solution: This problem is a bug in Windows Phone Outlook 2010 client caused by bad email content such as special characters. Other email clients can handle this situation, but Windows Phone unfortunately not. Typical problematic characters in emails might include for example:

    “ß”

    “Ä”

    The issue can be resolved by moving the offending email to some other sub-folder. Log in to webmail: https://mail.phz.fi then search for special characters not displaying properly. Select the message by clicking the check-box on the right. Use “Move” button to move the message to some other folder (such as Drafts).

    See: http://answers.microsoft.com/en-us/mobiledevices/forum/mdlumia-mdupdate/email-suddenly-not-syncing-error-code-800c0000/a106f425-d1e5-403b-9424-6ae9d3a0ba0d

    Published by:
  • Frontend Software Engineering Usability

    Call for Goal DSL

    We found out that we don’t yet know a good way to write down our Personas and their Goals in a coherent way. There is also a problem in teaching the ways of Goal Oriented User Interface Design (GUIDe) to new interaction designers.

    On the Internet other people than myself have also been considering the process how GUIDe can be

    http://blog.extremeplanner.com/2006/01/goal-driven-user-interface-design.html

    which are very similar to my thoughts about integrating GUIDe and Extreme Programming: http://pharazon.org/publications/GO-XP.pdf

    However, the Extremeplanner’s article didn’t mention any way how to describe the Personas and Goals. I think we should create a Domain Specific Language (DSL)  to make it easier to write realistic goals that leave the design (workflow) open for designer to re-invent.

    The power of Goal Driven UI Design comes from freedom to redesign the technical solution within the limits of current technological possibilities – the designer should be as open minded as possible to find out the what possibilities there are to use “teleportation”, “magic” or “zen” in creating a design that employs 0 steps to achieve the Goal.

    Published by:
  • Coding Management Software Engineering

    Jeff Sutherland on Scrum – if you follow the flight plan you will be taken down

    Video

    Jeff Sutherland explains how Scrum was originated.

    Key to the success: Make work visible

    Every morning, there’s a bullet coming at you with your project’s name on it. If you follow the plan, you will be taken down. Most of the project managers don’t get out of the way. 84% of IT projects are failures.

    In the daily meeting we need to debate what is the next item in the sprint backlog that we would implement that touch which component that would cause the biggest impact in the system that would emerge a new capability. The minimal change to push the capability forward.

    The whole team needs to know the architecture of the system and they all needs to argue about where they touch the system to systematically produce the feature in the shortest time possible.

    Conway’s Law: the culture of the organization reflects in the system architecture – you need to create an object oriented organization

    Jeff Sutherland

    Jeff Sutherland on Scrum

     

     

     

    Published by:
  • Company Strategy

    75 suomalaista it-yritystä yhdistää voimiaan – “valituksia ei ole tullut”

    “Pienet ja keskisuuret yritykset ovat viime vuosina yhdistäneet voimansa julkisissa kilpailutuksissa. 75:stä it-alan yrityksestä koostuva Atrain pärjäsi keväällä ratkenneessa Valtion hankintayksikkö Hanselin kilpailutuksessa.

    Atraimen edustajat pitävät omaa toimintamalliaan ylivoimaisena. Kyseessä on verkosto, joka on syntynyt julkisia kilpailutuksia silmällä pitäen.”

    PHZ.fi on osana Atrain-ryhmittymää. Lue koko artikkeli:

    http://www.tivi.fi/Kaikki_uutiset/75-suomalaista-it-yritysta-yhdistaa-voimiaan-valituksia-ei-ole-tullut-3329030

    Published by:
  • Coding Devops Linux Open Source

    gordon: the simple chef workflow

    Nikolas Lahtinen, one of our top full-stack devops developers, wrote on his blog http://nikolas.ninja/gordon-simple-chef-workflow/

    I was working on provisioning some Docker containers with Chef.

    After finding the knife commands to be verbose to a degree of extreme annoyance and knife not managing the simple task of unpacking it’s own groceries, I decided there was need for an actual Chef so I called Gordon Ramsay over!

    XVnCYozNo more annoying fumbling with the knife as you try to remember whether it was cookbook site download or site download cookbook or whatever. No more combing through metadata.rb and metadata.json files for dependencies. Need to create new repository? “Where was that example repo again? I swear I had the url somehere in my emails…” Don’t worry, Gordon has got you covered!

    Gordon – the apt-get of Chef

    To be clear, gordon is a scaffolding app used to get you out up and running in matter of minutes. Perfect for kickstarting the provisioning files for chef-solo environments such as the virtualized kinds Docker and Vagrant provide. At the moment gordon has no abilities to communicate with Chef server other than generate static files.

     

     

    Read more from:

    http://nikolas.ninja/gordon-simple-chef-workflow/

     

    Published by:
  • Careers Coding Company Management Strategy Work Psychology

    PHZ.fi Values

    At PHZ.fi we have found a better way to develop sustainable software by following the core values of Agile Manifesto
    http://www.agilemanifesto.org

    Jeff Sutherland, the inventor of Scrum has elaborated the meaning of values further.
    https://msdn.microsoft.com/en-us/library/dd997578.aspx

    We should Individuals and interactions over processes and tools

    Our core value is teamwork, which enables Collective Code Ownership and continuous learning. The sysadmins will pair with frontend developers and customers with the backend developers, trainees with senior developers. Studies have shown that when all communication obstacles have been removed, the team will perform up to 50x better than the industry average.

    • Respect for the worth of every person
    • Truth in every communication
    • Transparency of all data, actions and decisions
    • Trust that each person will support the team
    • Commitment to the team and to the team’s goals

    Working software over Comprehensive documentation

    By constantly refactoring the software by doing Test Driven Development, the best documentation for the software is 100% passing automated tests.

    • Define acceptance tests when defining the feature
    • Implement features serially and in priority order
    • Run acceptance tests on each feature as soon as they are implemented
    • Fix bugs that are identified as highest priority as soon as possible

    Customer collaboration over contract negotiation

    We have found out that the Truth doesn’t reside in our office, but we should go out of the building and find out the real customer. Since it is difficult to get the customer to come over to our office, we normally nomadically roam on-site at customer premises.

    • When the team cannot work on-site with the customer (such as consumer projects), the team must appoint a customer proxy, product owner, who is always available at the office

    Responding to change over following a plan

    • It is better to adapt to change quickly rather than agree and follow a fixed contract or a plan. We have found out that even a 2 week iteration might be a too long period to fix on a certain plan, customer typically wants to change the plan even faster especially on consumer services that are in production maintaned by PHZ.fi Devops.
    • At PHZ.fi we unfortunately do not excel at fixed price and scope projects, but try to avoid them. Instead we provide an agile team for an hourly rate, and the customer can decide on the scope, priority and the length of the project flexibly. By prioritizing the highest value and highest risk customer stories to be implemented first and released frequently (daily or weekly), the highest business value can be delivered quickly and the total project risk diminishes quickly towards the end of the project.

    Summary

    The core PHZ.fi values are

    • High Skill
    • Teamwork
    • Feedback
    • High Quality
    Published by:
  • Coding

    Rise of PHP

    Ben Ramsey provides a look at the rise of PHP, the one-time ‘silly little project’ that has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs. “Those early days speak volumes about PHP’s impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering more than 80 percent of the Web, PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity.”

    http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html

    Published by: