Stuff I Make:
I Explore:
Music:
Me:
Other Junk:
|
tags:
.netabstractbabelc sharpC++classclasseses6es6/babelgulpinterfacejavajavascriptobject oriented programmingobjective-coopperlphpprivateprotectedpublicpythonrubysassswifttype scripttypescriptvb.netvb6visual basic
Check www.classetta.com for a quick demo. Part of being a programmer is knowing and working in many different languages. While most languages follow the same basic principals, their verbiage can vary. For example, to find the first instance of a sub-string in a string, the following methods all basically do the same thing:
Of course each language specifies different parameters in different orders. But those types of things are easy to look up. However I’ve always found difficult to look up and remember Class syntax. Classes are complex – and instead of just being easily swappable one-liners, they’ll often have different rules, different syntax, different code architecture patterns, and support more-or-less features of classical OOP. Further, some languages are strongly typed, some weakly typed, and some not typed at all. The variety of Class implementations is probably greater than any other language commonality. At the end of the day, though, Classes all serve the exact same purpose – no matter which language. In fact, you could start with simple UML / flowchart model of a class and convert it to any language you desire. With this in mind, I came up with an idea for a new project. A simple website that lets you build a model-class and automatically convert it to code. Free from writing any code, strictly an interface for building a model class. The project would convert the model into a the code for a Class in each major language I work with. And that’s exactly what I made: (www.classetta.com) As you can see, the Editor tab is selected, and a generic, completely abstract, model class was created. The class is public, named ThoroughDemo, inherits from Someclass, implements Demoable, Listable, and Comparable interafaces. It also has many member varibles and, not shown, methods. On the Java tab, you can see how Java would implement this hypothetical class: Likewise, on the C# tab, you can see how C# would implement this hypothetical class: And finally, on the Ruby tab, you can see how Ruby would implement this hypothetical class: Of course, Classetta.com also supports Python, PHP, JavaScript (Vanilla, ES6/Babel, TypeScript), Visual Basic (VB6, and .NET), Perl, Ce++ and Swift. As I learn more languages, I hope to add more tabs to classetta.com. Stay tuned for a video-demonstration coming soon! September 14, 2015 at 5:26 pm | Code Projects |