Skip to main content

Posts

Showing posts with the label software development

Simple code: Functions and methods

What makes a good function or method? I don't think it's a single thing but a combination of things where each is significant. If one the things is flawed it affects to all others and the whole function is flawed. So what are those "things"? Have a meaningful name Function should have a name that describes it's purpose or functionality. When a function has a meaningful name it's easy to read and understand what's it's purpose. Let's take a example. If function's purpose is to find a customer by it's id a good name could be findCustomerById(id: String) or it could just as well be just  findCustomer(id: String) because the function signature implies that the customer is found by it's id the word find also implies that the customer might be found or it might not be found. If the function's name would be changed to getCustomer(id: String) it's meaning changes because now it implies that there's no fallback, the customer is e...

Simple code

I've been writing a series of blog posts trying to summarize what are the key incredients of good code. The working title for the series was called "my view of clean code" but clean code is already a existing term (and a book, read it if you haven't). My view is mostly same, a bit different and with a idea that these are not rules or laws but conventions, ideas and practices that can be applied in many situations but this is not a silver bullet. I'll be publishing ten posts in addition to this one on various subjects that relate to code, code bases, interactions in code or interactions between systems and how to build all this with the aspire to make everything simple so that the code is as easy to test, reason and as understandable as possible. Each post will be a short and simple description of the subject with possibly some example code. A new post will be published every other week. In the first part I'll be writing about functions and methods and that wil...

Dedicated time for learning Python at work

In the spring of 2019 I had the opportunity to use some paid work time for learning something new. I decided to spend the given time to brush up on my Python knowledge. I had some experience in programming with Python but not much and I didn't have a understanding of Python conventions or ecosystem. Limited time frame I had a limited time frame that was split to four sessions. In addition to the time given for each session I spent at least the same amount of time on preparing each session. First session, the basics It was quite hard to find a resource that summarised Python basics on a sufficient level but I managed to find Alex Martinelli's slides Python for Programmers from 2007 that contained exactly what I was looking for. Even though the slides are from over a decade ago and the Python version was 2.x at that time all the information is still applicable to current Python 3.x version as is or with minor changes. Second session, testing in Python Python has a good...

Automated browser testing in 2018

Every now and then I do some research on browser testing. More specifically I try to find and evaluate what kind of ready to use solutions or libraries have emerged since my previous research or if some of the previously tested solutions has come up with something new. Back in September 2017 I had some extra time on my hands and I used a couple of days to see what are the new and interesting solutions at that time. I came across some tools that I have used in the past and found two new interesting options in which one stood out. Say hello to TestCafe The most interesting solution that I found was called TestCafe . It's a open source Node.js library from a company called Developer Express Inc. They also have a commercial product called TestCafe ( confusing ) which I haven't tried as the open source library provided everything I was interested in and it seemed to be under active development . The thing that caught my interest at first was that this library doesn't depen...

Why am I a consultant

Have you ever wondered what do software consultants exactly do? I'll share my view of how I ended up as a software consultant, what I have gained and what do I do as a consultant. My brief background I started my career as a programmer in the early years of 2000's as part of my studies and via summer jobs. Back then I was working with web sites and doing... well what ever we could do back then. Few years later I enrolled to university and at some point started working as a programmer to have some side income and work experience. After I graduated I continued working for the same employer I had been been working for the past few years. After four years of working with the same employer and on pretty much the same applications and technologies I started to notice that I wasn't learning new skills or technologies as much and fast as I wanted to. Time for a change I started looking for job openings and had a few interviews with different companies. I chose to work f...

Verifying your web applications works

Recently I joined a project that was built on node.js and views were generated via jade templates. The node.js backend had a few very basic tests in the form of unit tests and frontend didn't have any tests. One of my tasks was to improve the test coverage. Following is a short description of the problem and a example solution how I resolved it. Unit testing I started by going through the existing tests and refactoring those so that they worked as expected and added tests for the functionality I had implemented previously. These tests were run via mocha.js and utilized chai.js and supertest . These were very mainly unit tests except for the one's that utilized supertest which tested that the web application responded correctly to very basic http requests to routes like / or /login . I want more In a previous project that I worked in we had mocha tests that were run in a browser so that it tested the running application within a iframe via mocha. I always liked t...

Working on the cloud

Recently I've had the opportunity to work with cloud environments. Cloud environments bring benefits but also some new issues or challenges that have to be taken into account. Benefits One of the greatest benefits of cloud environments is the scalability i.e. with a single command one instance can be spawned to two, three or twenty instances that are behind some load balancer service of the cloud provider appearing as a single instance to the outside world. With the simplicity that cloud environments provide the developers can start deploying software as soon as there's something to deploy and keep deploying all the time. In the best case scenario test and production environments can be up and running since day one. Some services also provide a nice feature of roll backing quickly to previous versions if the latest version has introduced a bug that didn't exist previously. Challenges As a developer I've set up various development and testing environments but...

Weapon of choice

Everybody has their favorite when it comes to cars, sports or jeans and the same goes for work tools. Some prefer OS X over Linux or Maven over Gradle and don't even get me started on browser wars. I've had my share of trying out different tools to choose the ones I want to use but every now and then I change some of my tools. This time I'm telling what my day to day tools currently are and why I changed one of them. The solid foundation When I get to choose my tools there's one solid foundation that works as a base for all other tools. This has been my number one choice for over ten years with a little variety over time. Linux. No question about it, I've used for years, I know my way around it and it offers everything I need in work and at home. The variety comes from different distributions and desktop environments although those have also been very stable for the past four or five years, Debian has the stability I want and XFCE offers everything I need fr...

Studying and developing as software development professional

As everybody in software development knows, or should know, that studying and experimenting is something one must do to stay on top of the game. That said this time I'm writing about my experiences and ideas of studying. In this post I'll be covering different methods of studying and how I feel about them and what other types of resources are available. Reading a book Reading a book is probably the most traditional way of studying and I do read a few books every year. To me this is a way to learn theory and principles of something but usually little to nothing to do with the actual implementation. This type book I usually read in a week or two and I like these books when their length is reasonable somewhere between 50 and 250 pages. Reading a book with exercises These are very common type of books in software development. These usually cover some theory and the exercises bring a pragramatic approach with what one can learn a basic implementation. Some of these books ...

JFokus 2013: Second confrence day

On the second day I didn't make as much notes as I did on the first. That doesn't mean that the session weren't interesting I just focused more on listening. I attended eight session on the second day where the last one was the most memorable one by Dan North but I'll go through them chronologically. Some of the text is word to word notes from the presentations and some are my view of how I understud and processed the topic in my mind. Building scalable, highly concurrent and fault-tolerant systems: Lessons learned Jonas BonĂ©r told what makes systems slow and what kind of solutions can be used to speed them up or at least speed up the response to the user.  First lesson to learn is There are no free lunches . If you use some approach it affects to something else. Some might use the phrase There are no silver bullets which means the same thing or at least that's how I undestud it. Second topic was about concurrency. Mutables and threads isn't a go...

JFokus 2013: First confrence day

This was my first time at JFokus but hopefully not last. I wasn't quite sure what to except. I had heard good things about the confrence and knew that it was quite big. It was more and better than I expected. There were over 1500 attendees and great session from beginning to end. If i get the opportunity to go again I'm most definitely going again. On the first day I attended six sessions. I'm not going to write all my notes here but I'll try to give good summary of each session and the rest can be read from JFokus website where you can find presentation materials for both days. Taking development to the edge This was the keynote of JFokus embedded, M2M & internet of things miniconfrence. In the future everything is connected to each other and to the internet by everything meaning absolutly everything. Cars can share information of traffic, houses can tell if all the doors are closed and locked or the are the lights on. Smart homes didn't succeed 10-1...

Vaadin meetup

I attended Vaadin meetup with a few colleagues on a way to JFokus 2013 and thought I should share my notes of the two. First post is about vaadin meetup that took place on a cruise from Turku to Stockholm. I made notes of three presentations and one of them I had high expectations. There were also two other presentations that I didn't make any notes of. Vaadin 7 Vaadin released Vaadin 7 framework the same day that the meetup was on so they had a presentation where they told about new features and future plans. I'm more of a backend programmer than UI programmer so my notes of this were pretty brief but here it goes. Whats new Servlets and HTTP-sessions are controllable by the programmer Multiple UI classes e.g. One for web browsers and one for mobile web browsers GWT is now build-in Support for external JavaScript modules What to expect in the future Faster relase cycles maintenance release every two weeks Dynamic CSS injection Vaadin CDI, thei...