Code Trinkets are a Bad Idea

Often when engaged in the construction of some piece of software, be it a web application or a native computer game, we get the Feature Fever. Our brains are trained by years of computer use to judge software by its polish. The tendency is misguided at best, and we try to think past it when fairly evaluating a prototype. But the fact of the matter is that even one or two polished aspects of a website makes it look better.

THIS IS A TRAP!

When you imbed a YouTube video or add rounded corners to your buttons, you are deceiving yourself. When you look at the screen, your eye is drawn to these familiar, visually impressive elements. Consequently, you subconsciously ignore or undervalue the unfinished parts of your project.

This leads to two things. First, you think you are farther along than you are. But more importantly, it makes you hungry for more features. Since one or two polished aspects look good, why not add more? Now you are on the hunt for short-term fixes that give big rewards in terms of visual polish, rather than working on the code that actually makes your program work.

If you start polishing before your core functionality is complete, you can get pigeonholed. When an interface element is polished, or some other unique feature looks amazing, you reflexively want to protect it. Even if the rational decision is to get rid of it and integrate the functionality somewhere else, you will keep the feature there. Letting form overpower function is a deadly trap.

The easiest way to add a polished feature is to search on the internet for code trinkets. Code trinkets are little snippets or blocks of code that you stick into your programs. Code trinkets are encapsulated, so all you have to do is paste and reload. Suddenly a beautiful new feature is completely finished.

Unfortunately, code trinkets have two downsides: they restrict your feature to exactly what is written, and they don’t leave you any smarter. Unless you take the time to figure out what ever line of the trinket does, and would be able to write it yourself (at which point it stops being a trinket), don’t use it!

Advertisements

Javascript

Honestly I’m not sure who thought it was good idea to make this language. I’ll admit its better than PHP, and I understand that some people actually enjoy using it. For instance, there is a web server written completely in JavaScript (hence my comparison to PHP). This boggles my mind.

My main issue with it is that there are no high level features built inherently into the language. For instance, there isn’t even an agreed upon method for importing other JavaScript files. Inheritance? Going to do some pretty messy hacks in order to get something that acts like an inheriting class structure. How about maps (aka dictionaries)? Objects and maps are the same thing. Arrays are basically just hash-maps for non-negative integers.

I suppose it’s about interesting exercise in thinking. Treating every structure (including classes and functions) as variables had its upsides. Ultimately, though, you have to use it whether you like it or not. There’s no substitute for the client-side functionality it provides. CSS can only go so far. When you start looking at something like AJAX, it makes you cry simultaneously at the pain of working with it and in joy for all the opportunity it provides.

The reason I have been thinking about and working with JavaScript (although only dabbling, of course) is that I’ve been taking another course at Udacity. This one is on game development in HTML5. Before this course, I really had no idea what HTML5 was. I had heard it mentioned, but then it all blew over. HTML5 is, to the best of my understanding, a standard that introduces some new HTML elements and JavaScript standards that lets developers manipulate pages in more creative ways.

For closing thoughts, I’ll leave you with this hilarious “talk”:

Programming Paradigms

Computer science is a relatively young field, and it has rapidly evolved ever since its inception. This becomes increasingly evident when you look at computer science being taught versus computer science being used. This is extremely apparent in the misnomer: computer science. CS is more technical art than science.

For a long time, computers had finite computational resources and memory. Today, our average consumer-grade computer is comparable to a super computer from 1985. Thusly, the twenty first century requires programming paradigms far different from those taught in the twentieth century. It no longer pays off to optimize the number of calculations or amount of memory your program uses, unless you are specifically performing mathematically intensive operations. This blog voices that sentiment much better than I can.

So programming now is about implementing an idea. Its easy to rise above the technical nitty gritty details and focus on the concept at hand. Then programming becomes a form of poetry, in which you express your ideas in a structured and rhythmic way. Programming, at a consumer level, is no longer about getting a machine to do what you want; its about empowering people.

Just like a poet spends many hours revising their verses and getting the words to say exactly what is meant, a programmer spends hours rearranging and improving code to fulfill their idea effectively. And like poetry, there are many genres and styles of programming. Unfortunately, programming is also like poetry in the way that many students get turned off to it by the experiences they have with it in school.

Programming should be taught with the main objective in mind: we are here to accomplish a mission. Writing mechanics are practiced and improved, but without an idea behind a poem or story, it is pointless. Algorithms are important, and so is project design and planning. But these are merely implements with which to express the programmer’s idea.

This is why the most successful software is easy to use, is powerful, or grants people an ability they didn’t have before. When you use a program, it doesn’t matter whether all the variables are global, whether the project was built top-down or bottom-up. The functional differences of some of the most disputed methods are miniscule. Optimization is a trivial concern when compared with the user interface. Is the parse speed of one file format more important than the support of a larger number of formats?

Kids want to be programmers because of coding heroes like Notch, the creator of Minecraft. But Minecraft isn’t well-designed. In fact, the program is a piece of crap that can barely run on a laptop from 5 years ago despite its simplicity. But the idea is gold, and that is what people notice. This is why Minecraft and Bioshock, and not COD, inspire people to be game developers.

However, functional programming is the CS taught in schools. Schools need to teach the art of computer science, not only the science. Imagine if writing was only taught, even up through college, in the scope of writing paragraphs. Essays and papers would just be a string of non sequiturs (kind of like this blog). Fiction would have no comprehensible story, only a series of finely crafted paragraphs. Only those who figured out the basic structures of plot, perhaps by reading books by others who had done the same, would learn to write meaningful stories.

In the future, everyone will be a programmer to some degree. At some point data will become so complex that to even manipulate information people will need to be able to interface with data processors through some sort of technical language in order to describe what they want. To survive in a digital world you either need software to help you interface with it, or learn the language of the realm.

Yet children are being driven off in droves because computers are being approached in education from completely the wrong angle. Computers are tool we use to accomplish tasks; the use of computers should not be taught just because “people need to be able to use computers in order to survive in the modern world”, but because children will be able to implement their ideas and carry out tasks much easier if they do have an expanded skillset on the computer. Computer skills should be taught in the form of “how would you go about doing X? Ok, what if I told you there was a much easier way?”

History is Cool

I’ve seen some talk about education pop up both on Twitter (Twitter is awesome) and in real life. It’s fairly apparent to many people that education ain’t what it used to be. Which is, to some degree, true. But the fact of the matter is that education hasn’t changed so much as the role that education needs to fulfill. I believe I’ve described in an earlier post the shift from industrial to post-industrial education, but I’ll reiterate.

After the industrial revolution, the demand for factory workers was high. Factory workers only need minimal education, about up to the elementary school level. These blue collar workers would become manual labor. Those who were smart enough went to high school, and became white collar workers. A select few of those people would go to college and become doctors, lawyers, scientists, judges, etc.

The parallax between then and now is obvious. As the demand for laborers has decreased and the demand for engineers has increased, more and more people are attending college. Unfortunately, the education system has not responded well to this influx. The collegiate system has become bloated as it tries to accommodate the new waves of people who need a college degree to get a decent job. The world has lost sight of the true reason for getting an education; although a person does get a certification as a result of attending college, their objective should be to learn.

Public education in elementary schools and high schools has also done a shoddy job of flexing its methods to prepare students for the constantly changing future. For example, children were discouraged from becoming artists 20-30 years ago, yet there is a high demand for creative people to create all sorts of digital media. As a modern example, elementary school curricula stress plate tectonics and other basic geology, drilling it into students’ heads year after year. That may have been necessary 40 years ago, when the theory was young and a majority of people still distrusted it, but now it is commonly accepted fact and there is no reason to stress it.

Not only is early education slow to change with the times, but it actively discourages children, intentionally or not, from learning some necessary skills. For example, the vast majority of people I talk to, even students at TJHSST (one of the top high schools in the country) haven’t seriously read a book (and certainly not for enjoyment) since the 3rd grade. The early grades have given them such a bad experience with reading that they dismiss all books as boring. This, quite obviously, is distressing. Disillusioned and lazy teachers teach interesting subjects like history and math in ways that turn children off, perhaps for life.

But history is cool. Yes, it’s also boring. But so is math, science, programming, reading, writing, foreign language, and sports. My point is, every subject has areas that are uninteresting to the uninitiated, and EVERY subject can be taught in a manner that makes you want to eat your own skull rather than listen to another second of it. The key to teaching a subject is show the student that it is awesome, and then start teaching the basics. Most importantly, though, make sure the student realizes that the field extends far beyond what they are learning right now.

Here are some examples of sweet historical events/times/people:
-The transition from Roman republic to empire
-The Battle of Agincourt
-The Fall of Constantinople
-The Mongols beating the crap out of everyone and being awesome
Nikola Tesla
Charles Babbage (way cooler than Tesla)

But not only are there examples of people who were incredible badasses, but even periods of history like the colonization of North America and the Middle Ages are inspiring. I find that whenever I read a textbook, my mind drifts off as I build a science fiction or fantasy universe which mirrors the status quo of that period in history.

But I digress. Essentially, learning is REALLY FUN. It can also be THE MOST BORING EXPERIENCE EV-OH MY GOD I JUST WANT TO TEAR MY FACE OFF WHY IS THIS SO UNINTERESTING.

Come on guys (yes, you). Step it up.

I’ll end with a quote from Saul Perkins: “My thesis is that 21st century parents should teach their kids three languages: English, Mandarin and coding. Software is so much a part of our lives to today that this is just a fundamental skill that people need.”

Unity and tjSTAR

Here is a soundtrack for this post:

Everybody should use Spotify. It’s like magic, but real.

So I wanted to talk about Unity. For those who don’t know, Unity is a game engine. But it’s way for than that. The best way to describe is an IDE for game development, similar to UDK. Every part of the development cycle (aside from asset creation) can be done within the program, from placing assets to creating game object behavior to playtesting. The engine also has built in support for pretty much anything you would want to do. Behavior is described through scripts, which can be written in JavaScript, C#, or Boo (which seems to be a Python/C# hybrid). Assets can be imported from almost any file format, without external conversion. For instance, any 3D file format that can convert to FBX works, and image formats from PSD to PICT. Unity constantly checks for asset changes and updates them in realtime.

A good analogy involves programming languages. UDK is like Java, while Unity is Python; Source is C++. You don’t really understand how much annoying background work you are doing with Source until you start using Unity. However, unlike Python, Unity has an enormous learning curve. This comes from its being extremely powerful. I’ve only just started working with it (a few days) and I can see that there is a huge amount of potential. I also still have no idea how to most of anything.

The event that sparked interest in Unity was tjSTAR, an annual symposium held by my highschool. In addition to Design Challenge events and student presentations, there are also panels and professional talks. I attended 5 talks, all of which were fairly interesting.

Game Design and Development as an Academic Path and an Industry
This presentation is an in-depth look into majoring in game design in college, what universities offer the best programs, and how to get in; accompanied by an overview of the game industry and the careers it offers.

Mr. Danny Kim
Student
University of Southern California School of Cinematic Arts, Interactive Media Division

This was the presentation that got me interested in Unity. Of course, I had seen it before, such as at SAAST(the computer graphics course, specifically) when we looked at projects the undergraduate students had been doing, they used Unity for the most part. Danny Kim (a TJ alumni himself) also talked about how TJ is a great source of talent, both due to the large number of talented programmers, but also the great writers and artists. Any interested reader should check out his blog, See Play Live.

Big Data: What Is It and How to Cope With It
With the digital world enveloping our lives through mobile devices, digital home appliances, digital sensors and controllers, and video, data growth is expected to be massive in the coming years pushing into peta and zetabytes. Of this data, only 5%-20% will be structured. Find out how is the technology world is preparing to cope with this onslaught.

Ms. Rumy Sen
President & CEO
Entigence Corporation

This talk was about processing large amounts of data, especially sampled from online sources and social media. The objective is to analyze the whole of customer feedback across the Internet rather than from small testing sessions performed by marketing and consultant companies. However, this requires entirely new structures for storing and processing the data into a usable form. She talked about Hadoop and other forms of managing unstructured data that differed from conventional database methods, as well as processing methods such as massively parallel processor arrays.

Computer Vision: Challenges and Applications
Computer vision is the art of teaching computers to see and to understand what is in images and videos. The presentation will discuss some of the key challenges, and show practical applications.
Dr. Peter Venetianer
Director, Commercial Science Development
ObjectVideo

Computer vision is obviously interesting. The big brother of computer graphics (the two are inverse problems), it has stumped researchers for decades. The first professor to attempt the problem was sure that a summer with a lab of grad students would solve it fine. Now, 50 years later, we are starting to make some headway. Dr. Venetianer discussed some of the methods for separating critical objects from a noisy environment. Spotting movement from a fixed viewpoint is fairly easy. If you have three consecutive frames, spotting moving objects is simple using the three-frame method (it involves comparing differences). However, identifying the objects is much harder. If you know what to look for, the problem simplifies somewhat, but there are still numerous exceptions. A car is usually wider than it is tall, except when it is coming towards or moving away from the camera. A person is usually taller than they are wide, but a group of people is more likely to match the profile of a car.

Spacecraft Guidance, Navigation and Control
Guidance, navigation, and control (GN&C) is a specialty area in Aerospace Engineering that involves determination of how a vehicle gets to its target, knows where it is, and maintains its position or trajectory. These concepts and related technologies will be highlighted for spacecraft application. Some of the projects involving GN&C at Emergent Space Technologies will be summarized.

For more information, visit http://emergentspace.com/.
Dr. Sun Hur-Diaz
Vice President
Emergent Space Technologies, Inc.

Until you think about it, determining where you are in space might seem trivial. But because hardware never reacts perfectly, a spacecraft needs to constantly be checking its position and orientation. But you need a variety of instruments, such as sextants and telescopes, to determine orientation. To find your location in orbit you need at least four GPS satellites. Finding which orbit you want to go into requires some physics simulations, as well as constant corrections to maintain it. In fact, finding an orbit to optimize fuel usage and time for a set of destinations is a huge field.

Millimeter Scale Robotics Research and Development at the MITRE Corporation
As we continue to look for ways to keep soldiers and first responders out of harm’s way, the capabilities of robotic systems improve and demand for them increases. While large robots have been used extensively, the development of smaller robots opens up a range of additional potential applications, such as accessing confined areas for search and rescue or surveillance purposes. To address this emerging need, MITRE’s Nanosystems Group has been developing rugged, low-cost robots, designed to be carried in a pocket. They can be operated from a mobile phone and reconfigured in the field to quickly adapt to specific missions.
Ms. Jessica Rajkowski
Systems Engineer, Sr
The MITRE Corporation

I don’t know if I mentioned this before, but I am working at MITRE this summer, albeit in a different division. The talk was still fascinating. Some of it was about developing micro-scale “robots” using interesting properties of polymers and metals. The speaker also discussed MITRE’s development of a hand-sized field robot designed to be low-cost, low-maintenance, durable, and easy to control. Obviously this would normally violate the rule of “cost, speed, quality; pick two”. To some degree it was speed that was sacrificed. It took years to develop the robot, but at its current stage it is pretty amazing. Another subject of the talk was the speaker’s project to set up a consistent test for testing whether a producer’s robot was up to MITRE standards.

I’ve also continued to use Google AppEngine and I’m working on a forum, seen here.

Starting a Game Studio

How do game studios get started? We always hear about game studios releasing a hit game and being boosted to fame. But whence do they come? I suppose most large companies and studios start as some guys in a garage or in a basement. Nowadays many companies are funded by the groups of venture capitalists, waiting to hit the next media goldmine. But in terms of game studios, are there still grass roots talent being formed and emerging? Or has the market environment become too hostile, and now new talent is forced to hop into the large studios as an insignificant piece of a game producing machine?

With most mainsteam games coming from the huge studios that have been bought up by corporate syndicates, there has been an increase in indie games recently. With the increased popularity of Valve’s digital distribution platform, Steam, fledgling studios don’t have to sign onto a corporate distributor to get their game noticed. Tiny, 5 dollar stocking stuffer games are now feasible to distribute, since releasing on Steam costs virtually nothing. Gone are the costs of creating discs and advertizing.

Studios still have to come from somewhere, though. I guess college is a great time to form a game studio. People are already there and live relatively close together, they don’t have a job, they have been studying their trade and want to apply it, and they have the time and motivation to accomplish something. I would go about creating a core team of one writer, and two coders, one or two artists. I would be a coder, but also keep the group coherent. Although 5 people may seem a little big to get off the ground, there would only be 3 people actively involved at one time on average. We would also need a couple voice actors, but that is outside talent and can be dealt with on a one to one basis.

After assembling, we would create our first game. No doubt it would take a couple iterations to get something desirable, but as long as something gets made, we’re fine. The game would probably be built on a pre-existing framework to speed up the development process. Once we have our first game out, we can bring one or two more people on board, and improve our infrastructure with the money from sales. After a second, larger game, we could probably get some investments and move into a building once graduated from college. As a standalone studio, it would probably be tough to make ends meet, but as a lead producer, I think I could keep projects on task and on time, yet still deliver an exceptional product. Perhaps we would eventually be bought up, but we could certainly argue a large amount of freedom in our contract if our games did exceptionally well.

Being the head producer of a studio would be great. It is your job to make sure good games are made, which means checking out and guiding every part of the process, from writing to coding to art design. It is your job to make sure people are working together, working quickly, and doing quality work. Such a job would suit me, as I have an interest in all aspects of game creation, an ability to hold a grand vision, the ability to help people communicate and work together, and the ability to split up an idea into steps and develop a timeline.

Another side of being the lead producer at a game studio would be dealing with management. If you belonged to a larger company, you would have people above you that don’t really understand or care what makes a specific game good; all they are dealing with is sales and other numbers. It might come down the chain of command that I should implement a certain system in my game, because it increased sales for these other games. Of course, my game is completely different and incompatible with that system. So it is up to me to please the management but still make a good, undiluted game. That sort of challenge is what makes producer an especially appealing job to me.

%d bloggers like this: