Skip to main content

Posts

Showing posts from April, 2017

Hiding Unwanted Python Folders and Files in Visual Studio Code

Visual Studio Code is a universal editor and pretty good at it. However, the explorer view maybe cluttered with the automatically generated folders and files confusing developers. Python is no different. Below are example files and folders generated by Python.

The __pycache__ folder and *.pyc files  are totally unnecessary to the developer. To hide these files from the explorer view, we need to edit the settings.json for VSCode. Add the folder and the files as shown below:
Copy and paste the lines below :

"**/*.pyc":{"when":"$(basename).py"},"**/__pycache__":true

Hiding JS and Related Files While Working with TypeScript : Visual Studio Code

While I was exploring Angular 2, following their Tour of Heroes tutorial, I was excited to see it is using TypeScript. As we know, TypeScript is not directly supported by browsers. It has to be transpiled into JS code for it to work. Good thing, the guys at Google has come up with a startup kit when developing Angular application ( instruction how to get it here ). Now you dont have to worry about manually transpiling TypeScript codes to JS, the package will do that for you and a lot more ( BrowserSync, yeah). With that being taken care of, you only have to worry about your TS code. Because the transpiled files reside on the same folder, these files may cloud up your Visual Studio Code file list. I asked StackOverflow ( Google for devs haha ) and got a working solution, pronto!

Unit Testing in Python : A Primer

Automated unit testing has been around for more than a decade now. I remember back in 2008, a colleague introduced to our team the concept of MVP pattern and in the process the advantage of using the pattern in unit testing. The concept of automated testing using NUnit and mocking using NMock was also discussed. That is where I began to see the advantage of implementing Test Driven Development methodology to developers. Unfortunately, the company where I moved don't see it as such. Thus, I was only able to practice it on my learning time. With the recent events in my life , I now have more time exploring this concept a little further. A series of post will concentrate on this concept using Python and C#. Lets begin with Python.