TheJach.com

Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

Happy Day 42

Yup, it's 10/10/10, which is binary 42. I know some people believe humanity has a sort of "shared consciousness", and expect that one day we'll all undergo some deep insight or enlightenment at once... Wouldn't that be crazy if it happened today, and we learned the answer to Life, the Universe, and Everything?

See Full Post and Comments

C does support encapsulation!

Relating to my previous post, I'd just like to mention that C supports encapsulation, and in my opinion much better than C++. It's done using Opaque Pointers.

Here's some code:


#######blah.h########
#IFNDEF H_BLAH
#DEFINE H_BLAH
typedef struct Blah* Blah_handle;
Blah_handle create_blah(void);
void destroy_blah(Blah_handle);
void print_blah(Blah_handle);
#ENDIF


See Full Post and Comments

C++ supports encapsulation? Really?

No, it doesn't. For an excellent reference to make you cringe at the thought that C++ exists so abundantly, read the C++ FQA. Anyway, here's a trivial example of violating "private", which is just one way of showing that in C++ there's really no encapsulation at all.

#include <iostream>


using namespace std;

See Full Post and Comments