6 days Ago

 

Is Encodo a .NET/C# company?

Published by Marco on in Technology

Encodo has never been about maintaining or establishing a monoculture in either operating system, programming language or IDE. Pragmatism drives our technology and environment choices.[1]

Choosing technology

Each project we work on has different requirements and we choose the tools and technologies that fit best. A good fit involves considering:

  • What exists in the project already?
  • How much work needs to be done?
  • What future directions could the project take?
  • How maintainable is the... [More]
 

2 weeks Ago

 

Should you return null or an empty list?

Published by Marco on in .NET/C#

I’ve seen a bunch of articles addressing this topic of late, so I’ve decided to weigh in.

The reason we frown on returning null from a method that returns a list or sequence is that we want to be able to freely use these sequences or lists with in a functional manner.

It seems to me that the proponents of “no nulls” are generally those who have a functional language at their disposal and the antagonists do not. In functional languages, we almost always return sequences instead of lists or... [More]

 

1 month Ago

 

Optimizing data access for high-latency networks: part IV

Published by Marco on in Quino

 In the previous three articles, we sped up the opening of the calendar in Encodo’s time-tracking product Punchclock. We showed how we reduced the number of queries from one very slow query per person to a single very fast query for all people at once.

Because we’re talking about latency in these articles, we’d also like to clear away a few other queries that aren’t related to time entries but are still slowing things down.

Lazy-loading unneeded values

In particular, the queries that “Load... [More]

 

2 months Ago

 

v1.12.0: .Improvements to data-provider statistics and Windows 8.1 fixes

Published by Marco on in Quino
The summary below describes major new features, items of note and breaking changes. The full list of issues is also available for those with access to the Encodo issue tracker.

Highlights

 Punchclock About Box Punchclock Splash Screen

 

Optimizing data access for high-latency networks: part III

Published by Marco on in Quino

 In the previous article, we partially addressed a performance problem in the calendar of Encodo’s time-tracking product, Punchclock. While we managed to drastically reduce the amount of time taken by each query (>95% time saved), we were still executing more queries than strictly necessary.

The query that we’re trying to optimized further is shown below.

var people =
  Session.GetList<Person>().
  Where(p => Session.GetCount(p.TimeEntries.Query) > 0).
  ToList();

This query executes one... [More]

 

Optimizing data access for high-latency networks: part II

Published by Marco on in Quino

 In the previous article, we discussed a performance problem in the calendar of Encodo’s time-tracking product, Punchclock.

Instead of guessing at the problem, we profiled the application using the database-statistics window available to all Quino applications.[1] We quickly discovered that most of the slowdown stems from the relatively innocuous line of code shown below.

var people = 
  Session.GetList<Person>().
  Where(p => p.TimeEntries.Any()).
  ToList();

First things first: what does... [More]

 

Optimizing data access for high-latency networks: part I

Published by Marco on in Quino

 Punchclock is Encodo’s time-tracking and invoicing tool. It includes a calendar to show time entries (shown to the left). Since the very first versions, it hasn’t opened very quickly. It was fast enough for most users, but those who worked with Punchclock over the WAN through our VPN have reported that it often takes many seconds to open the calendar. So we have a very useful tool that is not often used because of how slowly it opens.

That the calendar opens slowly in a local network and even... [More]

 

Working with EF Migrations and branches

Published by Marco on in .NET/C#
The version of EF Migrations discussed in this article is 5.0.20627. The version of Quino is less relevant: the features discussed have been supported for years. For those in a hurry, there is a tl;dr near the end of the article.

We use Microsoft Entity Framework (EF) Migrations in one of our projects where we are unable to use Quino. We were initially happy to be able to automate database-schema changes. After using it for a while, we have decidedly mixed feelings.

As developers of our own... [More]

 

3 months Ago

 

Question to consider when designing APIs: Part II

Published by Marco on in Development

In the previous article, we listed a lot of questions that you should continuously ask yourself when you’re writing code. Even when you think you’re not designing anything, you’re actually making decisions that will affect either other team members or future versions of you.

In particular, we’d like to think about how we can reconcile a development process that involves asking so many questions and taking so many facets into consideration with YAGNI.

Designing != Implementing

The implication... [More]

 

Questions to consider when designing APIs: Part I

Published by Marco on in Development

A big part of an agile programmer’s job is API design. In an agile project, the architecture is defined from on high only in broad strokes, leaving the fine details of component design up to the implementer. Even in projects that are specified in much more detail, implementers will still find themselves in situations where they have to design something.

This means that programmers in an agile team have to be capable of weighing the pros and cons of various approaches in order to avoid causing... [More]

 

REST API Status codes (400 vs. 500)

Published by Marco on in Tips and Tricks

In a project that we’re working on, we’re consuming REST APIs delivered by services built by another team working for the same customer. We had a discussion about what were appropriate error codes to return for various situations. The discussion boiled down to: should a service return a 500 error code or a 400 error code when a request cannot be processed?

I took a quick look at the documentation for a couple of the larger REST API providers and they are using the 500 code only for... [More]

 

4 months Ago

 

Dealing with improper disposal in WCF clients

Published by Marco on in .NET/C#

There’s an old problem in generated WCF clients in which the Dispose() method calls Close() on the client irrespective of whether there was a fault. If there was a fault, then the method should call Abort() instead. Failure to do so causes another exception, which masks the original exception. Client code will see the subsequent fault rather than the original one. A developer running the code in debug mode will have be misled as to what really happened.

You can see WCF Clients and the “Broken”... [More] by David Barrett

 

OpenBSD takes on OpenSSL

Published by Marco on in Technology

 Much of the Internet has been affected by the Heartbleed (Wikipedia) vulnerability in the widely used OpenSSL server-side software. The bug effectively allows anyone to collect random data from the memory of machines running the affected software, which was about 60% of encrypted sites worldwide. A massive cleanup effort ensued, but the vulnerability has been in the software for two years, so there’s no telling how much information was stolen in the interim.

The OpenSSL software is used not only to... [More]

 

The Internet of Things

Published by Marco on in Technology

This article originally appeared on earthli News and has been cross-posted here.

The article Smart TVs, smart fridges, smart washing machines? Disaster waiting to happen by Peter Bright (Ars Technica) discusses the potential downsides to having a smart home[1]: namely our inability to create smart software for our mediocre hardware. And once that software is written and spread throughout dozens of devices in your home, it will function poorly and quickly be taken over by hackers because “[h]ardware companies are generally bad... [More]”

 

Mixing your own SQL into Quino queries: part 2 of 2

Published by Marco on in Quino

In the first installment, we covered the basics of mixing custom SQL with ORM-generated queries. We also took a look at a solution that uses direct ADO database access to perform arbitrarily complex queries.

In this installment, we will see more elegant techniques that make use of the CustomCommandText property of Quino queries. We’ll approach the desired solution in steps, proceeding from attempt #1 – attempt #5.

tl;dr: Skip to attempt #5 to see the final result without learning why it’s... [More]