4 ms·
As a bit of an accidental programmer (HTML, CSS, TeX, along with enough Node and PHP to dislike them both) can someone provide a concise distinction on the diff
by chrisfinazzo 7y ago
As a bit of an accidental programmer (HTML, CSS, TeX, along with enough Node and PHP to dislike them both) can someone provide a concise distinction on the difference between the idea that something is "in the standard library" vs "part of the language?"
For example, in CSS, I don't need to import a module with the syntax for Grid, it's just...there, no extra typing required.
- thomascgalvin 7y ago"Part of the language" means that the language's syntax directly allows you to do a thing, while "in the standard library" means that the functionality is included with all (or at least most) versions of the language, but the language syntax doesn't provide the feature directly. For example, take dictionaries (or maps). It lets you use a key (like "bob") to look up a value (like "555-555-1234" or "bob@spam.email"). Dictionaries are built into the language in Python, so to do the above, all you'd have to type is: phones = { "bob": "555-555-1234" } In Java, maps are part of the standard library. They're there, but you have to import them: import java.util.* Map<String, String> phones = new HashMap<>(); phones.put("bob", "555-555-1234"); The main difference is that features in the standard library can be written in the language itself. Java's Map classes are written in Java, while Python's dictionary utilities are written in C. Other than that, the difference is largely semantics.