Skip to main content

Home/ PHP Programming/ Group items tagged Not

Rss Feed Group items tagged

Sarah HL

ongoing · Test-Driven Heresy - 0 views

  • As a profession, we do a lot more software maintenance than we do greenfield development.
  • the deep-TDD rules: ¶ Never write code until you have a failing test. Never write any more code than is necessary to un-fail the test.
  • we do way more maintenance than initial development. And in my experience, the first-cut release of any nontrivial software is pretty well crap.
  • ...38 more annotations...
  • But to do that well, you absolutely must have enough test coverage that you just aren’t afraid to rip your code’s guts out
  • I always end up sketching in a few classes and then tearing them up and re-sketching, and after a few iterations I’m starting to have a feeling for X and Y.
  • I freely admit that this is not really truly TDD
  • once you’re into maintenance mode, there are really no excuses. Because you really know what all your X’s and Y’s are
  • Writing the tests points out all the mistakes you might make in signatures, prerequisites, etc. If the tests are too hard to make then you know that your API will be too hard to use, you're doing it completely wrong, and may as well pause for a rethink.
  • While the approach you advocate makes sense, it does require professionalism, not just from the developer but from management too.
  • the person left to maintain the code isn't the person who wrote it, leaving the maintainer with an unholy mess to untangle. Getting unit tests into such code is a monumental task.
  • he failure to address how unit tests can be introduced to an existing non unit-test codebase. (i.e. go from non-TDD to TDD)
  • I feel the TDD community only wants to focus on greenfield projects and has ignored maintenance/legacy issues. Which is strange when as you say code spends most of it's time in maintenance
  • The thing is that as long as the project is small you really don't see the benefits of TDD. I've done a couple of small projects and never had to go back to them ever again
  • Never use mocks unless you are mocking an interface that will almost never change
  • You are writing the client code (in the form of a test) so you are thinking how the worker code will be used. What is its public interface and what do you want it to do when it's called
  • From: Tathagata Chakraborty (Jun 24 2009, at 07:31)TDD is useful in another situation - in a commercial setting and when detailed specification documents have already been created by say a technical expert/architect. In this case you don't have to do a lot of designing while coding, so you can start off with the test cases.
  • writing the tests *first* is that it helps keep your code focused on exactly what it's meant to do, and no more
  • When work on production code begins, most of the code should fall into the categories of things that are not to be tested.
  • In theory, TDD is a great idea. The problem with TDD can be expressed in one word: money.
  • One approach to the unknown X and Y problem that I've been using recently has been to pretend that class X has been written already, and then write code that uses this pretend X object/API. I usually write this directly in the file that will become my unit test. Since X doesn't exist, I'm allowed to call whatever methods I want and pretend it all works. Once I'm satisfied with how it all looks, I cut and paste everything into a bunch of failing tests.
  • I get really bored adding tests to code that already runs
  • the seductive TDD trap
  • religious zealots
  • There is nothing wrong with building tests after you have built your product.
  • that goes a long way towards taking software development from a form of artisanal craftsmanship to a real engineering profession.
  • using tests to drive development cripples innovation, dramatically slows development
  • It always seem to me to be a codified form of reverse engineering, or at least a way to force the programmers into looking at their code from two separate angles at the same time.
  • If you're just adding tests at the end, then it's normal unit-testing, isn't it?
  • I do realize that this type of exercise might help younger coders in getting better structure, they do often rush in too quickly and focus more on the instructions than the abstractions.
  • TDD is test-driven *design*
  • He said he didn't write tests in cases where it would have taken him several hours to get a working test for a small piece of code.
  • In some applications, objects are self-contained, activities are sequential, and algorithms are tricky
  • I've seen cases where people have wrecked the architecture of systems in the name of making them testable... But have never written the tests.
  • Yes, it's possible to make peace with testability, and in the best situation, testability can improve the architecture of a program, but it can also lead people away from highly reliable and maintainable KISS approaches.
  • Like any infrastructure, it is always beneficial to provide unit testing. The most benefit is derived from installing it as early on in the project as possible.
  • The value of an untested feature, to a client, is ... zero. So, it doesn't matter how many of these you have rattled off in the past week, your net throughput is effectively... zero."
  • You can see in this thread the word "professionalism" (substitute "morality" with little gain/loss of substance) and even "sin" (used in jest, but not really!)
  • if I delay writing unit tests until after all the units are working together then because the system "already works" my subconscious enthusiasm for writing unit tests falls markedly, and so their quality and coverage fall
  • Experience teaches that if I generate that output by hand (1) it takes *much* longer (2) I almost always get it wrong. So I often write the code, get its output, carefully check it (really...) and then use it as the correct result.
  • My main objections to TDD are: 1) it promotes micro-design over macro-design and 2) it's hard to apply in practice (i.e. for any code that is not a bowling card calculator or a stack).
  • the tests are just a persistent artifact of the exploratory coding I've already done.
lemike

PHP: rfc:isset_ternary - 0 views

  • The short ternary operator, ?: provides a way to do this much more conveniently: $_GET['mykey'] ?: "". However, this is not good practise, as if the value does not exist it will raise an E_NOTICE.
  • The coalesce, or ??, operator is added, which returns the result of its first operand if it exists and is not NULL, or else its second operand.
  • chained
  • ...3 more annotations...
  • precedence relative to the ternary operator and the boolean or operator
  • short-circuiting operator
  • PHP 7
  •  
    In PHP7 you can use $foo = $_GET['x'] ?? 'default_content' which raises no notices if $_GET['x'] is not set
qualitypoint Tech

Resolving "initialize is not defined" Error message while pasting content in DreamWeave... - 0 views

  •  
    "While executing onLoad PasteFireworksHTML.htm, the following Javascript error(s) occured: In file ""PasteFireworksHTML"": ReferenceError: initialize is not defined"
qualitypoint Tech

Simple application for converting HTML code into Entities to show them in Blogger blog - 1 views

  •  
    Some characters are reserved in HTML. We can not use them in the content of HTML file.\nFor example, < (less than symbol) is used as opening tag for HTML elements. So, we can not show it as it is when we need to show the less than symbol.
melvinahebert

Settings App Not Working in Windows 10? Here Are the Fixes - Techgill - 0 views

  •  
    When you see a message, asking if you want to merge the folders from your old account to your new one. You have to click Yes. That is all about, the fixes for Settings App Not Working in Windows 10. You must have known that the Settings app is very important in Windows.
seth kutcher

My Husband Is Happy With Their PC Repair Services - 1 views

My husband was so frustrated the other night because his laptop was not working properly. I told him to calm down and we will call Remote PC Repair Now. I told them they are the expert when it come...

remote PC repair

started by seth kutcher on 08 Aug 11 no follow-up yet
seth kutcher

Great Remote Computer Repair Services - 1 views

I am very thankful that Remote PC Repair Now is here. I just do not know what I will do without them. Their remote PC repair services are the best. They totally helped me resolve my issues with my...

remote PC repair

started by seth kutcher on 09 Sep 11 no follow-up yet
cafe software

Better Control of My Sales and Inventory - 2 views

I did not imagine using a cafe POS system can be a turning point for my business. Everything is transparent and clear. I can track everything from how many glasses of wines I sold down to how many ...

cafe pos point of sale

started by cafe software on 28 Mar 12 no follow-up yet
qualitypoint Tech

Easy Learning Updates - Feature for preventing Spam email and New Topics such as Footba... - 1 views

  •  
    As I mentioned in my previous post we are continuously improving our Easy Learning.We are already having a feature for sending the score thro' emails. Some spammers started misusing this feature for sending some junk emails continuously. (Anyway they can not change the built-in content).
jdr santos

News - Arbit - next generation project tracking - 0 views

  •  
    Arbit aims to provide a decent modern extensible multi project tracking tool. Features start with issue tracking and wiki and do not stop before code analysis and translation management.
jdr santos

Roadsend - 0 views

  •  
    Roadsend PHP Compiler is a free, open source native compiler for the PHP language. It compiles PHP source code to stand alone, native binaries which do not require an interpreter. Roadsend Compiler can build online web applications with Fast/CGI, offline
jdr santos

Spoon Library - 0 views

  •  
    Spoon is a PHP5 library that stands for speed, both in page execution and coding agility. Because of it's clear and logical structure, it offers a very small learning curve for both the experienced and not-so-experienced developer. Spoon provides a well documented library with a large collection of classes that you can use while building the next Web 2.0 application.
Sarah HL

Learning JavaScript from PHP - a Comparison | Lullabot - 0 views

  • In PHP, all variables are local in scope unless declared as global. JavaScript is opposite, and all variables are global unless declared with the var keyword.
  • Both PHP and JavaScript are loosely typed
  • JavaScript is a bit mixed concerning undeclared variables, if you attempt to modify or compare with an undeclared variable, the script will break entirely, but you can check the variable status using typeof() or in conditional statements containing only that variable.
  • ...6 more annotations...
  • JavaScript only recognizes the keyword true in all lowercase. PHP accepts both uppercase and lowercase
  • PHP is not case-sensitive in function or class declarations, but JavaScript is case sensitive for these also.
  • The key difference between PHP and JavaScript is that JavaScript does not have associative arrays.
  • JSON strings having become very popular as a faster alternative to XML, and can be read and created with the PHP functions json_encode() and json_decode().
  • Let's take one more look at defining an object in JavaScript and see how it can be used to compensate for the lack of associative arrays in JavaScript.
  • // Note that variables should always be// prefixed with "var" to define a local scope.for (var n = 0; n &lt; 10; n++) {  alert(n);}
jdr santos

atomik framework | micro PHP5 framework for small to medium websites - 0 views

  •  
    Atomik is a free, open-source, micro framework for PHP5. Atomik is built for small web applications that do not need heavy frameworks but still want powerful features. It is build with the KISS principle in mind as well as speed and security. Atomik is also an ideal introduction for beginners to the world of web development frameworks.
jdr santos

Tekuna.org - MVC Microframework for PHP - 0 views

shared by jdr santos on 01 Sep 09 - Cached
  •  
    Tekuna is a compact framework for web-based applications. It provides a stable basis and a generic infrastructure for your projects. Tekuna has a very small footprint and will not pollute your codebase with unnecessary stuff.
Mickle jori

Web Content Management - 0 views

  •  
    Web content management is the key area of work for most web developers and Karmick Solutions provide a broad range of services in this field. It not only ensures companies to experience trouble free and smooth handling of their websites but also other various important online content saving your precious time and effort.
paul silmonet

Instant Fix Slow Computer Solutions - 0 views

I bought a brand new PC with good specifications just last month. But only three weeks of use, I noticed that my PC froze and slowed down a bit. For the next three days, it continued to slow down. ...

Fix Slow Computer PHP programming framework open source web development webdesign MVC design mysql

started by paul silmonet on 08 Jun 11 no follow-up yet
Sanny Y

The Number One Computer Tech Support Service - 1 views

Computer Tech Support Service offers the most outstanding computer support service. They have friendly computer support technicians who are very skilled in giving accurate and fast solutions to my ...

Computer support service

started by Sanny Y on 13 Sep 11 no follow-up yet
Jungle Jar

JungleJar | Looking at Wordpress Custom Fields and Images Further - 0 views

  •  
    You may remember a previous article I wrote here on JungleJar.com called Using Custom Fields To Post Your Images, but if not, I'm going to reintroduce a few of the code snippets and methods I wrote about in the tutorial about how to save and display image data from custom fields within Wordpress. In this article I'm also going to cover a few of the small yet robust code block methods I myself tend to practice quite a bit that I didn't previously touch on. So, if you're looking for a solid tutorial on how to use Wordpress Custom Fields to display blog post thumbnails in an easy and flexible manner, then this article is for you.
1 - 20 of 59 Next › Last »
Showing 20 items per page