ComputerScientist
174 subscribers
14 photos
3 files
206 links
▜ The Inventor

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
“Using case-insensitive filenames and commands is an act of evil and the sinners must be punished with deprecation.”
— the semicolon
“I feel no need to cater to bad programmers.”
— Charles H. Moore, #Forth
“Chuck's greatest contribution was teaching that understanding and simplifying the problem was far more effective than adding complexity to a solution.”
— massung, GitHub comment
Test, even after the smallest of changes.
How to keep your code clean

Modularize: break it down to pieces that make sense alone and may be reused elsewhere

• Have general conventions for naming files, modules, functions, variables, etc.

Document everything: write comments, docstrings and function helplines

• Keep performance in mind: free files, resources and dynamic memory

• Abstain from repeated code: use procedures and functions instead

• Keep your code readable using indentation and alignment

• Keep global variables to a minimum by using singletons

• No surprises: handle exceptional cases
A worthy abstraction is one which is achieved through introducing little indirection.
What can't be automated?
It is recreational, to recreate in Recreate.
Following standards while fixing a bug prevents future bugs and a messy codebase.
I don't think in any language. I think in images. I don't believe that people think in languages. They don't move their lips when they think. It is only a certain type of illiterate person who moves his lips as he reads or ruminates. No, I think in images, and now and then a Russian phrase or an English phrase will form with the foam of the brainwave, but that’s about all. ”
— Vladimir Nabokov, Strong Opinions (1973)
Pedantry is to make explicit that which is implicit.
Egyptian hieroglyph was the first monowidth font.
Resist the urge to marry the language to the environment.
Constantly ask how.
Mathematics is often an inappropriate approach for solutions, but almost always the one used.
ODBC
Open Database Connectivity is an API for DBMSs which achieves DBMS-independence by using drivers that encapsulate the logic of translation. An application connects to an ODBC driver through
the ODBC driver manager, then sends ODBC functions which the driver translates and passes to the DBMS. An ODBC driver enables an ODBC-compliant application to access a data source,
normally a DBMS.

Drivers exist for major DBMSs:
• Oracle
• PostgreSQL
• MySQL
• Microsoft SQL Server
• Sybase ASE
• SAP HANA
• DB2

and various other non-DBMS data sources:
• Microsoft Excel
• plain text
• CSV

Drivers
ODBC drivers encapsulate 3 broad categories of functions:

1. finding, connecting to and disconnecting from the DBMS that the driver talks to
2. send SQL commands from the ODBC system to the DBMS, converting or interpreting any commands that are not supported internally.
3. convertion of data from the DBMS's internal formats to a set of standardized ODBC formats, which are based on the C language formats.

Drivers of different technologies may implement either more or less than all functionalities defined in the ODBC standard.
"No sudden moves."
First write the desired call, then implement its function.

First design the front-end, then develop the backend.

That way you already know what you're making will satisfy your needs.
There is a better way.