Tim Patrick's Blog, page 15

September 6, 2016

New Book for C# Developers Now Available

Start-to-Finish Visual C# 2015


I am excited to announce my first book dedicated to C# developers. Start-to-Finish Visual C# 2015, released earlier this month, introduces C# and .NET concepts to beginning and intermediate software developers. It does this by doing what professional C# developers do every single day: create entire software applications, from start to finish.


More than a decade ago, I wrote Start-to-Finish Visual Basic 2005, my first introductory book for Windows developers interested in crafting software using Microsoft’s new .NET version of Visual Basic. Back then, C# was relatively new, and Visual Basic was the focus for most Windows developers, especially those writing software for a corporate environment. Visual Basic continues to meet the needs of millions of application developers. But as the .NET Framework has expanded into the world of web-based and mobile apps, C# has grown in popularity. This is due in part to its syntax similarities with Objective-C and Java, languages already popular with mobile developers on non-Windows devices. The time was right, it seemed, to make the training content from my earlier Visual Basic book available to budding C# programmers.


Start-to-Finish Visual C# 2015 covers all major aspects of C# language development, from the core concepts of data management and Object Oriented Programming, to advanced features such as cryptography and lambda expressions. And to put a bit of a marketing spin on this announcement, there’s never been a better time to learn C#. You used to pay hundreds of dollars to get a copy of Microsoft’s Visual Studio Professional, the main tool used to craft .NET applications. But starting with the 2015 edition, Microsoft has transformed that formerly expensive tool into the completely free Visual Studio Community edition. At no cost, it provides all the power needed to build Windows, web-based, and mobile applications using the recently open-sourced .NET Framework as its core technology. The only thing this platform lacks is a guide that teaches you how to use it. Start-to-Finish Visual C# 2015 solves that problem.


Start-to-Finish Visual C# 2015 is now available in both paperback and ebook formats from all major booksellers. Visit its Owani Press web page for purchasing links, and to download the associated sample code. For individuals and organizations that prefer Visual Basic and its more streamlined access to some of the boilerplate elements of .NET development, Start-to-Finish Visual Basic 2015, released earlier this year, provides the same coverage, but in a convenient Visual Basic package. For those who need to understand the how features of both languages compare, check out C#-Visual Basic Bilingual Dictionary, my reference book for .NET developers.

 •  0 comments  •  flag
Share on Twitter
Published on September 06, 2016 12:00

August 1, 2016

Fighting Fire with Light

FightFireLight


A few days ago, a Facebook Friend asked those on his timeline to provide their opinions about Obamacare. So, you know, just a friendly discussion. I came somewhat late to the conversation, but with more than enough time to turn off anyone who disagreed with me. This was going to be brutal.


In my opening salvo, I said that the Affordable Care Act, better known as Obamacare, was a net negative for my family. That triggered a response from someone I had never heard of, saying how great Obamacare was. I countered that, no, it was bad, and that it didn’t solve the problem anyway, since high prices are often the result of supply and demand issues and overregulation. He replied that supply is not the problem—there are freaking doctors all over the place. And besides, healthcare is a human right. I said that, no, it’s not a right like life and liberty are rights, and provided the historical background on what a right is.


It was at this point that he was well within his rights to call me a racist or invoke Godwin’s Law. But then something unexpected happened. This friend-of-a-friend—the bloke calls himself “David”—responded with this: “You do make a compelling argument. Let me stew on this for a bit.”


What happened? Here was a great opportunity for him to slam me with misleading statistics or post an information-free political graphic. But instead, this David character said that he wanted to take time to think about the discussion. Frankly, it felt extremely un-American, and it left me with a good feeling that I just can’t seem to shake.


I spent some time reading through our short dialog, to see if there was anything I did that would stop this David from being a typical Facebook jerk. We were both strong in our opinions, so that wasn’t it. I made it clear more than once that I disagreed with him, and he did the same, so those were points in each of our favors. As I looked through the postings, I was sure that the conversation would end up in a yelling match. How did it all go so horribly wrong?


And then I saw it, in the discussion about whether healthcare was a natural right or a legal right. What I saw was enlightenment. Or more correctly, The Enlightenment. In discussing the source and nature of inalienable rights, I researched online articles that drew ideas from Thomas Jefferson and John Locke, among others. In doing so, I inadvertently invoked the same sound philosophical concepts that America’s Founders used as the basis for the American Experiment.


It seems that there is something inherent in the writings of figures like Jean-Jacques Rousseau, Adam Smith, and Thomas Hobbes that trigger a different reaction than the unfriend-inducing bile one normally hopes to achieve on a forum like Facebook. By referencing centuries-old sources of wisdom, logic, and intelligence instead basing my arguments on whatever Safeway-quality luncheon meat happened to be floating around in my innards, I derailed the conversation into coherence and thoughtful pondering.


There is something to be said about the clarity and social stability that occurred through my misstep. Not only did I feel good about what this David guy said and did, I came away from the discussion thread believing that he possessed both wisdom and above-normal brain function. It’s not a caricature I normally apply to political ideologues on social media. Since this David is not my friend, I know nothing about him. And yet, in some strange way that stretches back past America’s founding, I know him quite well.


I might try more of this Enlightenment thinking. It’s not something I would recommend for everyone. I mean, if all Facebook users suddenly started behaving calmly and intelligently, where would the fun be in posting a controversial opinion? But for the Davids of the world, and perhaps even for the Tims, it might be just the thing.


[Image Credits: FreeImages.com/Erik Araujo]

 •  0 comments  •  flag
Share on Twitter
Published on August 01, 2016 12:00

June 15, 2016

The Age of Excess Faith

LittleWarrior


I have a friend who claims to be an anarchist. He’s not at all like those anarchists I read about in school or in the news: Emma Goldman, the renowned anarchist who tried to assassinate financier Henry Clay Frick; Ted “Unibomber” Kaczynski, who killed three and severely injured nearly two dozen others; or Leon Czolgosz, who shot and killed President William McKinley. My friend doesn’t seem like the murderous type at all. Instead, he and his modern anarchist pals have dropped the whole assassination and maiming thing, it seems, and instead are carrying out the propaganda of the deed by posting anarchy things on the Internet.


According to my friend, all the trouble in the world stems from government, capitalism, and authority. The United States in particular is apparently little more than a police state, with its officials regularly engaging in the “assault, kidnapping, and murder” of ordinary citizens, and its merchant class scheming to steal your property. He let me know all of this on Facebook, a capitalist-engineered tool running on the military-designed Internet, which he is able to access from his home, purchased or rented thanks to enforceable contracts, likely located on a pleasant paved road built in part with my money.


The anarchist promise is that a world purged of authority and government is preferable to the one we have now. Violence, coercion, and greed are legacies of societal institutions, they claim, and when those authorities fall, individuals will return to a state of nature, one where people are free, independent, and “awake” to governmental lies. In short, anarchists are promising true happiness, peace, and contentment, the same guarantees offered by the very politicians they claim to loathe.


The trouble with modern anarchists is not that they dislike government. Even someone as mainstream as Ronald Reagan stated openly that “government is the problem.” Their main failure is in believing that mankind would enter a more idyllic, tranquil, and just state in the absence of any government or social compact. In my friend’s anarchic posts on social media, there are hints of a time when government will be no more, when individuals, freed from the control of their political slave-masters, will commune with one another, offering happily what they have to others, and sharing in the joy of man’s evolution to a higher plain of awesomeness. The human heart, in such a view, is a tabula rasa that remains pure in the absence of government control.


In other words, modern anarchists are religious fundamentalists. My friend speaks of love and sharing replacing murder and slavery. He believes in true peace, a peace that comes from the human heart, one uncorrupted by the systems of the world. He looks for a future paradise, a joyous time of happy stability when the oppression of this Dark Age is whisked away. And he is always imploring me to “wake up” from my lost condition, fervent in his evangelistic call.


As a religious person myself, I can’t fault anarchists for looking to a better life, or using religious terms to advocate for their cause. But what I found unusual was the ease with which their faith replaced truth and logic in areas where faith wasn’t required. I recall one particular discussion where a few of us pathetic capitalists tried to talk the converted off of the anarchist ledge. We would mention their use of logical fallacies and those Facebook graphic memes that contained inaccurate data or blatantly false statements. The meme that got the entire conversation started was one claiming that police in the United States will use unmarked cars, while police in other countries do not. Such a claim is easily proved false, yet the anarchists would not endure any response that removed even a speck from the American police-state mantra. If anarchy is as essential and correct as they claim it to be, it can certainly handle the admission that a poorly crafted meme might contain errors.


Christians, at least in theory, differentiate between the supernatural and the temporal. Faith isn’t required for mundane earthly things, but only for those beliefs that fall outside of natural experience: eternal salvation, miracles, the existence of a spiritual realm, and so on. For things in the Bible that aren’t supernatural—the presence of Roman guards in the Jerusalem of Jesus’ time, as an example—plain old historical research and common sense take the place of faith. Certainly there are Christians who extend faith into areas where it doesn’t belong, such as when some insist that a quick one-chapter summary of creation by Moses is detailed enough to automatically cancel out scientific research. But in general, faith is for faith-things, reason is for everything else.


But that division is becoming rarer in our modern world. Misplaced faith shows up in our political arguments, when excitement over a specific legislative policy overshadows hard data about whether the policy even works. It appears in our schools, when we replace the boring, difficult rigor of study with lessons in self-esteem, and then express shock when test scores lag. And perhaps the biggest faith pilgrimage takes place during the two-year run-up to the presidential election, when each candidate’s obviously impossible promises are accepted as gospel truth.


The effulgence of excess faith stems from a core human desire for utopia, a place of respite from the injustice and partisanship of this age. It’s an understandable drive, but one built on the false belief that human beings are easily perfectible, or will voluntarily empty themselves of their own ambitions. Faith is a commendable attribute, but its misapplication to untruths invariably leads to disillusionment, conflict, and anarchy, the bad kind of anarchy.


[Image Credits: Dan Colcer]

 •  0 comments  •  flag
Share on Twitter
Published on June 15, 2016 12:00

May 24, 2016

Let a Thousand Senators Bloom


When people say that the US Constitution is a “living, breathing document,” what the really mean is that the amendments to the Constitution are pliable for modern use. But they often ignore the core document itself. The constitutional arguments for the right to privacy, abortion, and gay marriage, for example, come typically from the Bill of Rights and other amendments that followed the document’s initial ratification in 1788. When modern rights advocates play the Constitution card, they pull a Club instead of the Heart.


This snubbing of America’s core document has to end. The time has come for the One Thousand Senators Project. Article 1, Section 3 of the Constitution defines the construction of the Senate this way: “The Senate of the United States shall be composed of two Senators from each State, chosen by the Legislature thereof, for six Years; and each Senator shall have one Vote.”


Such clear language worked in the days before flush toilets. At its founding, the entire nation had a mere 3.5 million citizens, fewer if you invoked the three-fifths clause from Article 1, Section 2. Virginia, the largest state at the time, had around 700,000 people in it. Today, even tiny, perfectly rectangular Wyoming has almost that many. At a modern population of around 323 million, the nation is practically bursting its seams. And yet, we still just get a paltry two senators per state.


The Founders certainly never intended for us to be saddled with such an archaic system. The “composed of two Senators from each state” clause is more than 200 years old, from an era before the Common Core standards. With our advanced technology and understanding of mathematics, it’s shameful that a nation as powerful as ours still interprets the “two” in this clause as “two.” And the “six years…one vote” part: what’s up with that? The country has moved on.


I propose that, beginning with the 115th Congress that will convene in January 2017, the number of senators per state be increased ten-fold, to twenty each. The nation has multiplied a hundred-fold since its founding, and some might ask why we don’t jump right to the 200-senator-per-state level. Calm down people, there’s no need to be silly.


This limit on the number of state senators isn’t the only place where the Constitution puts a straightjacket on America. The Strict Constructionist view of the Constitution also shackles us to these tired clauses.



The Oath of Office listed in Article 2, Section 1 is boring and, frankly, way too long. If Twitter has taught us anything, it’s that brevity is the soul of wit and intelligence. “Dibs” is really all the president-elect needs to say.
Article 4, Section 4 speaks of a “Republican Form of Government.” Concerns over GOP misuse aside, the short-sighted vision of America as a Republic has held down other expressions of governance for way too long. The Republican focus on the “Rule of Law” is a slap in the face to other legitimate and world-tested systems such as Communism, Anarchy, and pure Democracy. Why shouldn’t every citizen have a vote on absolutely every miniscule speck of governance?
Article 3, Section 3? Treason? Give me a break.

In time, we will apply flexible standards to these and other core constitutional matters. But the Senate is an essential place to start. The needs of the country are urgent, and increasing congressional membership to 1,000 elected individuals or casual drop-ins will allow us take on the legislative task with a renewed vigor. With so many more hands to do the work, Washington, DC will become the new focal point of power and patronage, virtually eliminating the need for ordinary citizens to be concerned with civic matters. It is certainly everything that the Founders envisioned.

 •  0 comments  •  flag
Share on Twitter
Published on May 24, 2016 12:00

May 10, 2016

Against All Evidence


We all lie to ourselves. Some of these lies are harmless, almost humorous: “Is dinner ready? I’m starving!


Other lies carry a little more danger, such as saying to the barista, “Make it a grande. I worked out earlier today.”


Clearly, many of my own personal lies deal with food. But at this level, the consequences are mine to bear, and having a second helping of mashed potatoes doesn’t have that big of an impact on those around me.


But there is one lie we tell ourselves that has severe negative impacts on those around us. This lie is comforting at times, which is why we hold on to it so tightly. Every four years, we let this lie out of our heads and allow it to walk around in public, amidst our politicians, political parties, and fellow citizens.


The lie is that reality doesn’t apply to us.


This lie is a universal one, but Americans are especially prone to believe it. Repeated successes on the world stage have convinced us that things will always work out, no matter how many poor decisions we make, and no matter how many others have failed in the past.


The lie takes many forms, but increasingly it comes neatly packaged under the name of Socialism, or Democratic Socialism, if you prefer. A few years ago, a Gallup poll found that more than a third of Americans held favorable views toward Socialism, and the numbers have certainly risen with so many Feeling the Bern.


The allure is that Socialism is good for incomes, good for equality, and good for America. But it is not good, just as it hasn’t been good for the other nations that have run after it. We believe, against all evidence, that the benefits of Socialism will come to us without any of its problems. We believe that the reality of Socialism’s failings won’t apply to us. But it will apply, because humans are not interchangeable automatons that can be willfully programmed for perfection.


Socialism never results in true equality or satisfying incomes. In fact, it tends to make the divisions between rich and poor more stark, and institutionalizes the position of the powerful over the weak. A century of Socialist experiments across Europe and Latin America bear this out. It’s not because people aren’t trying hard enough to fix things. It’s because there are underlying realities that cannot be changed by brute force: people are not completely equal; life is not always fair; some people take advantage of others, and still others allow it.


Humans are complex bundles of conflicting abilities and desires, and attempts to “socialize” everyone to a specific pattern only tends to exacerbate the differences. Socialism says that, given the right leadership, it can make all things right, correct every wrong, and bring true equality and happiness to all. It’s a lie. A comforting lie, but still a lie.


Socialism is a lie primarily because everyone can never be equal within a human society. Even if you force everyone at gunpoint to behave equally, someone has to hold the gun.


Socialism does not hold a monopoly on the lie that reality doesn’t apply to us. There are plenty of proud Capitalists who believe that, if only the federal government will get out of the way, or if only we build a wall, riches and peace will come to these United States. Capitalism has certainly been good for America, and when configured well, is always preferable to Socialism. But just like Socialism, it is incapable of helping all members of a society because there is an underlying reality concerning the human condition that makes such goals impossible to achieve. It doesn’t mean we shouldn’t try. But we should also be honest about the reality of human interactions.


Americans have attuned themselves to the siren song of utopian fantasies. Politicians prey on our hunger for security and peace, promising us that if we vote them into office, pain will cease, the haughty will be brought low, and life will be fair. The claim that “we will end poverty in our generation” is enticing, but it is a promise that cannot be fulfilled, because it doesn’t accurately reflect reality.


No matter how many times we raise the minimum wage, no matter how many colleges we make free to students, no matter how high we impose taxes on the rich, there will always be people in poverty. It’s a miserable, terrible truth. But it is truth nonetheless. It is within the context of this truth that we reach out and help those in need.


Until we come to terms with the truth about human nature, and understand that there will always be trouble among individuals and groups, we will keep voting for politicians who get elected by lying to us. That’s the reality.


[Image Credits: Fox Broadcasting Company]

 •  0 comments  •  flag
Share on Twitter
Published on May 10, 2016 12:00

April 26, 2016

Democrats for Trump


If Donald Trump wins the 2016 presidential election, thank a Democrat.


Trump, of course, is running as a Republican, and his votes will come from those who align with the GOP. Yet it will still be a victory brought about by Democrats, especially left-leaning Democrats. This political group, more than any other in America, has spent the last seven decades building the conditions under which a Trump presidency becomes likely.


If the three branches of government—the Executive, the Legislative, and the Judicial—held a beauty contest among Democrats, the Executive would win every time. Democrats love the Executive branch and its elected official, the president. That’s because the Executive is charged with enforcing the laws of the land, and left-leaning political views—represented in America by moderate to leftist Democrats—require strong enforcement to be effective.


Although the three branches of government were designed to be co-equal, with checks and balances put in place to maintain this equality, those on the left have long viewed the Oval Office as the actual seat of power, with Congress and the Supreme Court doing the president’s bidding. This isn’t meant as an insult, but as an observation that in the Socialist-style Democratic worldview, enforcement of government mandates is seen as the most effective way to maintain the social order.


This view goes at least as far back as Franklin Roosevelt, who as president built the modern Democratic Party from its former regional splinter groups. When the Supreme Court ruled that some of FDR’s policies were unconstitutional, he attempted to pack the court by increasing its membership from nine to thirteen, adding four new justices who would vote in line with his policies. For Roosevelt, the Judicial Branch was meant to be subservient to the Executive.


Just last week, Chelsea Clinton confirmed this view, stating in a campaign speech in Maryland that her mother, as president, would direct the court’s decisions. In speaking of gun control issues before the court, Clinton said, “The next time the Court rules on gun control, it will make a definitive ruling,” implying that a President Hilary Clinton would make sure of it.


Democrats hold similar Executive-first views when it comes to Congress. It’s no mistake that the Affordable Care Act is commonly known as “Obamacare,” or that President Obama is proud of that moniker. Whether it is energy policy or healthcare or social concerns like gay marriage and gun ownership, Democrats look to the power of the presidency both to set the tone and to make things happen, through Executive Order if necessary. The current Democratic president, Barack Obama, boasted proudly of this power, the power of “fundamentally transforming the United States.”


Many Americans fear a President Donald Trump or a President Hilary Clinton because they believe, and rightly so, that the power available to such a president could bring real danger to the nation. If the power of the United States was still “reserved to the States respectively, or to the people,” or if that power was divided more evenly between the three federal branches, the fear of such abuse of power would not be as great. But the Democrats, especially in their more left-leaning moments, made sure that such populist views were pushed aside.


Today’s Republicans are no less to blame, seduced as they were by this same desire for easy power in a single political package. But it was the Democrats who long embodied this utopian ideal of a glorified, all-power Camelot. The Democratic Party successfully built up the image of the president in the eyes of the public, so that it is now the focus of nearly all electoral thought in America.


Donald Trump, as president, would be an Executive Branch-lovers dream, and although they will vote against him, he is also what Democrats have been hoping for in a president.


[Image Credits: Donald Trump photo by Michael Vadon, under a Creative Commons license.]

 •  0 comments  •  flag
Share on Twitter
Published on April 26, 2016 12:00

April 5, 2016

New Visual Basic 2015 Book Now Available!


Start-to-Finish Visual Basic 2015, my latest book on software development, is now available from many popular online bookstores. An update to the 2005 original, the latest edition of the text has been fully revised with details on all new Visual Basic features added over the past decade. The accompanying source code is also fully updated, with major enhancements stemming from the new ways that Visual Basic is used by developers in 2016.


The paperback edition weighs in at nearly 600 pages. For those looking for a book with a lighter carbon footprint, consider the MOBI (Kindle) and EPUB (everything else) ebook editions. For more details about the book and a partial list of online stores that sell the book, visit the Start-to-Finish Visual Basic 2015 page on the Owani Press web site: owanipress.com/STFVB2015. While you’re waiting to click that link, read through the back cover description for the book.



Nobody learns a programming language just to brag about writing loops. Instead, languages exist so you can create great software. That’s the purpose of Start-to-Finish Visual Basic 2015, to show you how to write a complete, useful, working application in Visual Basic and .NET.


Each chapter introduces essential Visual Basic concepts, and shows you how to apply them by crafting a full business-level application. With this comprehensive book, you will:



Understand how to design and implement .NET applications
Learn the core features of the Visual Basic language
Access and modify database content using ADO.NET
Perform advanced development activities, including cryptography and localization
Master cool VB features, such as Generics, XML Literals, and LINQ
Get a head start on programming via the downloadable source code

Whether you’re new to programming, or want to add Visual Basic to your existing skillset, Start-to-Finish Visual Basic 2015 will guide you step-by-step through the learning process.


 •  0 comments  •  flag
Share on Twitter
Published on April 05, 2016 12:59

October 14, 2015

There Is No Life on Mars


I once made a kid fear yogurt. I swear it was an accident. It was about fifteen years ago, and I was explaining to my son and some of his young friends how yogurt is full of active cultures—real living things. One girl’s eyes got real big, and I’m pretty sure that she avoids all milk products to this day.


My son’s friend was fascinated (read: terrified) to hear that living things existed where they weren’t expected. That same fascination seems to pervade the general population when it comes to water in space. Every time there is a scientific announcement of water being found somewhere in the universe other than on Earth, news outlets insist that it is a clear, absolute, definitive, unwavering, eternal, and very probable sign that there might be a chance that somehow life is teeming in that remote puddle, maybe. The assumption that remote sources of water must harbor life has appeared in articles about distant Earth-sized planets, just-right “Goldilocks” planets from which aliens may be looking at us, and even Earth’s own deep oceans, which surprisingly has lots of water, and is on Earth.


Water is certainly everywhere. In 1998, NASA launched its Submillimeter Wave Astronomy Satellite (SWAS) to better understand star and planet formation. According to a NASA summary of the mission, “Water, a key component for life, is prevalent throughout space. Water was detected in almost every dust cloud in space observed. High amounts of water were found in warm gas, while very low amounts of water were seen in cold dense gas.”


Despite being “a key component for life,” water is not life. It’s a great medium for life to work and play in, but by itself it is dead. Its core molecular structure includes no carbon, no nitrogen, and no body parts. And thanks to pervasive levels of radiation and temperatures near absolute zero in all but a few extremely tiny pinpoints of interesting density (such as planets), most water exists in sterile, lifeless regions.


Last month, NASA held a news conference announcing the discovery of fluid water on the surface of Mars. Once again the expectation of life began, with “boost” being the required journalistic term.



“Boosting hopes for life.” (CNN)
“Liquid water flows on Mars today, boosting the odds that life could exist on the Red Planet” (Christian Science Monitor)
“The search for extraterrestrial life has gotten a big boost from NASA’s stunning announcement” (Japan Times)
“Now the search is on to find living organisms on the red planet.” (The Guardian)

The UK’s Independent saw fit to bump the Earth out of its orbit, headlining that “life might have started on Mars and come to Earth on a meteorite.”


Even NASA, who should know better, got into the let-there-be-life frenzy. John Grunsfeld, a five-time astronaut and current administrator for the agency, said that water on Mars “suggests that it would be possible for there to be life today on Mars.”


Why do news outlets and reputable scientists jump on the pro-life bandwagon every time there is a discovery of a little more moisture in the galaxy? The reason, even if it is not stated outright, is a desire to answer the probing question of why we are here on Earth.


There are only two possible reasons why life exists on Earth. Either some intelligence—God or super-smart beings from a parallel universe—created it intentionally, or it happened by accident. For those who believe in a Creator, the question of life on other planets may be interesting, but it doesn’t alter the dynamic of life. Life is awesome, but the giver of that life would be awesomer.


For those who view life as a chance happening, the question of whether life exists elsewhere becomes much more existential. The laws of physics, stars and planets, cells and DNA, organs and organisms; all these things are complex, to the point where it is difficult to comprehend how they all came into being by chance, and with such quality. Evolutionary theory does a fairly good job at describing the differences between existing species. But there are no answers for most of what makes life possible. What caused the Big Bang? Why is there stuff? What is gravity? How did the first biological thing form in the first place? Why does Earth provide such a great habitat for life?


Some of these questions are not only difficult, they might be unknowable. In such cases, “I don’t know” becomes indistinguishable from “It was all an accident.” It’s like asking a young child why there is a giant grape juice-colored stain on the carpet. “I don’t know.”


It’s not due to a lack of effort by scientists, or a lack of smarts. The eminent scientist Stephen Hawking, among others, has advocated the “multiverse” hypotheses as an explanation for our existence here. He understands that the universe is just too amazing to have been a one-off accident. The multiverse theory posits that our universe is just one of many, possibly infinite, universes out there, each with its own accidental properties. This increases the odds that some of them, or at least this one, has life for the good reason that you are bound to have life show up given enough chances. However, the theory can only be validated if you can show that these other universes exist, which given the closed nature of our physical universe, is unlikely.


A similar idea holds for water in the universe. Call it the “multiwater hypothesis” if you like. Given enough pockets of water, some of them are bound to have life in them. If so, then life must have been a chance event, and all it needed was enough chances. The problem is that if there are no other wet spots in the universe with life in them, then the multiwater hypotheses remains nothing more than an unproven multiverse-like theory. But if you can find life teeming in some other body of water, then you have a good chance of declaring life a complete random accident.


The question of whether life exists elsewhere in the universe is, by itself, not a thing that separates theists from atheists and agnostics. There are plenty of God-fearing Star Trek fans in the world, after all. Movie franchises like Star Trek and Star Wars are nothing more than fictional speculations about the state of the universe, and don’t matter that much when dealing with the ultimate questions of life. But for many people, the presence of water in the universe brings hope that yogurt isn’t the only thing with unexpected life.


[Image Credits: http://pandasthumb.org]

 •  0 comments  •  flag
Share on Twitter
Published on October 14, 2015 12:00

October 5, 2015

Software Review: Instant C# and Instant VB

Tangible Software


Visual Basic and C# represent two sides of the Microsoft Visual Studio coin. Though they began with very different purposes—Visual Basic as a simpler interface to powerful computers, C# as a powerful replacement for simpler assembly language systems—they now provide nearly equal access to the Microsoft Windows platform and beyond.


Arguments persist about which language is better, but thanks to Tangible Software Solutions’ Instant C# and Instant VB conversion tools, the arguments are mostly irrelevant. Using these tools, you can convert language snippets, ASP.NET pages, or entire projects between the two languages. The resulting code is, in many cases, ready for you to compile and use at once, although you will probably want to pass through the converted source and make adjustments based on each language’s strengths and weaknesses.


Note: Tangible offers Instant C# and Instant VB as two distinct software products. Except for the order of the languages involved, they are basically the same product. I tend t convert content from Visual Basic to C#, and not as much in the other direction, so this review focuses on the Instant C# tool.


The main user interface is nothing to get excited about: one button used to browse for the source project, another for the destination folder, and one that says “Convert.” Tangible tried to gussie things up with lists that display conversion statistics from prior uses of each app. But why worry about the interface when the goal is to spend as little time within the program as possible? The real magic appears in the new .NET project that the tools generate, and you will typically use Visual Studio or your favorite code editor for that.


Despite the muted user interface, that Convert button does wonders. Conversion from input to output is fast. Some of the smaller projects I’ve converted took less than a second. My largest project, a 215,000-line desktop behemoth with 240 forms took just over four minutes. In this mobile-enabled instant society, four minutes seems like an eternity. But here’s what happened during those four minutes: Instant C# wrote a nearly functional 215,000-line C# application. That’s wild!


The resulting code is as decent as the original project: Garbage In, Garbage Out is an issue here, but it’s your issue, not Tangible’s. Consider this Visual Basic code as food for Instant C#.



pre.CodeBlock { line-height: 125%; font-size: 10pt; }
span.CodeKeyword { color: #008800; font-weight: bold; }
span.LesserKeyword { color: #000000; font-weight: bold; }
span.DataType { color: #333399; font-weight: bold; }
span.Literals { color: #0000DD; font-weight: bold; }
span.ClassName { color: #BB0066; font-weight: bold; }
span.MemberName { color: #0066BB; font-weight: bold; }


  Public Class Form1
  Private Sub Button1_Click(sender As System.Object,
  e As System.EventArgs) Handles Button1.Click
  MsgBox(GenerateMessage("Barack", #8/4/1961#))
  End Sub
  Private Function GenerateMessage(ByVal firstName As String,
  ByVal birthDate As Date) As String
  ' ----- Format a nice greeting.
  Dim age As Integer
  age = Today.Year - birthDate.Year
  If (Today.Month < birthDate.Month) Or
  (Today.Month = birthDate.Month And
  Today.Day < birthDate.Day) Then
  age -= 1
  End If
  Return "Hello " & firstName & ", you are " &
  age & " years old."
  End Function
  End Class

The conversion generates equivalent, good-looking C# code (some lines rewrapped to fit this article’s display area).



  public partial class Form1
  {
  internal Form1()
  {
  InitializeComponent();
  }
  private void Button1_Click(object sender,
  System.EventArgs e)
  {
  MessageBox.Show(GenerateMessage("Barack",
  DateTime.Parse("8/4/1961")));
  }
  private string GenerateMessage(string firstName,
  DateTime birthDate)
  {
  // ----- Format a nice greeting.
  int age = 0;
  age = DateTime.Today.Year - birthDate.Year;
  if ((DateTime.Today.Month < birthDate.Month) |
  (DateTime.Today.Month == birthDate.Month &
  DateTime.Today.Day < birthDate.Day))
  {
  age -= 1;
  }
  return "Hello " + firstName + ", you are " +
  age.ToString() + " years old.";
  }
  }

It looks like C# to me. Granted, there are some interesting changes. All identifiers now include initializers, as with the “age” variable in the sample code. That’s because most initialization is optional in VB, but required in C#, and Instant C# knows this. It also favors explicit conversions, including the addition of the “ToString” method on the “age” variable when concatenating the result, again a reflection of differences between the languages. And don’t worry about the missing “Handles” clause from Button1’s Click event handler. Its match has been moved to the form’s code-behind file, exactly where Visual Studio would place it in a new C# project.


Despite the converters’ language knowledge, not everything comes across in a ready-to-compile state. Each language includes “issues” that don’t translate well to the other. For instance, there is no “On Error Resume Next” construct in C#—no unstructured error handling at all—so that statement shows up in the C# result unmodified other than the addition of an accompanying warning comment. Likewise, C#’s “unsafe” keyword doesn’t do well in move to VB. Any code in an unsafe block is simply commented out in the new Visual Basic project.


Some aspects of the converted code may introduce subtle differences in how your code manipulates data. For example, Visual Basic’s conversion methods (CInt, CDate, and so on) forgive a multitude of data sins that aren’t even considered in C#’s System.Convert equivalents. Tangible’s tools convert these language components without any warnings on the assumption that you are a good programmer and know better than to let questionable data touch your language’s magic keywords. Still, any conversion, even a manual conversion, is going to be imperfect, and with Instant C# and Instant VB doing at least ninety percent of the work, who’s complaining?


For that final ten percent, you might want to reference the pages of the C#-Visual Basic Bilingual Dictionary, written by your humble reviewer. It provides C# equivalents for every Visual Basic keyword, and vice versa, along with caveats and warnings that you should think through after Tangible’s super software has done its work.



Each Instant… tool includes an options panel that lets you adjust some of the conversion specifics, both for things that impact the output logic and for aesthetic differences. (The options panel from Instant VB appears here.) Each program also converts project files, configuration files, and other supporting elements of your project. It does a good job at leaving things it doesn’t know how to convert untouched. For example, a typical .vbproj file contains configuration items that aren’t useful in the equivalent .csproj file. These XML elements simply come across into the new project file, just in case they are needed later.


Although I started my programming career decades ago in the C world, I’ve focused on Visual Basic for much of the last twenty years. But I find myself moving back to my C-language roots, and Tangible Software Solutions’ Instant C# is a regular part of that migration. I use the tool weekly, not only to convert some legacy code from nearly fifteen years ago, but also to save time when grabbing code snippets off of MSDN and StackOverflow.


Tangible also offers converters that move code between C++ and Java, and between those languages and the C# and VB platforms. If the C# and VB versions are an accurate gauge, then the Java and C++ variations will be fantastic. I’m proud to give the tools Five Crocodiles, my highest rating. To find out more about Tangible Software’s conversion tools and other products, visit their web site, www.tangiblesoftwaresolutions.com.


Five Crocodiles

 •  0 comments  •  flag
Share on Twitter
Published on October 05, 2015 12:00

September 15, 2015

Review: The Martian


Over the last month or so, YouTube’s attempt to curate a video experience personalized to my tastes resulted in the latest Hollywood viral videos for The Martian showing up in my and everyone else’s video queues. So when Amazon tempted me with the Andy Weir book on which the movie is based for just $1.99, the cheapskate in me jumped at the deal. Despite being placed in a fictional near future where mankind has already done the legwork to put a team of scientists on Mars, the book is about as close as you can get to a true, modern account of a smart man marooned on a stupid planet.


If you’ve seen the movie previews, then you know the setup: a mission to Mars ends in an abrupt abort due to a violent dust storm, and in the hurry and confusion to leave the planet, one crewman gets left behind. It’s like Home Alone, but with freeze-dried ice cream. The radios are all dead (of course), there’s not enough food or water to last until the next scheduled visit to the planet (naturally), and don’t get me started on the complete lack of emergency escape pods. I kept expecting Kate Winslet to show up and drop a diamond necklace out of an airlock. But the planet has one essential resource that will bring the story to a happy ending: Matt Damon—excuse me, I mean Mark Watney.


Watney is part biologist, part engineer, and full time nerd. Using the resources left at the Mars habitation site (spoiler alert), he is able to generate sufficient dihydrogen monoxide, create a makeshift communications system back to NASA, and deck out a nearby minivan with enough life support to get him to the rendezvous site more than 3,000 kilometers across the barren surface of Malacandra. Just don’t ask me to describe how he obtained the fertilizer needed to grow his own potatoes.


The book is exciting, at least if you are the type of person who enjoys instruction manuals on how to rebuild a carburetor. Consider this gripping section from about the two-thirds point through the book.



The regulator analyzes the air with spectroscopy, then separates the gasses by supercooling them. Different elements turn to liquid at different temperatures. On Earth, supercooling this much air would take ridiculous amounts of energy. But (as I’m acutely aware) this isn’t Earth. Here on Mars, supercooling is done by pumping air to a component outside the Hab. The air quickly cools to the outdoor temperature, which ranges from -150°C to 0°C. When it’s warm, additional refrigeration is used, but cold days can turn air to liquid for free.


Yes, it is that riveting. A big chunk of the text is devoted to minutiae like this. Despite being a fan of science, there were a few moments when I wanted the author to just give the condensed Ikea version of the details and get the story moving. And yet it’s a good read, with reasonable pacing, periodic action and suspense, and an enjoyable narrative voice. For you geeks out there, there’s also the technical accuracy. In a postscript to the book, the author discusses the process he went through to complete the story, which included releasing the book in serial form to a world hungry for Martian castaway stories, and incorporating feedback from real rocket scientists into the final text.


The movie release is still a few weeks away. It will be interesting to see what Hollywood does with it given its nerd-centric storyline. The book has no bloodthirsty aliens or out-of-control robots, no superheroes swooping in to save the day, and nothing approaching romance, other than a few mentions of things that might have been if geeks weren’t involved. Instead of these movie staples, the story has the protagonist moving rocks, building and rebuilding his house, driving for thousands of kilometers without much to do or see, and disco music.


If the book does have a major flaw, it appears in the form of the happy ending. From the very first page, you can tell that everything will turn out all right for Watney. The Martian is that kind of book, that is: American. Or at least modern American. This book is no Uncle Tom’s Cabin or Huckleberry Finn. Although it lauds human ingenuity, it says very little about the human condition. Perhaps that’s why the book is called The Martian instead of The Human. Challenges arise, but with a little elbow grease and some engineering skills, all will be well. It’s an American story because that is what we’ve come to expect. Our superheroes—or in this case, our ordinary heroes—will rescue us.


At some point in our history, our storytelling became one of easy solutions. From the sitcom to the Hollywood-bound novel, the challenges given to us are now those that we already know how to overcome. It’s a storyline devoid of the complexities of life, and one that does little to prepare us for the real world. In The Martian, there are no terrorists, no petty international disputes, no electoral recounts. A big part of the story involves China giving up years of research and billions of dollars to help the United States rescue its abandoned astronaut. I hope that would happen IRL, but experience tells me that some underhanded politics would need to take place to bring about that level of international cooperation. Not that I’m cynical.


Don’t get me wrong; I really enjoyed The Martian. I’m just the type of technically adept literary lightweight that is the book’s target demographic. But it is pure entertainment, to the point where I seriously fear what would happen to the human race if we ever migrated to Mars.

 •  0 comments  •  flag
Share on Twitter
Published on September 15, 2015 12:00