I finally used a do...while statement!

docmanhattan

Golden Member
Jul 31, 2001
1,332
0
0
I've programming in PHP for about 2 years now and I had yet to actually make use of the do..while control structure. Mostly because there are ways around using a do...while.

But today, I finally make actual, real use of the do..while that probably saved me 3 whole lines of code. woo-ha! ;)

Okay, admittedly, this is not the biggest deal, but there's really no one in the office to share my joy. At least here I can garner attention, albeit negative most of the time, but attention nonetheless. :D :D

At the very least I'm hoping for a "PHP is suck." response. ;)

:)
 

docmanhattan

Golden Member
Jul 31, 2001
1,332
0
0


<< PHP is suck, next time use ASP.NET with C# >>

Having read your other posts, I knew you'd be the one to say it. ;)

Actually given that PHP is very similar to C (mostly because PHP source is in C), I'm going to learn C next.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0


<<

<< PHP is suck, next time use ASP.NET with C# >>

Having read your other posts, I knew you'd be the one to say it. ;)

Actually given that PHP is very similar to C (mostly because PHP source is in C), I'm going to learn C next.
>>



better then JAVA i guess :D


actually C is a good language to learn early on it makes other languages seem nicer then they really are. :D
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0


<<

<< PHP is suck, next time use ASP.NET with C# >>



Spoken like a true MS dude. :)

amish
>>




:D you gotta try it to become a believer, it is soo fast and easy to dvelop beautiful web apps. not mention when webservices become available widely there is no stopping it.
 

manly

Lifer
Jan 25, 2000
13,328
4,100
136


<<

better then JAVA i guess :D


actually C is a good language to learn early on it makes other languages seem nicer then they really are. :D
>>



If Java and J2EE are undesirable as you imply, then why'd Mickeysoft spend the last 6 years to clone it with C# and .Net?
 

Sir Fredrick

Guest
Oct 14, 1999
4,375
0
0
Don't bother with C, just go straight to C++.

I have yet to use a do...while loop. This somehow does not upset me. ;)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0


<< Actually given that PHP is very similar to C (mostly because PHP source is in C), I'm going to learn C next. >>



Hmm, no. PHP is very similar to C? When will people learn that syntactical similaries does not mean the languages are almost the same. C is *extremely* different from PHP, in too many ways to define in a single post.
 

Docmanhattan, I am shocked you never used the "do while" function! :Q
rolleye.gif


I think I should celebrate with ya 'cuz it's such an achievement for a programmer to do that for once at least. :p :/ :eek:
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0


<< If Java and J2EE are undesirable as you imply, then why'd Mickeysoft spend the last 6 years to clone it with C# and .Net? >>



Don't compare Java with C#. "Java" really encapsulates the idea of an entire platform, whereas .NET is used for that purpose, and C# is simply a constituent. C# is a small facet of the bigger picture, and yes, there are many syntactical similaries with Java. To say it is a clone, however, is an extremely obtuse statement. As they say in engineering: If you're going to reinvent the wheel, make it better. I firmly believe that .NET has accomplished this, in many ways. Java obviously ushered in a revolution itself, but .NET has done so as well by borrowing the great things about Java and improving upon it. What language/platform was designed entirely without influence from previously successful languages/platforms? I can only think of a few, and none of which are ubiquitously used today.
 

docmanhattan

Golden Member
Jul 31, 2001
1,332
0
0


<< Don't bother with C, just go straight to C++.

I have yet to use a do...while loop. This somehow does not upset me. ;)
>>

It never upset me per se, but i just felt like less of a programmer because i couldn't seem to work it into anything. ;)



<< you gotta try it to become a believer, it is soo fast and easy to dvelop beautiful web apps. not mention when webservices become available widely there is no stopping it. >>

That may be true but the web app is only going to be as good as the server it's hosted on and frankly M$ doesn't do so well there.

 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0


<<

<< Actually given that PHP is very similar to C (mostly because PHP source is in C), I'm going to learn C next. >>



Hmm, no. PHP is very similar to C? When will people learn that syntactical similaries does not mean the languages are almost the same. C is *extremely* different from PHP, in too many ways to define in a single post.
>>



Agreed, if people based judgments on syntax similarities alone, most languages are 'similar'.
 

AU Tiger

Diamond Member
Dec 26, 1999
4,280
0
76
>>do while not rsData.EOF <<

I lean towards the Do Until rsData.EOF if possible, I hate checking for false conditions.

I'm currently updating an application where one of the developers before me used While...Wend. :disgust:
 

docmanhattan

Golden Member
Jul 31, 2001
1,332
0
0


<<

<< Actually given that PHP is very similar to C (mostly because PHP source is in C), I'm going to learn C next. >>



Hmm, no. PHP is very similar to C? When will people learn that syntactical similaries does not mean the languages are almost the same. C is *extremely* different from PHP, in too many ways to define in a single post.
>>

Actually I'm not basing it on syntax. My basis is on the fact that a good number of functions in PHP are just translations of C functions. Mind you, I'm not saying they're identical, nor am I implying that PHP can do the same things. It's a server-side scripting language for heavens sake. ;) But the similarities are enough that moving over to learn C, IMHO, would not be to difficult. Of course, a lot depends on what your background is and what you already know.

:D
 

manly

Lifer
Jan 25, 2000
13,328
4,100
136
Descartes,

From reading your other geek postings, I respect your opinion and technical analysis.

There's nothing wrong with comparing Java and C#, since Java implies both the platform and the language. Obviously, this comparison refers to the language aspect.

If I were you, I wouldn't dismiss my point so quickly. The fact of the matter is that it took years of effort and unknown R&D dollars to "reinvent a wheel" (C#) that's slightly better at best. Most of the new "cool" features of C# are syntactic sugar that could be added to Java in a heartbeat if it made sense.

And the language independence of .Net is just M$ marketing spin at its finest. While it's commendable that .Net does provide many languages for a developer to choose from, it's worth nothing that they are all just semantic equivalents of CLS. In reality, C# is a first-class language, and any others are just dialects.

My point is that this "new" thing from M$ isn't so new, and it's not revolutionary. A lot of it is nicely imitated from the Java platform, so the buzz is mostly hype. Will it be a productive new development platform for web apps? Yes, I'll give it that much. But as far as being wowed by the technology, sorry but like I said, we've been there and seen that before. It just happens to be promoted by perhaps the finest PR department in corporate America.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0


<< Actually I'm not basing it on syntax. My basis is on the fact that a good number of functions in PHP are just translations of C functions >>



That's oversimplying it quite a bit. They're elucidated C functions. The only similarity is the function name, and the order of parameters. The whole idea of pointers is completely removed, which is a difficult topic in itself.



<< But the similarities are enough that moving over to learn C, IMHO, would not be to difficult. Of course, a lot depends on what your background is and what you already know. >>



Tru dat, but I think you're in for a more wild ride than anticipated. If you don't have a background in a C language, learning C is going to be somewhat difficult, regardless of how many other languages you know. Some people have terrible difficulty grasping the idea of pointers, and C makes heavy use of them. There are many nuances that have been completely removed from higher-level languages.

Either way, I'm sure you'll do fine. Learning C will help you immensely in the future.
 

royaldank

Diamond Member
Apr 19, 2001
5,440
0
0


<< I lean towards the Do Until rsData.EOF if possible, I hate checking for false conditions. >>



I've actually always used the other way. Maybe I'll start using 'do until.' Thanks,



<< I'm currently updating an application where one of the developers before me used While...Wend. :disgust: >>



D'Oh!
 

docmanhattan

Golden Member
Jul 31, 2001
1,332
0
0


<< That's oversimplying it quite a bit. They're elucidated C functions. The only similarity is the function name, and the order of parameters. The whole idea of pointers is completely removed, which is a difficult topic in itself. >>

elucidated: i r dum. I had to look that one up. :D I see your point. The functions may have the same name and may look the same, but in reality are just watered down versions of the real thing. Fortunately for me, all of our server apps are written in C, so there's a good bit of stuff I can dig around in to learn from.

:D