Unit-Testing to Solidify Your Progress

The way to be assured of your forward progress on a software project is by running unit-tests. Specifically, fully-automated unit-tests.

To be effective, these tests should confirm every bit of your application’s functionality that is important to it’s success. That is – everything that is listed in your Requirements document. To be efficient, each unit-test should, ideally, test one thing. This way you can identify quickly what is not working simply by which unit-test stopped working.

To work as planned, these tests should be easy to run, and ideally should run automatically. “Automatically” in the sense that

  1. There are no manual setup steps required. The unit-tests do their own setup and tear-down.
  2. They are executed automatically everyday, or even with each check-in of the source-code.

If certain of the unit-tests require manual effort to setup and run, then it will inevitably happen that someone will put it off. If this cannot be avoided, then separate your unit-tests into categories: the lightweight, automatic tests, and those which need to be manually run.

There is a further consideration – one which especially arises in the context of automated unit-tests: these should be kept to the minimum that you need to guarantee the functionality works. And not more. Otherwise, your testing regime is adding further burden to your team, and dragging you downward. Test to crucial functionality, not for implementation details (with exceptions – to be covered in a blog article).

Big Systems:

There is a special urgency in employing unit-tests within large software systems, and this is related to Complexity.

I’ll relate an example: I was once involved with a large project that was implemented using C# as the glue, but with a large number of major components that did most of the work. I won’t name them here, but – all of these systems, welded together as one monolithic ballet of programs, yielded major headaches.
Bugs. Shitloads of bugs. And we were using a week sprint and our focus was narrowly directed at fixing those bugs. The system has major parts not functioning – even though it was already in production, and new bugs continued to arise.
There was no isolation between subsystems such that each could be unit-tested. Not effectively. To test it, required substantial work to set up a test environment and try to arrange test-data that would surface the bug symptoms. No dependency-injection was being used, no VisuTest, no charting of it’s UX responsiveness.
This project looked destined for failure.

I’m going to create a graphic animation to illustrate a basic principle, but I’ll attempt to describe it here.
If you put ten parts together, all interconnected and each pushing data into the rest and receiving results (ie, a typical large system) — without careful design for breaking this into well-defined and testable parts, you may be headed for disaster. Complexity is your enemy. With excessive complexity you may never get a handle on your bug situation. Complexity grows exponentially with the number of parts you put into your system. The way to break that exponential growth of complexity, is to de-couple your parts. At least, when you’re testing them.

Please, carefully consider your use of dependency-injection (also referred to as Inversion-of-Control (IoC)). There are some amazingly lightweight and efficient IoC facilities now, as for example Lamar for C#.

For each of your major parts, and for the parts of your aspect-oriented programming (ie for your services such as data-stores, your loggers, your error-notification services and so forth) – define (here we will use the example of C# but this applies to many programming languages) interfaces, such that every part has it’s own interface that defines what it provides.

Every part MUST have a complete suite of fully-automated unit-tests that prove it does what it must do. In fact those unit-tests help to define it’s behavior.

IF all of the other parts and services can be mocked-out via IoC, then you can design your tests such that THIS ONE PART (the one you are working on right now) can run, in complete isolation from everything else, with full simulation (via mocking) of every behavior it expects of the rest of the system. In this way (and, I say – only in this way) can you manage that Complexity and whip this thing into shape.

EVERY bug that is diagnosed and fixed, that entails, for example, a specific user-input, data pattern, or database state — must have that error-producing data applied to your unit-tests so that you can be alerted if that ever fails again.

Posted in Software Design, Testing, The Development Process | Tagged , , | Leave a comment

Crafting Better Code – C#: Write abundant quality comments

From the very start of your software-engineering you should compose cogent comments right along with your code. The only exception is where your code is so small that it is trivial and obvious (to anyone besides yourself) or else you are the only audience.

This is one of those areas in which, largely, older engineers make better code-crafters: they know that the universe of possible code-contructs, patterns, APIs, add-ons and libraries is truly vast. To assume it’ll all be obvious past this moment is to guarantee future frustration and time-wastage.

For your long-view guidance – to tell your teammates what your code does and it’s basic organization – provide a “Doc” folder and give it simple text, markdown or HTML documents. This should form your basic roadmap, and here you direct your reader where to go within the code. Everything that is missing from the code-level comments, should be here. If you’re going to structure this formally – then I’d suggest you also provide a separate, informal ‘quick roadmap’ or synopsis. Come back to this regularly: do not let it become too out-of-sync with your code such that it decays into uselessness.

Here I’ll direct my tips toward the crafting of code using C#..

Use the standard for code-contructs that Microsoft’s Visual Studio provides, which is:

///<summary>
/// This integer tracks the number of insertions since the start of this run.
///</summary>
private int _insertionCount;

Within Visual Studio, all you need do is type the first three slashes and it produces the remaining slashes for you.
The advantage of this is that when you encounter this variable from anywhere else within your codebase, you need but hover your mouse over it and this comment will magically appear. It’s like having a crib-note always attached to it, but which hides itself until you need it. This is important – otherwise your readers must navigate to the code-element itself to see your comment.

Be useful. Here is a counter-example, taken from the iText product API documentation page:


eoFill()

EOFills current path.

Yeah – that’s actually the kind of API-documentation that iText provides. Does that look useful to you?
Do NOT use domain-specific jargon in your comments. I’ve been using the iText 7 API to create Acrobat documents and I still have no idea what the hell that method is for. If you add a comment that simply repeats the text that is already within the method-name, you mark yourself as a total idiot who should never be permitted anywhere near a keyboard. Here is an example of what I recomment, from the LogNut logging-library..

        /// <summary>
        /// Set the name of the log file to write file logging output to.
        /// If you don't set this then a default value will be computed. See <see cref="FileOutputFilename"/>.
        /// This is the same as setting the <see cref="FileOutputFilename"/> property.
        /// </summary>
        /// <param name="filename">the name of the file to log to - without the drive or directory information</param>
        /// <returns>a reference to this <c>Configuration</c> object, such that further method calls may be chained</returns>
        public Configuration SetFileOutputFilename( string filename )

Yes, this is rather verbose. That’s okay – it takes a few seconds to type, as opposed to untold minutes wasted by N developers trying to guess what the heck you mean when you *don’t* bother to explain. Note that it is made explicit what argument you should supply for filename – not a path, not a drive – just a filename. It’s also made quite explicit what this is for: the log output file. LogNut has many kinds of outputs – this is for *file* output. The sentences are complete, clear, unambiguous.

Make your writing readable. That sounds too obvious – but it’s a badly-needed admonishment. Your comments should read like good exposition: avoid too-esoteric terms when a generally-known word will serve, make your sentences read easily, without being wordy. Write to guide and inform, not to fill space and not to slow your reader down.

Use proper spelling and grammar. I try to encourage being rather strict in this for one reason: the human visual-system is such that we more readily recognize and digest writing when it it correctly formed (from the perspective of our own personal background). When your mind has to stop and guess at what “snd to pip recever” is intended to convey — that interrupts your flow of thought. The result is that it is harder, and slower, to read. For individual method-parameters, you can use a non-sentence phrase: “the number of items in the collection” but for anything longer you should assemble your writing into complete sentences. Invest a little time to make it explicit.

Regarding spelling: use a spell-checking tool in your code-editor. Why is correct spelling so important? For doing text-searches, for one. But also for your teammates for whom your language is not *their* native language. It’s hard enough to keep googling for translations, but can you imagine the difficulty when your own English is not even spelled correctly? Regardless of how careful you are – mispellings will creep in. A good spell-checker will highlight those for you.

Decide upon your naming-scheme and structure, and make that a consistent pattern for you and your team. For the things in your code that represent something in real life and can be named any of a number of different ways – consider how you want to name them, and stick to your scheme. These patterns help your (and anyone’s) mind to instantly follow it’s structure. For example, if you’re designing a desktop application that has views and view-models, why not name all views with a “View”suffice, and all view-models with a “ViewModel” suffice? Now make every comment, everywhere, use this same nomenclature. Placing the parent-class name after the class-name can be a helpful pattern: “PictureAcquiredEventArgs” is obviously a subclass of EventArgs. And on the topic of events..

A C# event is a signal that something happened. Name it with a verb-phrase in the past tense. The name should say that a thing happened, and the Intellisense-comment should give it further detail. If your event is named “ImageUploaded”, why not name the event arguments ImageUploadedEventArgs, and the event-handler method OnImageUploaded.. this pattern makes their relationship intuitively obvious. But don’t stop there: still add your comments. What does this class contain? What does this event-handler *do* in response to the event?

Now – this is the most illusive feature to maintain and yet is the most crucial: Make your comments such that, taken as a whole, they describe the operation of your system completely. *Completely*. You should be able to bring in a brand-new employee set them loose upon it – and see them start doing useful work. The larger constructs (assemblies, libraries, classes) should convey the overall purpose and organization of your code, while the individual code-constructs provide the detail *when* your reader feels the need to zoom-in for that level of detail.

Write a comment for every non-local construct in your code. All of them. And take some care to write your comments correctly and make them useful. And then re-visit your comments over the next days to rewrite them to maintain clarity and consistency.

Posted in C#, Software Design, Uncategorized | Tagged , , | Leave a comment

Are you keeping your accounts reasonably safe?

This should be nothing new to you – but it’s good to ensure you have the basic essentials of computer-security in mind.

* Use a reasonably non-guessable password. Some attacks use an automated word-guesser, so you want to use one that is not an existing word. And don’t just add a digit onto the end and think that’s sufficient. Be creative – but don’t forget it. Either establish your own system for knowing what your passwords are, or else use a password-utility such as KeePass.

* Don’t use the exact same password for all of your accounts, and especially don’t re-use your email or social-media passwords for your financial accounts.

*Change your passwords periodically (yes, I know these three requirements are making this a bit onerous for you!)

*Examine your bank and payment-card statements, at the very minimum, once per month – but weekly is better. Don’t ignore mysterious charges just because they are small – they may re-appear as larger charges down the road and then the vendor will claim (when you try to dispute it) “well they ordered a trial product and accepted the charge”. This is absolutely essential – don’t slack on this.

*If you have sketchy characters in your home, or your computer is in a shared area – do not leave your important accounts logged-in. Remember, if someone can operate your email logged-in as you, they can do a lot to you: reset your passwords, get in to your accounts, … and you may not be aware of this until it’s too late.

*Do not leave your Wifi Router with it’s default password!

*I’m sure I don’t have to tell you this, but.. if you’re downloading freeware from a source that you are not absolutely sure of, or visiting a sketchy website — do that within a virtual-machine (VM). Freeware represents the easiest way for scammers to load their nefarious code onto your computer and launch it. Websites (and especially ads) can have driveby-downloads. Using a VM is like having a computer within a computer: if it gets corrupted, you can revert it and start over. I use VMware Workstation, and before I do a test that could result in corruption – I make a snapshot that I can revert back to.

Stay safe, good peoples.

Posted in Security, Uncategorized | Leave a comment

.NET Core 2.0 Is Now Released

The .NET platform continues to move forward and evolve, and now it’s usefulness is extending into more target-platforms. As of 2017 August 14th, .NET Core 2.0 is available as a final release. Now, you can develop against this as your primary target version of .NET and expect to run your software on Windows, MacOS, and Linux (see  here  for a list of supported OS versions).

You can download the bits and view installation instructions  here .  Note that Docker images are available too.

You will want to update your version of Microsoft Visual Studio to  Version 15.3  also.  This update brings you a significant set of fixes and incremental improvements.

See  the full announcement here.

If you are developing websites using ASP.NET-MVC, you can access the GitHub repo for the new Core version  here.

James W. Hurst

Posted in Uncategorized | Leave a comment

Security: Are you securing your WiFi Router?

Ok, this is an alarming finding:

Most people never change their router’s passowrd

Continue reading →

Posted in Security, Uncategorized | Leave a comment

AR and VR Have Some Surprising Potential Uses For New Development

When I first started hearing about Virtual Reality (VR), my first reaction was “oh great — more toys for the gaming boys”. Which was a foolish dismissal of something that can bring great utility to some unexpected areas.

I love to machine metal (I’m not a professional in it), and there is a visceral joy about making things out of steel and aluminum that’s hard to understand for anyone who hasn’t smelled burning cutting-oil and had to vacuum sharp chips of steel out of your shirt pocket. Machine-shop skills also help to round-out an engineer’s sense of maker capability.  But it can be laborious: just trying to zero-out your cutting-bit on a Bridgeport to establish your X-Y reference, so that you can make your cuts to .001″ accuracy — can force you to expend many minutes of detail-work.

Now imagine this: You put on some awkward-feeling goggles, step up to your machine with the blank piece of steel already snuggly clamped-in, and say: “Touch the bit to the right and front edges to establish a zero-reference”. The software controlling your milling-machine uses AI-vision (a term that I use for Artificial Intelligence-based robotic vision) and AI-speech, and a general knowledge of machining and of *this* specific machine, to know to power up, touch your workpiece to establish the point of reference (using a touch-sensor or else just high-resolution AI-vision), and *ask* you if it finds any ambiguity in your request.

But.. it is possible (indeed likely) that it will completely misunderstand what you are wanting. It might take it’s reading off of the wrong edge. Or, what if your work-piece has multiple stepped edges, or some other non-simple shape? This is not a miscommunication, so much as it is a *misunderstanding*. And we can attend to it thusly..

Imagine now that over the right-edge of your work-piece, an image appears of a thing shaped like a pointer, which floats over to the actual edge and seems to touch it, and magical marker-lines appear that just barely touch the corner, leaving zero doubt as to what they are indicating) as a voice asks “Is this what you want to use as your X-zero reference?”

You: “No. The edge just below that.”

The point moves again.

You: “Yes, right there.”

Now the sensor is physically moved there to take it’s reading and then we repeat this process for the Y-reference.

Dental_Lab_Metal_Milling

Note that the conversation is instantly clarified — it is placed upon a firmer foundation, simple by pointing to things. This, is Augmented Reality (AR) — so named because you still see the actual world from within your headset. It simply adds things to it.

And the effect, and utility of it, can be fantastic.

Note that this application I describe entails AI (also my specific area of focus, both academically and in practice). My personal passion (that’s the buzzword today, right? “passion”. Really I prefer just to say “this stuff is fun”). This is most useful and fun, when your AI comprehends what’s going on, and applies the questions and the visual-augmentations only where and when needed.

Now imagine that you’re cutting your workpiece. The AI system accessed the blueprint you gave it (downloaded it from your cloud-based data facility) when you said “Get the blueprint for the widget that I drew recently and cut this metal to that shape.” and begins cutting, all the while showing a virtual DRO (Digital Read-Out) with imaginary LEDs flashing the X,Y,Z positions in realtime.

Or it might say: “Your workpiece is too narrow along the Y axis for this item.”

Or it might make a hand or different pointer appear, pointing to the speed-changer levers and say: “You will need to set the speed to 1200 rpm.”  or remind you to “Move your tools clear of the cutting-area and ask that person beside you to please don his safety-glasses.”

If there is an object or piece of the machine that would block it’s motion — an A.R. red-flag appears and points to it: “This will obstruct my movement.”

Helping to show you what next to do on this machine (a milling-machine can be quite a complex kit of machinery), or to set your references, guide the cutting, change bits, etc. — these are all radical improvements to this process.

There is one essential point here:
Your incorporation of Augmented-Reality, in conjunction with careful application of AI and good UX-design, can radically transform a complex task into something simpler, faster, and safer. The improvement in productivity can be substantial.

The utility of this could be akin to having a human looking over your shoulder, who has a perfect pointer, who never gets distracted and never fails to identify a safety-situation.

I chose one specific application for AR here because it stands-out as a great need, in my experience — but it is not hard to imagine many other uses. Here I have touched upon some basic augmentations of the user-experience: pointing to things, confirmation of intent, giving a progress-report in realtime,  safety, instruction (again, using pointers of various types), and helping the AI-speech conversation via grounding it with actual illustration. If you want to get started with AR/VR you have several vendors to draw upon: Facebook provides the Oculus headset and SDK, and there is also Alphabet Inc., Samsung Electronics Co. and Sony Corp have or are preparing products for this field. I’ll be writing some how-to articles on this topic shortly.

I believe there is substantial fruit here, to be harvested by the visionaries who can see the possibilities and put it into action.

#augmentedreality #virtualreality

VRStockImage2

 

 

Posted in Artificial-Intelligence, Augmented-Reality | Tagged | Leave a comment

Simplifying your Software Design: Logging

The LogNut open-source project on GitHub is a facility that I created to do one thing: to simplify this one aspect of software-design. Logging.

NutWithMagnifier

In some of your best programming-environments you can type your code, make it RUN — and watch what it does. But not always. Sometimes you add logging statements to your code just to have some way to see what is happening. What you don’t want, is for that logging facility itself to be adding to the complexity of your endeavor.

I prefer my tools to be spartan and simple. I want them to just work. Always, and reliably. Without a lot of prep, reading, and thought — “just flip’n do it and don’t get in my way!”

This discussion is about the C# version of LogNut, on the Microsoft Windows platform, but the general design aspects apply to it’s other versions (F#, ASP.NET-MVC, Xamarin.Forms, Java, Swift, C++).

With a .NET application, the very minimum that you have to do to use a library (called as ‘assembly’ in the .NET world) is to reference it, and then call it’s API. Most logging frameworks have multiple other things that you must reference, configuration-files to prepare, documentation to read in order to figure out where those config-files must be located and where your output will go, etc.

I’ve eliminated the need for most of that. You can still do it (control the output-location, make use of config-files, perform extensive configuration of every detail) but you don’t *have* to. For example, this is a perfectly acceptable bit of code to output the text “Hey – this code is working” into a log file (a simple text file):

using Hurst.LogNut;
...
LogManager.LogInfo("Hey - this code is working");

And that is it. Where does it go? Since you did not specify, it goes into the one safe place that is always there for you — your ‘My Documents’ folder, into a folder called “Logs”. Since you also did not specify the name of the file, it is named after the name of your program that you are running, with “_Log.txt” appended so that you can open it by simply double-clicking on that file just like any other text file.

This is all clearly spelled-out in the library’s introductory documentation, it’s sample-code, and within the API itself.

What if you specify some other place to write the log to, but that place is not there (such as a flash-drive that has been removed)? It ‘fails-over’ and writes it to that same, fall-back location (‘My Documents\Logs’) but with “_REDIRECTED” inserted into the filename.

LogNut is a full-power logging library; you can totally do full-feature stuff such as:

var myLogger = LogManager.GetLogger("Message-Q");
myLogger.LogTrace("This is normal");
myLogger.LogDebug("Why is this executing?");
myLogger.LogError("Uh oh!");

and your exception-handling blocks can be accomplished with one simple line of code…

}
catch (Exception x)
{
MyLogger.LogException(x);
}

If you’re starting a new software-project in C# or any other of the supported platforms/languages and are contemplating what to select for your logging library, check it out:

https://github.com/JamesWHurst/LogNut

Posted in C#, Software Design, The Development Process | Tagged , | Leave a comment

A thought about the evolution of our UX designs

In the beginning we had widgets.  Buttons, textboxes, checkboxes, and static (not-interactive) text, on our user-interfaces (which I refer to here as “UX”).

That was in the days of purely desktop applications, running on Apple Macs, Windows, and Linux/Unix. As our display-screens gained higher resolution, our widgets became more detailed and visually obvious. Yeah, sometimes it was worthless eye-candy that only cluttered the screen. But often it was graphic design that served to help us — it made the widgets stand out so to help us identify what they were and how to use them. Every available action provided a button of some sort. And buttons were a metaphor for something physical — a BUTTON, and these could have a visual rendering that reminded us of that, such as 3D shapes, lighting and shading, textures, and a subtle animation that happened when you clicked on it (or touched it with your finger, where touch-sensitive surfaces were used). The original Apple iPhone and iPod seemed to be elevating this aspect to a new art-form. I loved that.

Then something happened. Buttons began to be replaced with links, some bit of text that you could click on. And those were not always rendered such that it was obvious. Touch-screens and mobile devices began to change the landscape, and Microsoft came out with their “Metro” look on Windows Phone and Windows 8. I liked the Windows Phone, but that Metro-ness caused me some major angst on Windows. On the tiny smartphone it made sense, and the layout was nice and efficient. On the desktop screen – it made no sense. Why have a 5K display-surface just to show a few solid blocks of color that force themselves over the entire screen?  Then Apple followed along, ironically wasting the fine work they’d done on their UX designs. 3D buttons evolved into simple rectangles of color, or just links. Sometimes, those links are so tiny and indistinguishable from the rest of the (often very tiny) screen, that they became hard to use.

Well, I’m unhappy. Snarl. Hiss. Boo.

I’ve a smartphone with a very high-resolution display surface, an impressive amount of computing power, and a very hard-to-use software design. WTF? !!!

Someone, has forgotten (or never learned!) the basic principles of UX design: make it simple, intuitive, and obvious.

Every major action should have a button (or icon, functioning as a button). And buttons should be obvious, and cover all of the common workflow-paths that the user may want to accomplish, from where she may want to do it. If you are looking at text messages, where is the “delete this text-message” button? Is it within that “all other actions” icon that is stuck up in the corner? Nope! Argh!!

This devolution in our UX-design has major consequences. I have missed crucial appointments because when I entered it into my Calendar, some field that escaped my notice was somehow not correctly set. Sometimes someone calls me and I look at my phone and cannot tell how to answer this call. And I still cannot reliably get into my own voicemail.

Yeah, after many decades of being a designer, I guess in some respects I am old-school. I respond to that accusation with the admonition that some basic rules of engineering do not, and should not be assumed to, change.

Posted in Software Design, The Development Process | Tagged | Leave a comment

Multi-threaded Programming Techniques, versus Message-Queuing

This is just a quick draft that I’ll expand later with some concrete examples.

For simplicity I’ll use “thread” here in a sense that is synonymous with “process” or “task”, in that it’s simply a concurrent path of execution, using whatever ready mechanism is provided by your chose programming-language.

Many developers, even those with substantial experience, often turn to “multi-threaded” methods in their designs to handle the scaling-out of their program’s workloads. I submit that in the context of an application whose workload may scale up by many orders-of-magnitude, this ought to be approached in a more circumspect way.

In such cases, allocating your program’s work to more threads on a per-user-request basis, can be counter-productive. I’ll explain with a simplistic example..

Let’s say your program is public-facing and is intended to serve users who logon and make requests. You have already dedicated threads to such major areas as the UI and writing a log. Now, when each user comes on and needs your program to serve er requests, you spawn a new thread that is dedicated to that logged-on user, and retire it afterward. Let’s also assume that you have already optimized this somewhat by using a thread-pool, to avoid the overhead of creating and destroying thread-objects for each user-logon.

The problem, here, is that regardless of what CPU your program is running on, you only have but just so many CPU-cores and thus just so many threads that can run concurrently. Your server might be running an Intel i7 that has 4 cores and 8 threads available (at most – many will also be allocated to the operating system and it’s many subsystems). What will happen if 900 users suddenly want to logon and make requests? 1-3 of them may get served fairly quickly, and then the rest are to some degree frozen, their processing-threads blocked while awaiting the others to complete. If these block awaiting access to low-level resources such as the disk or database, you may have race-conditions, or a massive logjam that fails completely.

There are some tasks that deserve to have a thread dedicated to them, which simplifies your design, and those should be few in number.

For those tasks that are truly variable, and can scale up dynamically from zero to any huge number — you may want to contemplate a different approach.

Consider the message-queuing (MQ) pattern. Here, you actually dedicate just one thread to serving all of those users, and yet it may run far more efficiently and much faster. Consider…

If the system places the user-requests onto a queue, in the form of discrete messages, and your service thread then runs asynchronously taking those messages *from* that queue and serving them one-by-one, you can very effectively decouple the system from this user-servicing job. If you do have more cores that are readily available to you – you may consider factoring-out various tasks such as database-updates to their own threads, wherein those tasks can run asynchronously to your main service-thread, but the job of servicing these messages is still kept to a low, stable number, and your server should not become thread-starved as your load scales skyward.

Within the context of this message-servicing task, your program is running synchronously, serving exactly one message at a time. By running each user-request synchronously, you can now protect your system against race-conditions far more easily, and efficiently in terms of speed. It serves the message, kicks-off the write to disk or database, etc. and completes it — and then proceeds on to serve the next message. No thread-spinup or spindown overhead, no unnecessary blocking, and that one thread should be now free to run full-bore.

The key is that the number of threads now does not balloon upward in response to your increasing load. It might still fail to serve a massive number of users expeditiously if your system just cannot keep up in terms of raw throughput, but with the right kind of MQ-strategy at least it won’t freeze-up and crash your system (ideally). It will just run as fast as it can, falling behind perhaps — but then catching up as soon as it can, like a loyal Greyhound who stops to sniff the grass but then runs to keep up.

There are several excellent message-queuing components available on the open-source marketplace, and most of those are intended for communication across networks. But when all components are to run on the same server, you can very easily implement this strategy with fairly simple code. In fact, I believe that often this is a far simpler way to go about it than most other approaches.

Simplicity, is golden. Always strive to achieve simplicity.

Please let me know your thoughts. Thank you.

James W. Hurst

Posted in Uncategorized | Leave a comment

Notes re ASP.NET MVC 5

Checking out ASP.NET-MVC 5 using Visual Studio 2013 Ultimate on Windows 8 x64, I’m seeing the following issues as of 2014-1-21:

1. Right off the bat – a lot of JavaScript runtime errors, with even just the initial skeleton web application that Visual Studio produces. See screenshot – this is from just launching the blank web application using Internet Explorer.

JavascriptErrors1
Google does not yield answers for this that I can see – although I do see a couple of complaints by other users. Evidently the consensus is that this can be ignored for now. I don’t find that very satisfying.

2. The Areas feature does not work consistently, or at least – not as advertised within their tutorials (Note: the capitalized “Area” indicates the ASP.NET-MVC feature of that name, as opposed to the generic word “area”). I can reach into an Area by typing the full URL into a browser window including a controller name such as “Home”. For example, I added an Area named “LostAndFound.” I can get to that by typing the URL with the suffix “/Home/LostAndFound/”, but not “/LostAndFound/”. ActionLinks from the main area into a particular Area do not work as claimed – you have to include the full namespaces argument to distinguish them. You cannot have a same-named controller class, contrary to the documentation claim. Google does not yield answers for this that I can see. Solution: Suggest avoid using Areas altogether. If you know the solution for this please leave a comment.

3. Compared to the skeleton web application that Visual Studio 2012 produced for MVC 4, the Images folder has been removed, and the CSS styles for unordered-list with the round graphic images for the list-item numbers – is missing. You can fix this by simply copying these over from another web application that you created for MVC 4, both the Images directory and it’s contents, and the CSS styles from Content/Site.css. I am not seeing any comments on the web as to why this was removed. I rather liked it.

4. Ditto for the aside element styling that had been in Content/Site.css I added that back in. Why was it removed?

Posted in Uncategorized | 1 Comment