[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
ClanKiller.com - View topic - n44b question
It is currently Sun Nov 24, 2024 4:19 am



Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
n44b question 
Author Message
Minor Diety
User avatar

Joined: Mon Mar 31, 2003 7:23 am
Posts: 14892
Location: behind a good glass of Duvel
Reply with quote
Post n44b question

_________________
"I find a Burger Tank in this place? I'm-a be a one-man cheeseburger apocalypse."

- Coach


Sun Jan 14, 2007 8:17 am
Profile
Emperor
User avatar

Joined: Wed Apr 16, 2003 1:25 am
Posts: 2560
Reply with quote
Post 
Whatever you do, you need to state what is your goal: what do you intend to do.

If you go for web programming, C++ will be a redundant overkill. If you want to do stuff close to kernel/OS programming or maybe solve the problems that need both efficiency and abstraction C/C++ are the right things to consider.

in ISO C/C++ can be platform and compiler dependent and isn't as gentle as in .NET - in .NET you have C++ too but there you might like to try out C# or VB instead. At end, if you prefer not to be bound to Microsoft, yet to make it easier way, you will definetely like to try out Java. You will sacrifice some of performances but you will do the job easier way.

If you insist, you can start with C++, but there you will like to practice the basis characteristic for C too before you start with .
And if you are still in doubt whether C++ is for you or not, you might like to see too.

Huh... this isn't topic for me.

_________________
++


Last edited by RB on Sun Jan 14, 2007 1:19 pm, edited 3 times in total.



Sun Jan 14, 2007 8:48 am
Profile WWW
Minor Diety
User avatar

Joined: Tue Apr 01, 2003 10:23 am
Posts: 3956
Location: Amsterdam
Reply with quote
Post 
You can teach yourself Visual Basic very easily. Even I can code that.

_________________
Melchett: As private parts to the gods are we: they play with us for their sport!


Sun Jan 14, 2007 9:43 am
Profile
Duke
User avatar

Joined: Mon Mar 31, 2003 8:59 am
Posts: 1358
Location: right behind you
Reply with quote
Post 


Sun Jan 14, 2007 1:30 pm
Profile YIM WWW
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16662
Location: On a slope
Reply with quote
Post 

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Sun Jan 14, 2007 2:38 pm
Profile WWW
Emperor
User avatar

Joined: Wed Apr 16, 2003 1:25 am
Posts: 2560
Reply with quote
Post 

_________________
++


Sun Jan 14, 2007 3:03 pm
Profile WWW
Minor Diety
User avatar

Joined: Tue Apr 01, 2003 10:23 am
Posts: 3956
Location: Amsterdam
Reply with quote
Post 
Off course I'm not a programmer, but form an end-user's view I can say Java sucks. Every Java program I've ever used eats memory for breakfast and lunch.

_________________
Melchett: As private parts to the gods are we: they play with us for their sport!


Sun Jan 14, 2007 3:40 pm
Profile
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16662
Location: On a slope
Reply with quote
Post 
Java has some issues, I'll give you that. Some problems are inherent...the language is cross-platform compatible...basically you kinda precompile the thing, then distribute it...when a user wants to run it, the final compile runs on their machine, whcih converst it into something useable by their platform. That's how a Java applet works just as well on Solaris, Red Hat, Windows and Mac.

However, the negative effect is every time you run a java applet, you're basically compiling it (sorta) which makes loading times retarded. So you give up quick loading for cross platform compatibility.

Some other issues I've seen with Java are things like memory usage (which is supposed to be handled automatically, AFAIK) and what seems like some crashingness. Having never really programmed in it, though, I can't say whether some of the negatives I've noticed are due just to bad programming. I mean, I've seen some REALLY bad PHP, but that doesn't make PHP bad.

As for C++...let's just say that when I was trying to learn it, I would spend hours/days trying to figure out easy crap. Like using one of the built-in functions (or part of the standard library, whatever) that expects a char input and I'm trying to push in a string... and it took me forever to figure out to just use .tochar() (or something like that, I forget again).

Why? Why not just overload the standard library function to allow string input? It's not hard. I do overloading of methods regularly in c# as just part of my web development...it's really not that hard. But it's little simple crap like that which really annoys me.

Some other stuff... memory allocation. I hate having to specify the size of a memory buffer every time I create a variable. c# still has that problem when it comes to arrays.

Let's say I'm trying to stuff a sql query result set into an array. In php, I would run the query, then read it (probably using foreach() and just push it into the array. Boom, done, very few lines of code.

[php]
<?
$select = 'SELECT one, two three FROM table';
$result = $this->doquery($select);
/*
I usually put the actually query execution in a separate method...
makes switching DBs / DB Types alot easier
*/
foreach($result as $row){ //exact syntax is a bit different, I forget
$array[]['one'] = $row['one'];
$array[]['two'] = $row['two'];
$array[]['three'] = $row['three'];
}
print_r($array);
?>
[/php]

however, in c# you can't do that. I don't have my IDE here, so the following is pseudo-c#

[php]<%
string select = 'SELECT count(*) FROM table'; //get the number of results
doquery(select);
/*
I use oledbdatareader objects to pull the data and store the result set to a class property
*/
dr.Read();
int numrows = Convert.ToInt16(dr.GetValue(0))
string[,] myarray = new array[numrows,3];
select = 'SELECT one, two three FROM table'; //get the actual results
doquery(select);
dr.Read();
for(int i=0; i<numrows; i++){
myarray[i,0] = Convert.ToString(dr.GetValue(0));
myarray[i,1] = Convert.ToString(dr.GetValue(1));
myarray[i,2] = Convert.ToString(dr.GetValue(2));
dr.Read();
}
foreach(string row in myarray){
Response.Write(row[0]) + "<br>";
Response.Write(row[1]) + "<br>";
Response.Write(row[2]) + "<br>";
}
%>[/php]

Now, I may not be doing this as well as I could be, but the point is that c# is significantly more taxing on the programmer than PHP is. PHP automatically figures out the type of the array (and allows mixing of types), which in c# you have to specify it...and woe unto he who tries to stuff the wrong type into the array. PHP also allows you to dynamically size the array as needed...in c# you have to specify it manually. And finally, in PHP you can get a num_rows easily from a query. In c#, you can't get the number of rows returned from an OleDBDataReader object. Though you can get the number of fields returned. :)

Bleh...anyway, maybe I'm spoiled.

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Sun Jan 14, 2007 6:05 pm
Profile WWW
Emperor
User avatar

Joined: Wed Apr 16, 2003 1:25 am
Posts: 2560
Reply with quote
Post 

_________________
++


Mon Jan 15, 2007 12:27 am
Profile WWW
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16662
Location: On a slope
Reply with quote
Post 
ok, good point, your code is cleaner. A few things....

As far as I can tell, in c# you can only use index numbers to reference values in an array. ie, it's all array[0], array[1], etc, not array['myfavorite'] like you can do in PHP...which really really sucks. I may be wrong, but if you can do it I certainly haven't figured out how.

Similarly, with oledbdatareader objects, you can't reference a field in your result set by name. Same deal...dr.GetValue(0), dr.GetValue(1), etc...that also really sucks. It means I really have to pay close attention to my select statements and if I make a change to the number or order of queried fields, I have to change all references accordingly. That's not necessary in PHP.

A strength, as you mentioned, is that I can always make little helper functions. Plus, to be honest, the numbers of functions available to c# is incredible. C# is only Windows compatible (I think...maybe there's an apache mod by now), but its file functions kick the crap out of PHP.

Anyway...I was just kinda griping about the crap I hate about C#. There's also crap I hate about PHP. And Javascript. And I reverse-engineered a Perl script and, even though I only had to figure out about 20 lines of code, there's definetely some crap I don't like about it, either. :)

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Mon Jan 15, 2007 7:42 am
Profile WWW
Emperor
User avatar

Joined: Wed Apr 16, 2003 1:25 am
Posts: 2560
Reply with quote
Post 
If C# supports generics (and supports them as far as I know) there should be some template that allows you to index elements by other objects. In Java is one HashMap, in C++ is one map. Of course they can't do that with pure arrays but there are other data-structures made for that.

Whatever... if it does not have it, you can make it.

_________________
++


Last edited by RB on Mon Jan 15, 2007 10:09 am, edited 1 time in total.



Mon Jan 15, 2007 8:53 am
Profile WWW
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16662
Location: On a slope
Reply with quote
Post 
hmmm...perhaps my lack of any formal programming courses is hindering me in some ways. But perhaps not. I've seen some of the stuff the programmers at my work have put out... we had a web-based product written in ASP that was total and absolute crap. They actually passed user authentication information in GET variables... so anyone with the slightest bit of knowledge could easily hack their way to administrative level access. And that's just the most obvious example of poor coding.

Anyway, bleh, I'm honestly not trying to slam c# or c++... they're just alot more strict then PHP or javascript are, imo.

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Mon Jan 15, 2007 10:08 am
Profile WWW
Minor Diety
User avatar

Joined: Mon Mar 31, 2003 7:23 am
Posts: 14892
Location: behind a good glass of Duvel
Reply with quote
Post 
Let me interrupt your little programming spat by saying 'thank you' for the input to all of you crackheads. I guess I'll be hitting PHP then for now. :)

My goals aren't really well-defined, I just want to get a language in my fingers to start with. So I guess that I'd be busy with 'building' (a big word for a n00b like me :P ) web applications to start with, so C++ is very probably totally redundant. :P

Thanks again. If I get around to it, which I will, just not sure when, I'll be sure to harass you guys.

_________________
"I find a Burger Tank in this place? I'm-a be a one-man cheeseburger apocalypse."

- Coach


Tue Jan 16, 2007 5:17 pm
Profile
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16662
Location: On a slope
Reply with quote
Post 
I have a tutorial on how to set up a PHP/MySQL development environment on Windows. Check it out....the installation process can be very...frustrating... if you don't know what you're doing.

http://clankiller.com/technical/programming/PHP/

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Wed Jan 17, 2007 7:19 am
Profile WWW
Duke
User avatar

Joined: Mon Mar 31, 2003 8:59 am
Posts: 1358
Location: right behind you
Reply with quote
Post 
Or for the ultra n00b, there's


Wed Jan 17, 2007 9:57 am
Profile YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.