Why bothers coding?

Katrina
Mon, 26 Sep 2022 03:52:14 +0000
Lab Assignment, Week 2, coding experience, javascript, typescript

The scholar of operating systems has likely never heard of the algorithms used by the scholar of machine learning, and vice versa, unless the one took a class on the other back when they were an undergrad and the fields will have changed more than a little since then.
Matt, et al. “A ‘Hello World’ Apart (Why Humanities Students Should Not Learn to Program).” HASTAC, https://www.hastac.org/blogs/evan-donahue/2010/05/28/hello-world-apart-why-humanities-students-should-not-learn-program.

Would you learn to code? In my opinion, coding is unnecessary beyond brain exercise purposes. One thing is for sure – coding takes a long time to learn and you will need to spend even more time to become a good programmer. When I learned to write the following piece of script, it did not go smoothly. I went into the massive search of function and library use. If I were to code this for a second time, I would almost do it ten times faster. Given that everyone’s time is precious, finding a collaborator who codes for you seems like a better option.

Coding is the most “basic”. Imagine you are about to prove a sophisticated math hypothesis; you would not start by proving the most basic theories. We do not code for code, rather, we code for various purposes. However, more ways to achieve those purposes have arisen, and some of them were built from code. For example, we do not write code scripts for our posts, we use WordPress. We do not use python to do calculations in a table, we use Microsoft Excel or Google Sheets. An arising number of interfaces, especially Graphical User Interfaces, are there to help people avoid coding to achieve goals more efficiently.

export default class BlocklyComp extends React.Component {
    workspace?: Blockly.WorkspaceSvg

    constructor(props: GameState & { granted_blocks: string[] }) {
        super(props);
        customBlocklyInit();
    }

    render() {
        return (

    )
}
    // sets up the workspace (also the toolbox)
    componentDidMount() {
        console.log("mount");
        this.workspace = Blockly.inject('blocklyDiv',
            { toolbox: document.getElementById('toolbox')!, renderer: 'thrasos' });
        this.updateToolbox(this.workspace, this.props.granted_blocks); // the initial toolbox, empty but we can add any block here
    }

    // called when there is a change in granted_blocks passed by the state of App
    componentDidUpdate() {
        console.log("update");
        if (this.workspace) {
            this.updateToolbox(this.workspace, this.props.granted_blocks);
        }
    }
    // update the toolbox in the workspace based on the array of granted blocks
    updateToolbox(workspace: Blockly.WorkspaceSvg, granted_blocks: string[]) {
        // console.log("updating toolbox");
        let toolXML = '<xml id="toolbox" style="display: none">';
        _.forEach(COMMANDS, (data, name) => {
            if (!_.includes(this.props.puzzle?.library.restricted, name) && _.includes(granted_blocks, name)) {
                toolXML += data.block;
            }
        });

        toolXML += '</xml>';
        workspace.updateToolbox(toolXML);
    }
}