Posted: 2006-06-20 11:30pm
Anyone try Ruby on Rails?
Get your fill of sci-fi, science, and mockery of stupid ideas
http://stardestroyer.dyndns-home.com/
The quick and dirty run down:Dooey Jo wrote:What's wrong with PHP?
What about Python? And I'm a bit confused about strong vs weak typing and dynamic and static typingMiles Teg wrote:The quick and dirty run down:Dooey Jo wrote:What's wrong with PHP?
* No formal language spec or conventions.
* No namespaces
* Dynamic typing is never a good thing for anything other than a one person project (and even then not great).
* Shit poor security model
That said, if they could fix the security issues, it would be an ok language for small projects.
Miles Teg
But what's especially bad about it?Beowulf wrote:Dynamic typing is the type of a variable not being determined until it's used. A string "45" can be used as a number 45. Static typing is every variable having a type that can't be changed.
Strong typing is the prevention of mixing types in an operation: string "45" + numeral 1, for example. Weak typing is the reverse. I could increment the string "45" and get "46" back.
Dynamic typing isn't entirely bad. It's an essential feature of polymorphism. If you've never used polymorphism in a project, I'd suggest you learn OO programming.
It's hard to tell what type an object is. Which makes it easier to do something you didn't mean to do.Pu-239 wrote:But what's especially bad about it?Beowulf wrote:Dynamic typing is the type of a variable not being determined until it's used. A string "45" can be used as a number 45. Static typing is every variable having a type that can't be changed.
Strong typing is the prevention of mixing types in an operation: string "45" + numeral 1, for example. Weak typing is the reverse. I could increment the string "45" and get "46" back.
Dynamic typing isn't entirely bad. It's an essential feature of polymorphism. If you've never used polymorphism in a project, I'd suggest you learn OO programming.
That's it? Doesn't anybody use comments (and meaningful variable names)?Beowulf wrote:It's hard to tell what type an object is. Which makes it easier to do something you didn't mean to do.Pu-239 wrote:But what's especially bad about it?Beowulf wrote:Dynamic typing is the type of a variable not being determined until it's used. A string "45" can be used as a number 45. Static typing is every variable having a type that can't be changed.
Strong typing is the prevention of mixing types in an operation: string "45" + numeral 1, for example. Weak typing is the reverse. I could increment the string "45" and get "46" back.
Dynamic typing isn't entirely bad. It's an essential feature of polymorphism. If you've never used polymorphism in a project, I'd suggest you learn OO programming.
Code: Select all
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#define BRACES_ARE {
#define FOR_CHUMPS }
using namespace std;
const string SENTENCE_END = ".!?";
const string SENTENCE_MIDDLE = ",;:";
int main(int argc, char *argv[]) BRACES_ARE
string source_string;
string rewritten;
vector<string> starter;
vector<string> middle;
vector<string> ender;
vector<string> simple;
srand(0);
while(cin) source_string += cin.get();
int num_fragments = 0;
string fragment;
bool cont = false;
bool makezero = false;
bool clearit = false;
string::const_iterator p;
for(p = source_string.begin(); p != source_string.end(); ++p)
if(!(fragment.empty() && isspace(*p)))
goto tehwoot;
else
ret: continue;
goto ohdone;
tehwoot:
clearit = false;
makezero = false;
fragment += *p;
if(SENTENCE_END.find(*p) != string::npos &&
(clearit = true) && (makezero = true))
if(++num_fragments == 1)
simple.push_back(fragment);
else
ender.push_back(fragment);
else if(SENTENCE_MIDDLE.find(*p) != string::npos && (clearit = true))
if(++num_fragments == 1)
starter.push_back(fragment);
else
middle.push_back(fragment);
if(clearit) fragment.clear();
if(makezero) num_fragments = 0;
goto ret;
ohdone:
if(starter.size() == 0) starter.push_back("Hello,");
if(middle.size() == 0) middle.push_back("if you didn't know,");
if(ender.size() == 0) ender.push_back("braces suck!");
if(simple.size() == 0) simple.push_back("That is all.");
for(int i=0; i<3; ++i, rewritten += "\n\n")
for(int j=0, n=rand()%5-1; j<10; ++j, n = rand()%5-1)
if(n == -1)
rewritten += simple[rand()%simple.size()]+ " ";
else
for(int k=0; k<n; ++k, rewritten += ender[rand()%ender.size()] + " ")
if(!k) rewritten += starter[rand()%starter.size()] + " " +
middle[rand()%middle.size()] + " ";
else rewritten += middle[rand()%middle.size()] + " ";
cout << "Moblin says: Jumble, jumble..." << endl << endl;
cout << rewritten << endl;
return EXIT_SUCCESS; FOR_CHUMPS;
lol Of course they do!Pu-239 wrote:That's it? Doesn't anybody use comments (and meaningful variable names)?Beowulf wrote:It's hard to tell what type an object is. Which makes it easier to do something you didn't mean to do.Pu-239 wrote: But what's especially bad about it?
That's cheating. You have to convert it to a different language and run it through that compiler instead. I choose C++.phongn wrote:Can I find a C interpreter and do that instead?
Frankly, I couldn't give two shits about namespaces. They're designed to solve a problem that is the result of poor design: conflicting function names. I prefix all my class methods with a class acronym. WOW! I just made namespaces totally redundant!Miles Teg wrote:* No namespaces
You use common sense instead of an over the top, insane, elaborate....oh right, you work for Apple instead of Microsoft no?Durandal wrote:Frankly, I couldn't give two shits about namespaces. They're designed to solve a problem that is the result of poor design: conflicting function names. I prefix all my class methods with a class acronym. WOW! I just made namespaces totally redundant!Miles Teg wrote:* No namespaces
Well, it makes for less typing... I think? Don't have to type the prefix on everything, and it can be changed later w/o mass renaming. Also you have 3rd party libraries who's names may conflict...Durandal wrote:Frankly, I couldn't give two shits about namespaces. They're designed to solve a problem that is the result of poor design: conflicting function names. I prefix all my class methods with a class acronym. WOW! I just made namespaces totally redundant!Miles Teg wrote:* No namespaces
Bah. I like namespaces, though I know they are abused. As for multiple inheritance - I can't tell if you say it's a good thing or bad thing?Durandal wrote:I feel the same way about multiple inheritance. Talk about a feature that is completely useless for 99% of programmers. "OMG I'VE GOT CONFLICTING ATTRIBUTES!" Well design your class structure better next time.
In that case, is "boost::regex" really so much harder to type than "boost_regex"?Durandal wrote:Frankly, I couldn't give two shits about namespaces. They're designed to solve a problem that is the result of poor design: conflicting function names. I prefix all my class methods with a class acronym. WOW! I just made namespaces totally redundant!Miles Teg wrote:* No namespaces
No, but "boost_regex" looks nicer.Mad wrote:In that case, is "boost::regex" really so much harder to type than "boost_regex"?
The other correct answer would be that variable names are reused far more frequently than function names. See 'i', 'j' and 'k'. My personal favorite is from the guide to writing unmaintainable code.In any case, namespaces are just a natural extension of scoping rules. Why not just have a bunch of global variables each prefixed with the function they belong to? Then you won't have any conflicting variable names and you can use them whenever you need to.(The correct answer is "that's stupid, and it prohibits recursion.")
Actually, being an Mac OS X developer, I work in Objective-C. When calling an internal method, you send the message [self methodName]. Makes it easy to tell where the call is coming from. Since method calls are actually messages, you can have two different classes have the same method names without any need for scoping.Code inside a namespace looks a lot cleaner without class prefixes dangling around everywhere. (Sorta like you're probably glad you don't have to use this to reference methods and members... unless you're using PHP.)
Heh, you think 16k is pathetic? Try the Atari 2600. It had 128. Bytes! And 4k of ROM storage. Now that's shitDestructionator XIII wrote:The awesome part is 16k is so pathetic. Even the NES had 64k of memory, in addition to the sprite buffer. There's an idea to get around the framebuffer issues: force you to use sprites like the NES did.
It sure sounds challenging... Though on the topic of NES, I think it would be cool to make some kind of (un)official SDN NES game or something...Am I the only one who thinks this would be fun as hell, or does it sound like a good challenge?
Now that would rock.Destructionator XIII wrote:Still, I'd be willing to try a SDN NES game.