the hamstu » The Typography of Code

fixed_prop.png

Cool post with a lot of great history and font samples!

As a self proclaimed programmer/designer I enjoy not only the logical and practical things in life, but also the beautiful and well designed. And I find the greatest pleasure when these things converge to produce something extraordinary.One such thing is Typography. Typography is the art of language, the visualization of the spoken word. A medium by which non-verbal communication is made possible. And though I profess no expertise in this art, I have come to deeply appreciate it’s power and ability to convey the same message in so many different ways. Each with a unique feeling and style.

The Messenger

In 1956 Howard Kettler designed the typeface Courier. It was made for IBM’s new (and revolutionary) line of electric typewriters. Originally called “Messenger”, Courier is one of the earliest fixed-pitch (also known as Monospace) fonts, meaning each character takes up the same amount of space on a line; allowing for easy tabular alignment and legibility.

Courier was a hit, and as many made the transition from typewriter to computer, this classic typeface wasn’t far behind. It was included in all early Apple computers, and while creating the core fonts for Windows 3.1, Microsoft hired Monotype Typography to give Courier a makeover. And so Courier New was born, as a thinner and cleaner version of it’s former self.

via the hamstu » The Typography of Code.

LoseThos: Programming As Entertainment

Pretty cool stuff:

LoseThos is for programming as entertainment.  It empowers programmers with kernel privilege because it’s fun.  It allows full access to everything because it’s fun.  It has no bureaucracy because it’s fun.  It’s the way it is by choice because it’s fun. LoseThos is in no way a Windows or Linux wannabe — that would be pointless. LoseThos is not trying to win a prize for low resource usage or run on pathetic hardware.  Low line count is a goal, though.  It’s 100,000 lines of code including a 64-bit compiler, tools and a graphics library.  It’s strictly 64-bit and could be configured to function with 32 Meg or less RAM, but who cares!   Where do you get a x86_64 machine with less than 32 Meg RAM?  With no multimedia, it’s hard to run out of memory on a modern home computer.

LoseThos was designed from scratch with a clean slate and has no compatibility with anything else. Source code is ASCII plus binary graphics data.  It has a new language roughly based C/C++.  It’s more than C and less than C++ so, maybe, it’s C+. I took every opportunity to improve things once I made a clean break with the past.  That’s another reason LoseThos has value — it is innovative.

I started with a command line like this:
Dir(“*.*”);

I added default parameters from C++:
Dir();

I said, “parentheses are stupid.”
Dir;

Now, I have a language which looks a little like pascal.  It also doesn’t have a main() routine — any statement outside a function executes immediately, in order. The command line feeds straight into the compiler (not an interpreter) and it doesn’t have that bullshit errno crap for return values — command line commands are regular C+ functions.

(via http://www.losethos.com/)


Visual Studio Incremental Search (Type-Ahead Find)

This is just awesome – with Ctrl+I, you can perform a type-ahead search within Visual Studio, just like Firefox!

Again, my buddy Sairama to the rescue. Just when I think I’ve pretty much got VS.NET down solid (only being use it since Pre-Beta days, right?) I’m thrown a curve ball called incremental search. I guess I just assumed that a feature that was so cool in so many other editors would never make it into VS.NET. Silly me.

So, lest I be the most ignorant, fire up Visual Studio.NET, get some code in there, hit Ctrl-I and start typing. After you’ve found something, use F3 to Find Next. In the words of Chris Sells – It’s pure sex.

via Scott Hanselman’s Computer Zen – My ignorance proceeds me: Visual Studio.NET Incremental Search.

Magic number (programming) – Wikipedia, the free encyclopedia

Interesting list of “Magic Debug Values” from Wikipedia:

  • 0x..FACADE : Used by a number of RTOSes
  • 0xA5A5A5A5 : Used in embedded development because the alternating bit pattern (10100101) creates an easily recognized pattern on oscilloscopes and logic analyzers.
  • 0xABABABAB : Used by Microsoft‘s HeapAlloc() to mark “no man’s land” guard bytes after allocated heap memory
  • 0xABADBABE : Used by Apple as the “Boot Zero Block” magic number
  • 0xABADCAFE : A startup to this value to initialize all free memory to catch errant pointers
  • 0xBAADF00D : Used by Microsoft‘s LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory
  • 0xBADBADBADBAD : Burroughs large systems “uninitialized” memory (48-bit words)
  • 0xBADCAB1E : Error Code returned to the Microsoft eVC debugger when connection is severed to the debugger
  • 0xBADC0FFEE0DDF00D : Used on IBM RS/6000 64-bit systems to indicate uninitialized CPU registers
  • 0xBADDCAFE : On Sun MicrosystemsSolaris, marks uninitialised kernel memory (KMEM_UNINITIALIZED_PATTERN)
  • 0xBEEFCACE : Used by Microsoft .NET as a magic number in resource files
  • 0xC0DEDBAD : A memory leak tracking tool which it will change the MMU tables so that all references to address zero
  • 0xCAFEBABE : Used by both Mach-O (“Fat binary” in both 68k and PowerPC) to identify object files and the Java programming language to identify .class files
  • 0xCAFEFEED : Used by Sun MicrosystemsSolaris debugging kernel to mark kmemfree() memory
  • 0xCEFAEDFE : Seen in Intel Mach-O binaries on Apple Computer‘s Mac OS X platform (see 0xFEEDFACE below)
  • 0xCCCCCCCC : Used by Microsoft‘s C++ debugging runtime library to mark uninitialised stack memory
  • 0xCDCDCDCD : Used by Microsoft‘s C++ debugging runtime library to mark uninitialised heap memory
  • 0xDDDDDDDD : Used by MicroQuill’s SmartHeap and Microsoft’s C++ debugging heap to mark freed heap memory
  • 0xDEADBABE : Used at the start of Silicon GraphicsIRIX arena files
  • 0xDEADBEEF : Famously used on IBM systems such as the RS/6000, also used in the original Mac OS operating systems, OPENSTEP Enterprise, and the Commodore Amiga. On Sun MicrosystemsSolaris, marks freed kernel memory (KMEM_FREE_PATTERN)
  • 0xDEADDEAD : A Microsoft Windows STOP Error code used when the user manually initiates the crash.
  • 0xDEADF00D : All the newly allocated memory which is not explicitly cleared when it is munged
  • 0xEBEBEBEB : From MicroQuill’s SmartHeap
  • 0xFADEDEAD : Comes at the end to identify every OSA script
  • 0xFDFDFDFD : Used by Microsoft‘s C++ debugging heap to mark “no man’s land” guard bytes before and after allocated heap memory
  • 0xFEEDFACE : Seen in PowerPC Mach-O binaries on Apple Computer‘s Mac OS X platform. On Sun MicrosystemsSolaris, marks the red zone (KMEM_REDZONE_PATTERN)
  • 0xFEEEFEEE : Used by Microsoft‘s HeapFree() to mark freed heap memory
  • 0xFEE1DEAD : Used by Linux reboot() syscall

via Magic number (programming) – Wikipedia, the free encyclopedia

[g++] warning: deprecated conversion from string constant to ‘char*’

Just stumbled on to this problem/fix while writing some C++ code for my CS courses…

warning: deprecated conversion from string constant to ‘char*’

I hadn’t really thought about this much, as previous versions of g++ (such as the 3.4.3 version we’re using on our university systems) never complained about this issue, but g++ 4.2.3 does. The fix, as I found from multiple posts around the web, is to change all function arguments that will be expected to take a string constant from “char *” to “const char *”. For example:

Function Call:

class.someFunction("");

Original Function Prototype:

void class::someFunction(char *);

Updated Function Prototype:

void class::someFunction(const char *);

I’m somewhat new to C++ (OSU taught Java and I code in C# for the day job), so please give me a bit of slack on this one if you’re a seasoned pro. 😉

As always, comments and questions are welcome via my comment box. Thanks for reading!

Stroustrup and Sutter: C++ to run and run | Reg Developer

This is the conference (and super session) I attended last week. It was really cool. =)

Stroustrup and Sutter: C++ to run and run | Reg Developer

SD West 2008 For the second year in a row organizers at the Software Development Conference & Expo West felt the super sessions hosted by C++ legends Bjarne Stroustrup and Herb Sutter were worth some ink on the event agenda.

“There was a time in the late 1990s and early 2000s when they simply stopped advertising C++ sessions at this conference,” Sutter told attendees. “And yet they found a curious thing: every year for four years, C++ was the strongest track at the show. With zero advertising! That says something about the market. That says that there are problems that C++ is solving.”

The duo offered the C++ crowd day-long sessions at SD West. In fact, a session presented last year (Concepts and generic programming in C++0x”) was back by popular demand, alongside an additional day of new material covering the design and evolution of the grandpappy of object-oriented programming languages.

Sutter is the author of several books on software development, a lead architect at Microsoft, chair of the ISO C++ standards committee, and coiner of the phrase “concurrency revolution.” Stroustrup is also an author, a professor of computer science at the Texas A&M University’s college of engineering, and a research fellow at AT&T Labs.

Of course, the Danish computer scientist is best known as the creator and original implementer of C++.

Stroustrup doesn’t like to hear his brainchild referred to as an object-oriented programming (OOP) language, though he allowed that its main contribution was to make OOP mainstream. “Before C++, 99.9 per cent of programmers never even heard of it OOP,” he said during a post-session Q&A. “Those who’d heard of it believed that it was only for slow graphics written by geniuses.”