Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6905481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:11:18+00:00 2026-05-27T08:11:18+00:00

I come from a PHP/Javascript background where things are stored in a variable directly

  • 0

I come from a PHP/Javascript background where things are stored in a variable directly in most cases, where we also had Object/Classes/Methods, etc. It was OOP.

Now I’m starting to learn Objective-C. I understand the basics of pointers. But everything is a pointer now. This is the part that I don’t get. Why aren’t we like in PHP/Javascript with direct assignment? We are still doing OOP afterall.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:11:19+00:00Added an answer on May 27, 2026 at 8:11 am

    If you look at the semantics of JavaScript and many other OO languages (perhaps including PHP, but I’m not sure and not willing to guess), you’ll see that these languages offer the same indirection Objective C offers through pointers. In fact, internally these languages use pointers everywhere. Consider this (JavaScript) snippet:

    function f(obj) {
        obj.x = 1; // modifies the object referred to directly
        obj = {x: 2}; // doesn't affect caller
    }
    var foo = {x: 0};
    f(foo); // passes a pointer/"reference"
    // foo.x === 1
    

    It’s roughly equivalent to (C as I don’t know Objective C) something like this, modulo manual memory management, static typing, etc.:

    struct Obj { int x; };
    void f(struct Obj *obj) {
        obj->x = 1;
        obj = ...; // you get the idea
    }
    struct Obj *foo = malloc(sizeof(*foo));
    foo->x = 0;
    f(foo);
    free(foo);
    

    It’s just explicit in Objective C because that language’s a superset of C (100% backwards compability and interoperability), while other languages have done away with explicit pointers and made the indirection they need implicit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I come from PHP background and am used to doing var_dump , echo and
I come from a PHP based background and my new years resolution was to
I come from a php background and in php, there is an array_size() function
I come from a PHP background and I'm just getting my teeth into some
I'm not too used to ORM mapping, having come from a PHP background. I'm
I come from a mainly PHP background and make good use of the Apache
I come from PHP world, where declaring a function in the middle of a
I come into ASP.NET from php so the reason why i ask my question
I come from a Java background, where packages are used, not namespaces. I'm used
This below output come from php json_encode.What we see here is 0849 is twice.Since

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.