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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:40:51+00:00 2026-06-11T08:40:51+00:00

What was the original reason for MATLAB’s one (primary) function = one file, and

  • 0

What was the original reason for MATLAB’s one (primary) function = one file, and why is it still so, after so many years of development?

What are the advantages of this approach, compared to its disadvantages (people put too many things in functions and scripts, when they should obviously be separated … resulting in loss of code clarity)?

  • 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-06-11T08:40:52+00:00Added an answer on June 11, 2026 at 8:40 am

    Matlab’s schema of loading one class/function per file seems to match Java’s choice in this matter. I am betting that there were other technical reasons for speeding up the parser in when it was introduced the 1980’s. This schema was chosen by Java to discourage extremely large files with everything stuffed inside, which has been the primary argument for any language I’ve seen using one-file class symantics.

    However, forcing one class per file semantics doesn’t stop mega files — KPIB is a perfect example of a complicated, horrifically long function/class file (though a quite useful maga file). So the one class file system is a way of trying to make the user aware about code abstraction more than a functionally useful mechanism.

    A positive result of the one function/class file system of Matlab is that it’s very easy to know what functions are available at a quick glance of a project directory. Additionally many of the names had to be made descriptive enough to differentiate them from other files, so naming as a minor form of documentation is present as a side effect.

    In the end I don’t think there are strong arguments for or against one file classes as it’s usually just a minor semantically change to go from onw to the other (unless your code is in a horribly unorganized state… in which case you should be shamed into fixing it).

    EDIT!

    I fixed the bad reference to Matlab adopting Java’s one class file system — after more research it appears that both developers adopted this style independently (or rather didn’t specify that the other language influenced their decision). This is especially true since Matlab didn’t bundle Java until 2000.

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

Sidebar

Related Questions

For some reason when I append element to xml file, it's written in one
For some reason, one of my params (file upload) always is nil. Here is
This is the original header file: @interface TestDataHelper : NSObject { } +(void) populateTestData:(NSManagedObjectContext*)
The original words are One reason that the distinction between process and procedure may
For some reason my http://www.mobileitnext.nl/css/style.css gives Lexical errors. This is the original code, do
[Original] I have a ListBox which has its ItemsSource (this is done in the
I have created a key file with this command: sn.exe -k 2048 Build.snk I
For some reason this basic JS to detect the browser's resolution works in Safari
I still haven't found a reason why the lowest signed negative number doesn't have
For some reason, the output of this: public void msgNeedParts() { // Blabla... System.out.println(name

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.