![]() |
|
|
Do you miss UNIONs? |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
There are no union types in the .NET framework, and I can't remember the last time I've heard any developer mention them.
In .NET land, the runtime enforces locality for us, automatically. Variables that are declared together, occupy memory together. This is what a union does, as opposed to a class or a struct (which are the same thing in C). Does anybody miss using unions? Am I missing anything in my analysis? What do open source linux and PHP people do?
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
| Sponsored Links (We share ad revenue): |
|
|
Re: Do you miss UNIONs? |
|
Fetchez la vache!
Latest Blog Post:
Pretty pretty please…. Posts: 1,689
Name: Thierry
Location: In the void
|
Hmmm...
John, you lost me there. You are not talking about union joints, aren't you ? I don't remember having ever used an union keyword in my C days. And let me check back my C reference.... Ok, I see now. I've used the struct definition, but never was introduced about the UNION keyword. So I kind of used it without knowing it. I cannot say I miss it then. And as for the PHP question, I don't believe there is anything like that in it. And It does sense, in a certain way... PHP has been designed from the ground to be ran and shutdown sequentially. There are no engine nor binary that stay in memory, except when you use the POSIX extensions to thread a process, but it's a bit special, and out of the scope of 99.999% of PHP programming. So, no, nothing similar exists in the PHP world, as far as I know.
__________________
Listen to the ducky: "This is awesome!!!" |
|
|
|
|
|
Re: Do you miss UNIONs? |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
I'm curious about this, can you expand a little bit? I would think any language is designed to run in a given sequence or series, until your code runs to its end, quits, or dies or is killed? Unless, as you say, the programmer decides to use threading, which then changes things.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: Do you miss UNIONs? | |
|
Fetchez la vache!
Latest Blog Post:
Pretty pretty please…. Posts: 1,689
Name: Thierry
Location: In the void
|
Quote:
PHP was developped at first as a CGI program to replace some keywords with computed values. Nothing more than a simple parser, as explain the acronym: PHP: Hypertext Preprocessor Being designed to be instantiated at a time X, and destroyed at a time X+Y milliseconds, I can understand that some neat features that we found in languages like C are not present, because the PHP engine rely on the underlying system for some fundamentals. PHP has been designed to be plain simple from beginning, and his hidding a lot of advanced concept from the developers, which lead it to the current state of disaprobation through "enterprise level" language adopters. Try to say"php" to a C#, vb.net or java dev. crowd and look at the disgusted faces... It can be considerd as good, or bad, following the point of view. I personally find it more good than bad. I learned with PHP, and ended with a syntax close to C even in that loosely typed world, just because I've it to be less prone to error. It's a personnal effort, though, that nor many PHP developpers will make. And I think that most advanced PHP dev will sooner or later tend to C# or Java, either by interest or by necessity. It's where the jobs are, simply put. At least here, in Europa. The main difference I see, is that compiled programs (and in an extend, .Net and Java web apps), which will be instantiated by a virtual machine and stay in memory, must have those kind of optimization available. Simply to limit the footprint it will have on the system. They are often designed to run until an exception or a particular signal telling them to shut down. PHP scripts, on the other hand are designed to die on a short notice, and if they don't it's the exception. PHP don't thread process, it forks them. A notable difference: http://gauss.ececs.uc.edu/Users/Fran...ads/forks.html You can clone a process and detach it in the background, but some limitations that the engine put will stay. Not the limited run time (when you are in a console based PHP script, it's automatically set to infiny), but on the max memory size that the script can grow to. This can bring to a severly imparied server, f you don't handle GC nor emergency exit correctly. Been there, done that and realised more realistically how desktop and web app yould be different...
__________________
Listen to the ducky: "This is awesome!!!" Last edited by tripy : 04-18-2008 at 05:47 PM. |
|
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |