PDA

View Full Version : How Many Programming Langauges Do You Know?


Pyrofan1
12-19-2006, 08:53 PM
I know: PHP
SQL
C#
C
C++
Visual basic
Lua
Python
Pbasic
Spin
Javascript
HTML
XML
Brainfuck
@55 r@p3
Java
how about you guys?

MSG
12-19-2006, 10:16 PM
1. php
2. ???
3. PROFIT!

lord soth
12-19-2006, 10:19 PM
Is this just how many I know ABOUT? because I'm pretty sure no sane person programs in Brainfuck at all. Are you sure you actually have expertise in those languages, or you have just made a single applet, or compiled a single program with them?

BTW, PHP SQL, HTML, XML, etc. Are not programming languages.

MSG
12-19-2006, 10:21 PM
BTW, PHP SQL, HTML, XML, etc. Are not programming languages.
[/b]

visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY

Pyrofan1
12-19-2006, 10:24 PM
SQL-structured query language
XML-Extensible Markup Language
HTML-HyperText Markup Language
and how is PHP not a language? and i do have expertise in all of them

lord soth
12-19-2006, 10:26 PM
I happen to know that MSG only 'programs' with PHP. Judge his sanity for yourselves:


visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic visual basic khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly khelly KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY KHELLY[/b]

Pyrofan1
12-19-2006, 10:32 PM
I program in PHP and have you noticed that Invision Board, phpBB, SMF and lots of other sites use PHP.

MSG
12-19-2006, 10:38 PM
From the internet itself (if it's on the internet, it MUST be true):

...Visual Basic currently competes with PHP and C++ as the third most popular programming language behind Java and C.[/b]
http://en.wikipedia.org/wiki/Visual_Basic

lord soth
12-19-2006, 10:40 PM
OK, let us say that to be considered a programming languages, It must possess variables. What would C++ be without variables? It would be almost as useless as MSG's attempt at a post.

HTML, XML, and mySQL don't use variables. I don't know about Spin and Lua, but I'm too lazy to look it up.

MSG
12-19-2006, 10:45 PM
I never said HTML, XML, and mySQL were programming languages. HTML and XML are markup languages (it's in the name), and mySQL is just a dump where you can store data. By the way, whatever happened to "php isn't a programming language"?

Ynot
12-20-2006, 12:31 AM
stop being so elitist
any human-readable text that is used to control the operation of a machine is a programming language

whether that be compiled, interpreted or scripted

anyway

php, sql, C & C++ are te only ones I can do anything useful with

Kaniaz
12-20-2006, 09:05 AM
I don't feel that "knowing" the syntax of a language is knowing anything. It's way too easy to learn PHP, C++ or pretty much any language's syntax and still have absolutely no idea on how to program anything useful in them or the underlying concepts behind them of variables, classes, encapsulation whatever.

I'm pretty sure if I thought a bit, I could name 20 languages that I "know", but I can only do anything useful in about six of them maybe? C++. I learnt the syntax to this when I was about eleven, but, like I said, I had absolutely no idea what to do with it. I could make a thumpin' good "Hello World" program, though. Now it's my favourite language. I don't entirely understand why people say it's hard or why they get the hots over alternative languages (I mean, come on, pointers aren't that complicated to understand) but such is life. PHP. The documentation for this language is absolutely outstanding and it didn't take long to learn and actually use for a good purpose at all. Not to mention the syntax is quite a lot like C++'s, and I think one of the main reasons I'd recommend it to someone who wants to get into programming is because there's no strict type checking. $myVariable can be a string, integer and anything else all at once. Yeah that can make problems, but it works for most purposes.
SQL. This isn't really a language at all, more a bunch of keywords, but that wouldn't stop me from listing it somewhere on my hypothetical CV. That and SQL is so useful hand in hand with PHP. There's bindings for C++, but I don't feel that it has a place in languages like that.
HTML/CSS/JavaScript. I combine all three of these because I feel it's a little dumb to count them all separately. You can't make very good HTML without using CSS, and your site is a lot like cardboard these days unless you use Javascript with it all. Either way, I learned how to use this ages ago, CSS is the greatest thing on the planet and I seriously will never understand why so many sites still use tables. The freaks.
I've missed off "languages" like XML and the like. I know those, they're useful, but you don't make applications out of them and they honestly don't take long to learn at all.

Languages I have never looked at include Visual Basic (ha-ha), Java and Ruby. Countless others, probably. I have seen a little of Perl. I might like to look at LISP in the future and perhaps assembly which, while almost entirely useless in today's whimsical world of abstraction and building castles in our heads*, would be fun background knowledge. C# is up for a definite fool around with in the future, being as everyone swoons over .NET (and I'd really like to know why).

EDIT: I just read the posts before me more closely. What the? PHP is a programming language. HTML is more of a markup language, but still has a few vestiges of programming concepts (which is why I would feel someone making a big deal out of it would be scraping the barrel).

* Anyone read "The Mythical Man Month"? Then you are not a real programmer, son!

M-Cat
12-20-2006, 04:23 PM
I know TI-BASIC ^_^. Mad easy to learn. I have too much of a life to master anything else.

Ynot
12-20-2006, 04:28 PM
any basic language is uber leet
fuckin' roxor on !!!!

erm,,,,......
yeah, about being super elitest.........
it's ok to mock basic people


*edit*
there's really a lang called arse-raper ???

Seeker
12-20-2006, 04:36 PM
Assembly Languages - IBM370, 8080, Z80, 6512, 80x86, 990, 6800, 68000, 99000
JCL
COBOL
Basics - GW, TI, Visual, .NET
C dialects - C, C++, C#
All Texas Instruments/Siemens Industrial controller languages - About 15 of them in total
PHP

Umbrasquall
12-20-2006, 05:05 PM
Ultimate nerd thread.

...

Right I know TI, Java, C++ and some html.

Smileyguy597
12-20-2006, 05:35 PM
TI-83 Plus- ALL THE WAY

its fun to make games on your calculator

arby
12-20-2006, 07:32 PM
my "real languages" that I can do something with are:

1. C

2. AS

3. Haskel (An uber-efficient, Fully functional (That means NO variables and NO if loops among others (http://en.wikipedia.org/wiki/Functional_programming)) language. Its really crazy yet quite fun and I suggest any programmer that is looking for new opertunities/chalenges/is bored with conventional x += 5 to try it =P)

4. VB

Ynot
12-21-2006, 12:51 AM
Assembly Languages - IBM370, 8080, Z80, 6512, 80x86, 990, 6800, 68000, 99000[/b]
winner

dsr
12-21-2006, 06:09 PM
Python - my favorite language

Java - I know the syntax and am comfortable with a few APIs (I/O and Swing come to mind), but I don't have much experience with the language (no more than a year)

C++ - I know the syntax, but I have almost no experience with the language. I find Python (in conjunction with the Psyco JIT compiler) performs well enough for everything I've needed so far and is certainly more productive. That being said, C++ is a great language and I intend to give it a go in a few years.

Perl, Bourne, and Bash - just for simple scripts

AppleScript and Objective-C (w/ Cocoa) - very little

XHTML/CSS/JavaScript/XML/XSTL/etc. - I wouldn't consider them programming languages, but I know the basics of them.

Lisp - I want to learn someday. Or maybe I'll just leave that to RMS ...

As previously stated, it doesn't matter how many languages you know, it's how effective you are with those that you do know. Having no formal training and not having studied much production code, I consider myself a relative beginner in programming. However, I have a lot of general computer knowledge (primarily on Mac OS X and certain Linux distros).


Assembly Languages - IBM370, 8080, Z80, 6512, 80x86, 990, 6800, 68000, 99000
[/b]
Wow. I'm guessing you're fluent in binary too? :wink:

Pyrofan1
12-22-2006, 03:08 PM
Wow. I'm guessing you're fluent in binary too?
[/b]
Don't you mean machine code?

dsr
12-22-2006, 07:00 PM
Don't you mean machine code?
[/b]
00000001 :wink:

arby
12-22-2006, 08:46 PM
00000001 :wink:
[/b]

00000000 :mad:

you liar

dsr
12-23-2006, 06:24 AM
No, I was agreeing with Pyrofan1 that I meant machine code (which is represented in binary). 00000001 in binary is the same as 1 in decimal which is the "yes" value for a bit (a single binary digit). I admit it was a stretch. I should have responded with the ASCII code for the string "yes" in binary:

01111001
01000101
01110011

arby
12-23-2006, 08:23 AM
No, I was agreeing with Pyrofan1 that I meant machine code (which is represented in binary). 00000001 in binary is the same as 1 in decimal which is the "yes" value for a bit (a single binary digit). I admit it was a stretch. I should have responded with the ASCII code for the string "yes" in binary:

01111001
01000101
01110011
[/b]

And i replied with 00000000 which is false or "no" in binary =P

You need some studying to do young'un

Kaniaz
12-23-2006, 12:11 PM
You need some studying to do young'un[/b]
No, nope, I'm pretty sure you're evenly matched in your, uh, contest.

dsr
12-23-2006, 07:35 PM
This is a rather pointless, er, "contest." Arby, how does Haskell's performance (when compiled with GHC) compare to native code written in more mainstream languages like C or C++? I never gave Haskell any thought until I read your post, but I just checked out the wiki and it looks pretty interesting.

Kaniaz, Vim users unite! Bellum gerendum contra Emacs est. Actually, I like GNU Emacs but find it painful on my wrists. :?

arby
12-24-2006, 07:38 AM
This is a rather pointless, er, "contest." Arby, how does Haskell's performance (when compiled with GHC) compare to native code written in more mainstream languages like C or C++? I never gave Haskell any thought until I read your post, but I just checked out the wiki and it looks pretty interesting.

[/b]

Pointless, yes... =P oh well.

Well, i'm not really sure about the specifics of why haskell is that efficient since i'm not exactly a computer science graduate but I have a general idea. Heres a demo peice of code just for refernce.

Lets use a factorial function to demonstrate.

in C:

int factorial(x){
y=1
for(i=1,i<=x,i++){
y = y*i
}
return y
}

It takes a few lines, a for loop and some variable calculations. In haskel:

fac 0 = 1
fac n | n > 0 = n * fac (n-1)

A simple recurrsion, no unneeded calculations. Plus, it looks dam sexy fitting all those lines of code into 2 or even 1 line of code:

fac n = if n > 0 then n * fac (n-1) else 1

Anyways, its not more efficient in all cases and i'm really not sure what parts of it are that much better but I worked under a university computer science professor using this language and he said it was more efficient in most cases so i'm assuming he knew what he was talking about XD

Anyways, if you're interested heres a good link (http://www.haskell.org/~pairwise/intro/intro.html)

dsr
12-24-2006, 08:07 AM
Actually, the C implementation would most likely be recursive, too:

int factorial(int x) {
****if (x == 1 || x == 0)
********return 1;
****else
********return x * factorial(x - 1);
}

If you really want 1 line:

int factorial(int x) {if (x==1||x==0) return 1; else return factorial(x-1)*x;}

Also, your C example doesn't use C syntax :evil:

Thanks for the link. I'll check it out when I have the time. I'm still curious about how Haskell's performance compares to C/C++, especially for algorithmic code. Maybe Haskell's wiki answers that somewhere.

arby
12-24-2006, 10:06 AM
Actually, the C implementation would most likely be recursive, too:

Also, your C example doesn't use C syntax :evil:

[/b]

True, it could be recursive, but it wont get the full benifit because C isn't a lazy language (at least I think)

And I used pseudo code for the C portion =P I'm more used to languages similar to C.

M-Cat
12-29-2006, 07:34 AM
I started learning C++ because of this topic.

Here's my first program that checks if a number is prime. I'm really angry because I just found out I could've used a modulus operator and made it a lot shorter and faster >:(



#include <iostream>

using namespace std;

float x;
float y;
int z;

int main ();

int composite ()
{
cout << "\nCOMPOSITE";
main ();
}

int main()
{
cout << "\n\n-PRIME-\nEnter a number to determine if it is prime.\n";
cin >> x;
if ( x <= 0 && x != -1 )
composite ();
for ( z = 2; z <= ( x / 2 ); ++z )
{
for ( y = 2; y <= ( x / 2 ); ++y )
{
if ( z == ( x / y ) )
composite ();
}

}
cout << "\nPRIME";
main ();
}


I am making a text-based rpg right now :D It's going to have colored font!

Kaniaz
12-29-2006, 03:51 PM
Do you actually call main more than once or something there? In a perfect world, there would be indentation.

Anyway, yeah, first rule of programming. If you find something is beginning to look quite ugly (like your solution and lack of modulus operator above), it's best to think to yourself, "has any other programmer possibly ever tried this before", and usually, more or less, there's a better way to do it.

M-Cat
12-29-2006, 04:22 PM
C is a low-level language, meaning it works the same however you indent it.

I also copied and pasted, and tabs for some reason don't copy and paste into firefox.

And to answer your original question, it's because my compiler requires each function to be defined before it encounters it; in composite(), my compiler doesn't know what main() is yet, so I just have to define it before using it. I wasn't calling it twice.

Also, I feel that if I copy a program, I might as well just download it. You misunderstood my intent with this program; it's to learn, not to create an uber omgI'llfindthelargestprimenumberinzahworld program. Using someone else's code doesn't help you learn. I'm not looking for the best way.

I hope I wasn't too harsh :/ thanks for trying to help.

Pyrofan1
12-29-2006, 05:13 PM
C is a low-level language, meaning it works the same however you indent it.
[/b]
That's not right
First of all C is not a low level language it's a medium level language
A low level language means its closer to machine language unlike a high level language like BASIC which looks more like english

M-Cat
12-29-2006, 05:38 PM
K, well I was going by what a tutorial said, anyway.

You also completely missed the point of what I was saying :/

*realizes this is a nerd topic and leaves* haha now you'll never get my rpg :P

Pyrofan1
12-29-2006, 06:53 PM
haha now you'll never get my rpg
[/b]
Fine, you'll never get my graphics based one.

TweaK
12-30-2006, 01:50 PM
The fact it works the same however you indent it doesn't mean you shouldn't indent ¬_¬

lechat
12-30-2006, 02:08 PM
Hey guys,
seems everyone is an expert here... :)

* JAVA (J2EE or rather EE as J2EE is an obsolete term for enterprise java)
* PHP - i think this can be called prog. lang. but someone could call it just scripting lang.

* and of course a lot of stuff around the web (html, css, JS etc...)

arby
12-30-2006, 02:35 PM
Hey guys,
seems everyone is an expert here... :)
[/b]

na, its just that the people who aren't experts pretend to be =P

M-Cat
12-30-2006, 03:05 PM
na, its just that the people who aren't experts pretend to be =P
[/b]

Haha like me :D

Kaniaz
12-31-2006, 07:32 AM
Uh, no. Let me clear some of this up for you.

C is a low-level language, meaning it works the same however you indent it.[/b]
All very true, and the same can be said for C++, but code is always read more times than it is written. The next person to see your code will not be able to see the structure of your program easily with for blocks etc if you do not indent in. The compiler is very loose and ultimately the code loses its indentation when it is compiled, but this does not mean that I can read machine code. Always indent it, it's much easier to read: it's easier to get into the habit now. I understand it Firefox did something weird.

And to answer your original question, it's because my compiler requires each function to be defined before it encounters it; in composite(), my compiler doesn't know what main() is yet, so I just have to define it before using it. I wasn't calling it twice.[/b]
You were. I don't believe your program should compile cleanly (or perhaps even at all). Apart from having recursion in your program that would cause a stack overflow if used too much, you have an illegal definition of composite() - you have said it returns an integer value when it does not return anything. If this compiled, it would have surely made a warning.

Also, I feel that if I copy a program, I might as well just download it. You misunderstood my intent with this program; it's to learn, not to create an uber omgI'llfindthelargestprimenumberinzahworld program. Using someone else's code doesn't help you learn. I'm not looking for the best way.[/b]
Uh. You can learn a lot from other people's code - I find learning by example one of the best ways to learn something. It's entirely possible to go it alone and end up making something that gets a value in 100 lines of code when there is a much more elegant solution available. I understand the point was to learn something by doing, here, and you've done so, but your program does not run and would not compile.

A rundown of the problems:
#include <iostream>
using namespace std;

float x;
float y;
int z;

int main ();

int composite ()
{
****cout << "\nCOMPOSITE";
********main ();
}

int main()
{

****cout << "\n\n-PRIME-\nEnter a number to determine if it is prime.\n";
****cin >> x;
****
****if ( x <= 0 && x != -1 )
********composite ();

****for ( z = 2; z <= ( x / 2 ); ++z )
****{
********for ( y = 2; y <= ( x / 2 ); ++y )
********{
************if ( z == ( x / y ) )
****************composite ();
********}

****}
****
****cout << "\nPRIME";
****
****main ();
}

#include <iostream>
using namespace std;
This is fine. Great, in fact, that you're using the STL.

float x;
float y;
int z;
Bad news: you're defining global variables. Most people would consider this the Antichrist, these should be defined in a more local scope - main() itself would be fine for is. Moving these declarations into main() would do you a better service. Because you declare them here they are not initialised which is another bad point and could cause your program to crash/be more insecure than it needs to be.

int composite ()
{
****cout << "\nCOMPOSITE";

You say this function returns an int. It doesn't, a simple mistake, just add return 0; if you want to use this function.

main();
}
Why are you calling main again? This will cause a stack overflow very quickly if your program is used too much, and you should never call main more than once (contrary to your insistence, you are calling it more than once). Your function should return 0; and then main should loop again. Else the call stack will grow and grow.

Then in main():
****main ();
}
You call main () again when you should be looping it, causing the same problem and making your code nigh on impossible to follow.

So your code does not actually compile, although like we've just gone over, some problems that don't cause compiler errors still cause your code to be very hard to follow. Compiling your program in VC gets me this:

------ Build started: Project: Prime, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\users\admin\projects\prime\prime\main.cpp(14) : error C4716: 'composite' : must return a value
c:\users\admin\projects\prime\prime\main.cpp(38) : warning C4717: 'main' : recursive on all control paths, function will cause runtime stack overflow
Build log was saved at "file://c:\Users\Admin\Projects\Prime\Prime\Debug\BuildLog .htm"
Prime - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/b]

I think that more or less proves my point.

A better program using your code would look like this:

#include <iostream>
using namespace std;

int main()
{
****float x = 0;
****float y = 0;
****int z = 0;

****/* Realise that 'done' will never become true and that you will never actually end this program in this state because you
****** are using cin as the input instead of any other method. Win32 API would use WM_CLOSE messages for example, to set done
****** to true. Therefore the program will loop forever but it since it never calls any other functions it will never crash
****** or overflow. */
****bool done = false, composite = false;
****while ( !done )
****{
********cout << "\n\n-PRIME-\nEnter a number to determine if it is prime.\n";
********cin >> x;

********/* We don't know at the start. So it isn't. */
********composite = false;
****
********if ( x <= 0 && x != -1 )
********{
************cout << "Composite!";
************composite = true;

************/* It's easy enough to break here. */
************continue;
********}

********for ( z = 2; z <= ( x / 2 ); ++z )
********{
************for ( y = 2; y <= ( x / 2 ); ++y )
************{
****************if ( z == ( x / y ) )
****************{
********************cout << "Composite!\n";
********************composite = true;
********************break;
****************}

****************/* Horrible. The way the program is structured requires this. */
****************if ( composite )
********************break;
************}

************/* Also horrific. Don't do this: it's the only way to stop the program from spewing "composite!" over and over
************** again the amount of times the condition is true. */
************if ( composite )
****************break;
********}
****
********if ( !composite )
************cout << "\nPrime!";
****}
****
****/* '0' is the convention for "success" in C++ style programs. It probably does not matter here, but
****** we return it anyway. */
****return 0;
}

That works. You will notice:

1. I removed the composite() function. I didn't see the point on it in this case: it's called only twice and two cout statements could do just as fine. Encapsulating your code is important, but in this case was moot.
2. The code does not cause a stack overflow on runtime, which is important else the program would crash.
3. There is an ugly use of boolean in there to stop the program from spewing out the wrong message. It works, which is great, but the way the program was structured was kind of hard to do any other way (the continue keyword in C++ doesn't support continue all the way up the loop like PHP does). I didn't want to rewrite your entire program as you don't feel you'd learn a lot from that hence the rather nasty looking solution of guard clauses.
4. It compiles.

Either way, that should help.

Demerzel
12-31-2006, 08:10 AM
If you really want 1 line:

int factorial(int x) {if (x==1||x==0) return 1; else return factorial(x-1)*x;}[/b]Wouldn't this work and be a bit less messy?
int factorial(int x) { (x==1||x==0) ? return 1 : return factorial(x-1)*x;}

TweaK
12-31-2006, 08:16 AM
I'd like to add that even though you claim taking other people's code and perhaps editing it "does not teach you anything", but I must ask you to reconsider.

I've learned PHP and C++ mostly through seeing other people's code and editing it. I've learned how to do new stuff; I could always create (web-)applications with current knowledge, but only to some extent - I couldn't - and still can't - magically sense what functions are used where on a completely new topic, when creating new applications unrelated to anything I've ever done before. Looking at other people's code is the solution here (either that, or tutorials, but I tend to learn more from looking at how other people do it than simply reading a tutorial).

M-Cat
12-31-2006, 08:20 AM
You were. I don't believe your program should compile cleanly (or perhaps even at all). Apart from having recursion in your program that would cause a stack overflow if used too much, you have an illegal definition of composite() - you have said it returns an integer value when it does not return anything. If this compiled, it would have surely made a warning.[/b]

Lol how come ive compiled it and it works then?

Try actually learning C before you criticize people, loser.

Demerzel
12-31-2006, 08:23 AM
Lol how come ive compiled it and it works then?

Try actually learning C before you criticize people, loser.
[/b]He's right. You're wrong. Read what he says and you might be up to a 3% chance of learning C yourself.

Kaniaz
12-31-2006, 08:24 AM
Lol how come ive compiled it and it works then?

Try actually learning C before you criticize people, loser.[/b]
Oh grow up. Your code was invalid and would be choked upon by a compiler, but I won't argue the point (not much debate can come up against those magic compilers). I'm sorry if I spent all that time trying to help you write better code by basically detailing its life story. I won't expect to see much good coming from you until you change the attitude.

M-Cat
12-31-2006, 08:38 AM
You are in denial. If you actually tried compiling it you would see it works :). Apparently you do not wish to do that because you know I am right, you are wrong.

And what is wrong with using a perfectly respectable compiler? Just because yours might be crap doesn't mean other people can't use good ones :P.

Owned kthxbai. I don't feel like coming back to this nerdy topic so I will leave you to wallow in your self-pity :) I am too cool to be arguing about programming languages lol.

MSG
12-31-2006, 08:54 AM
Okay so I'm going to try and compile this motherfucker

TweaK
12-31-2006, 08:54 AM
This is the funniest topic ever. Thanks M-Cat, even though you won't read this anymore, you've made me laugh harder than I have in a long time.

MSG
12-31-2006, 09:02 AM
Okay so it didn't compile in Visual C++ 2005 Express.

M-Cat, what compiler are you using? I really want to get your program to work.

Identity X
12-31-2006, 10:11 AM
Only Java to a sufficient degree of faith.

Also: Python, Visual Basic, PHP, SQL, QBasic (first language I knew, great it was too), MIPS, NetLogo, BBC BASIC, some C, enough C#.

Pyrofan1
12-31-2006, 11:20 AM
Lol how come ive compiled it and it works then?
[/b]
Because your compiler is not an ANSI C compiler

dsr
12-31-2006, 08:43 PM
Wouldn't this work and be a bit less messy?
int factorial(int x) { (x==1||x==0) ? return 1 : return factorial(x-1)*x;}
[/b]
Good point. I'm used to Python in which there is no real ternary (although you can fake it and Python 2.5 introduced a pseudo-ternary operator iirc).

M-Cat, for your prime number checker, you could always compute an array of prime numbers up to the given integer and check to see if the array contains the integer. While this might not yield the best performance, it would test your ability to implement algorithms in C/C++. Here's an example of the sieve of Eratosthenes (an inefficient but easy-to-understand algorithm for computing a list of primes) in Python:

def primes(n):
****A, B = range(2, n+1), []
****while A:
********B.append(A[0])
********A = [x for x in A if x % B[-1] != 0]
****return B

I once implemented that algorithm in Python. Then I tried to port it to C++ and was astonished how much more code had to be written. Python is amazingly productive.

Kaniaz
01-01-2007, 04:24 PM
sieve of Eratosthenes[/b]
That's the name.

dsr
01-01-2007, 06:03 PM
Indeed it is. :bigteeth: The Sieve of Atkin yields faster performance, but it is a little more complicated and I didn't feel like explaining it. I'm sure there's a Wikipedia article detailing it.

Edit: As much as I wanted to avoid chiming in, I feel compelled to do so. M-Cat, Kaniaz spent a half hour to an hour trying to teach you how not to code, and you are refusing to listen to him. You're the one who needs to learn the language. By the way, the language in question is C++ and not C. ANSI C doesn't have iostream nor does it have the STL. Oh and I hate to say this, but although Kaniaz's advice is correct, M-Cat's original code does compile somehow in GCC (g++), which is the de facto standard compiler. Go figure.

QwinsepiaSquared
01-01-2007, 06:36 PM
Eh, I'm confuzzled.

I can do very basic stuff with HTML...pretty much just make a link like this:

<a href=www.dreamviews.com>This</a>

But then again, I've picked up basically everything I know by fixing my friends' broken myspace codes. XD

TweaK
01-02-2007, 05:17 AM
Edit: As much as I wanted to avoid chiming in, I feel compelled to do so. M-Cat, Kaniaz spent a half hour to an hour trying to teach you how not to code, and you are refusing to listen to him. You're the one who needs to learn the language. By the way, the language in question is C++ and not C. ANSI C doesn't have iostream nor does it have the STL. Oh and I hate to say this, but although Kaniaz's advice is correct, M-Cat's original code does compile somehow in GCC (g++), which is the de facto standard compiler. Go figure.
[/b]
Dude, respect++.


Eh, I'm confuzzled.

I can do very basic stuff with HTML...pretty much just make a link like this:

<a href=www.dreamviews.com>This</a>

But then again, I've picked up basically everything I know by fixing my friends' broken myspace codes. XD
[/b]
And in fact, even that is wrong ;) You always have to include http:// with <a> tags, or it will link to a directory named www.dreamviews.com. Let's say we're on a page named Link.html, in http://www.oursite.com/Content/Menu/Link.html, and we insert your code, we'd link to http://www.oursite.com/Content/Menu/wwww.dreamviews.com :) If we add http, we actually link to Dreamviews (http://www.dreamviews.com).

arby
01-02-2007, 07:34 AM
Should we re-name this to the programming language war thread? XD

TweaK
01-02-2007, 07:54 AM
Nah, it simply derailed, but it's back.. Sorta.

Jeremysr
01-11-2007, 07:05 PM
The ones that I know really well are PHP, QBasic, Lua. I'm learning C and LISP.

(I know XHTML and CSS too...)

Ne-yo
01-11-2007, 09:52 PM
I have used DrPython for a while now and really like it! Comes in Windows and Linux versions. It has clean displays and a minimum of quirks (does not like foreign characters). There are lots of configuration options. The results are displayed in an output window, and you can select and copy items from there. You can also install the code completion plugin from the internet from within the DrPython.

I have used HapDebugger, Boa, PyScripter, IDLE and PythonWin, I've even used SPE for quite a while. No, it's not the "Society of Petroleum Engineers", but "Stani's Python Editor". For some odd reason it has vanished on the net. I always come back to DrPython. I also use a more general editor/IDE called ConText. That one allows me to run C code and Python code in parallel.

Artelis
01-14-2007, 12:04 PM
Aiite, so when I was in fourth grade I used this scripting language called, uhm, frog? I don't remember, but it was used to control a little something. A frog I think. Anyway, my teacher CALLED it a programming language. Can I add that to my list? Probably not.

C, C++, Visual C++ (ew)
Visual Basic, QBasic, and Basic - Oh my!
Python, Perl, PHP - All with MySQL happiness.

Keep in mind I haven't really programmed since my junior year in college (3 years ago) so there's a good chance that I'm really bad at most of these now. We determined that last night ;)