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 188235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:58:15+00:00 2026-05-11T15:58:15+00:00

So the idea behind an array and a function are very similar from a

  • 0

So the idea behind an array and a function are very similar from a black-box perspective. You pass in the input value(s) and retrieve the output value. So is it better to keep array syntax and function syntax the same or is it better to have differences?

e.g.

print array[0]

print func(0)

versus

print array(0)

print func(0)

  • 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. 2026-05-11T15:58:15+00:00Added an answer on May 11, 2026 at 3:58 pm

    Ruby does some conflation – methods use (), but arrays, hashes, and lambda expressions (closest thing that ruby has to functions) can all use []. Together with ducktyping, this means you can pass around an object, and pass it values using [] not caring whether it’s precomputed (an array), calculated each time (a lambda expression), or calculated as needed and cached (which can be done with a hash).

    Another example that conflates the two is Haskell. As I remember it doesn’t have an array syntax built into the languange – accessing array indices is a function call, and can be used just like any other function.

    I prefer conflation actually – it allows for easier flexibility (which I like). Knowing whether you’re optimizing for speed or memory (like David said) is good to know, but I’m willing to take that responsibility on myself, rather than leaving it to cues built into the language.

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

Sidebar

Ask A Question

Stats

  • Questions 221k
  • Answers 221k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Create a Process object, and give all the information in… May 13, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer While the Date object returns times in milliseconds, that's not… May 13, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer Yes, the comparison is fair, especially when dealing with pointers.… May 13, 2026 at 12:09 am

Related Questions

I don't know much about Javascript, and this function I wrote doesn't seem to
What I'm trying to do is replicate the NSTokenField like UITextField seen in the
I like the flexibility of Dynamic SQL and I like the security + improved
I have an EJB3 bean deployed as a web service in JBoss 4.2.2. In

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.