YAGNI principle in programmation

For the sake of perfection, when you code, you regularly plan features that could be added to your software in a close future.

But, this approach has many inconvenients:
– More time for testing and improving your application
– More time for debugging your application
– New features impose constraints on what could be necessary in the future
– As a feature is not actually necessary, you can’t fully anticipate what will be its exact behavior
– A new feature implies new possibilities, new developments, so it becomes extremely easy to blow your deadline

Don’t worry, YAGNI principle will save you from hell.

YAGNI principle stands for “You Ain’t Gonna Need It” !
Don’t add a feature to your application if it doesn’t really need it now.

Simple and logic… right?

I will really need his principle for the future, hope it could help you too becoming a great developer.

Advertisements
YAGNI principle in programmation

Chrome – always allow access to webcam and microphone over http (webRTC)

It’s been awhile I was searching for like an issue, so, it’s a great pleasure to be able to share it with you.

I’m working on an html5 project (Chrome only), that uses microphone and webcam with navigator.getUserMedia native html5 function.
The problem is that, Chrome always prompt for webcam and microphone authorization, and my customer needs an automatic granting.
One solution is to allow HTTPS protocol, but on windows server, it’s more complicated to install than linux servers.

For those who need a simple and working solution, the response is in “–use-fake-ui-for-media-stream” Chrome command-line flag.
The best way to use this instruction is in command line.
Open your favorite console and type:

//ON WINDOWS
    #For full screen access
    start chrome --kiosk "http://localhost" --use-fake-ui-for-media-stream

    #For normal access
    start chrome "http://localhost" --use-fake-ui-for-media-stream

//ON GNU-LINUX
    google-chrome "http://localhost" --use-fake-ui-for-media-stream

//ON MACINTOSH
    Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome "http://localhost" --use-fake-ui-for-media-stream

This will work either you use native navigator.getUserMedia function or any webRTC script.

ENJOY 🙂

Chrome – always allow access to webcam and microphone over http (webRTC)