Weeder courses: yea or nay?
A lot of schools take pride in having "weeder" courses for various fields that, as the name implies, weed out those students unworthy to pursue the field. Some of the better schools however often have a second track for students who are interested but don't necessarily want to become professionals or professors in the field. But let's pretend we're looking at a program where no alternate track exists. Are weeder courses a good idea?There are three big problems with weeder courses. The first is that reality is a graph, not a hierarchy. The common assumption underlying the argument in favor of weeder courses is that if those courses cannot be passed, nothing else will make sense. Weeder courses are only in base-level courses without which nothing further can be gained.
This assumption is false in general. Of course for localized special cases it holds: one needs to know addition before multiplication and multiplication before exponentiation and exponentiation before Knuth's up-arrows. But one does not need to deeply (or in some instances not even shallowly) understand the differential or the integral calculi before one can understand fuzzy logic, discrete probability, frequency, combinatorial game theory, number theory, or how to feed instructions to a computer. (How to feed instructions that calculate via differential equations on the other hand... But you don't need to be good at it; the Deep Blue programmers weren't better than Kasparov at Chess, they just needed to understand the basics of how Chess worked.)
See Full Post and Comments
Clojure and jMonkeyEngine Tutorial 2
Another simple translation to Clojure code. There are some repetitions that are popping up that we might want to abstract into functions or macros, but so far it's fairly pedestrian.As a philosophical side note, defining a new function in Java takes effort. It's no wonder it's not done as much. You have to pick a class to put it in, you have to decide its class-scoping, you have to specify its argument and return types, any thrown exceptions, decide if it should be part of an interface somewhere... In practice, code changes. There's nothing wrong with type checking at compile time, but that's only useful when you're reasonably sure the code being checked isn't going to fundamentally change.
Anyway. Here's the code for tutorial 2:
See Full Post and Comments
Getting started with jMonkeyEngine and Clojure
"I want to write a 3D game in Clojure! But I don't want to bother with raw OpenGL crap, I had my fill of that with Python and PyOpenGL... And I didn't particularly like Panda3D for Python either. I guess I won't be satisfied until I make my own engine one day. But in the meantime, what's a good engine for Java? I remember hearing years ago about something with monkeys..."That was my thought process a couple weeks ago, and a swift google reminded me of jMonkeyEngine, or JME for short. I had first heard about it back in 2007 or so, but had never played with it seriously. So I figured, why not? Unfortunately I was under some misconceptions that made the introductory period harder. I'll go over the biggest one quickly. JME is better thought of as a collection of libraries rather than a single jar you dump in your project and start building off of. On top of this collection, JME includes a nice IDE and they really want you to use it all together as part of an SDK platform. I really want to use just vim and the command line and treat their stuff as a library. So immediately I'm at odds with the tool, but no matter, it's not impossible to overcome.
Anyway, let's get started, step-by-step. Create your new clojure project with the lein tool:
See Full Post and Comments
"I can understand what each line is doing"
This is typically said of a "simple" language such as C (and sometimes, lately, Go) because the abstraction layer between the hardware and the language is light. If nothing else, you can figure out what's going on at the hardware level if you really want to. (And in Go you don't have to "worry" about the possibility of a macro.) This might help you reason about performance, or understand a disassembled binary, or just as an excuse not to use C++.A typically response might be "Oh really? What does the line with fnord(i); do?" The correct answer is "It finds the variable i using lexical scoping rules, puts a copy of it in a free register (or pushes it on the stack), and jumps to the location of the fnord function which may or may not use the i value in the register or on the stack, may or may not do something else, and may or may not alter the machine instruction pointer to avoid returning to the jump location like a normal function would."
Okay, but what does the piece of code do? As a programmer reading C code, almost all of my time is spent trying to understand that. Better rephrased, what goal does the piece of code accomplish? I don't tend to care what the machine itself is doing, except in very specific circumstances like optimization and hardware programming.
See Full Post and Comments
1000 Lines
For today's installment of arbitrary thresholds, I bring you this one: before you can even consider yourself a novice in a programming language, capable of doing something useful and capable of offering critique for or against it, you need to have programmed at least 1000 lines of code in that language. If this seems obvious to you, with perhaps uncertainty of whether it's 1000 or 800 or 2000, feel free to quit reading. The rest of the post is devoted to bringing up a few possible objections and hand-waving them away because they don't matter.First up: lines of code is a horrible metric! Yes, for measuring programmer productivity. But for determining whether you're a n00b or not, I don't think so. If you discover a way to shave off 300 lines of verbose code, replacing it with 10 lines, assume an expert in the language would have seen that immediately. In any case, you win 310 lines in your goal to 1000.
Next up: all programming languages are not equal, what might take 1000 lines of Java might only take 30 lines of Lisp. This is true, and that's why Java is the Enterprise Standard and Lisp is not. It's easier to become a novice in Java than it is for Lisp, regardless of prior programming background. A Lisp "hello world" gives you 1 line in your quest, Java's gives you 5.
See Full Post and Comments
Proofs for and against God
I think I need a simple precursor to my post about proof. This post is meant to destroy the notion that there is anything we cannot prove. I have two preliminary subpoints.There is no difference between a positive and a negative claim because one can be expressed as the other. I claim "God exists". That is a positive claim. I also claim "God is not nonexistent." This is a negative claim but says exactly the same thing as the first claim.
"Burden of proof" is an expression that signals you are suffering from diseased thinking. There is no such thing as "burden of proof" except in a legal context, where legal proof is the same thing as legal evidence. Proof in general, however, is not the same thing as evidence in general. Much confusion arises from conflating the two. In matters of Truth, there is only "burden of evidence."
See Full Post and Comments
For Else in Python
I have the unfortunate brain wiring where once I understand something complete, or do some task such that it works, that thing suddenly seems trivial to me. I think this is generally true for most individuals who have spent even as little as a year in a narrow field of study, like programmers with a particular programming language. If you're a half-decent programmer, did you know you could make some money by writing a beginner's book? All that stuff that seems trivial to you now, you could monetize! Or be like me and point to other references that are free...Anyway, the subject of this post. Python has a construct where the for loop or the while loop have an optional else block you can attach to them. The rule that determines whether the block gets executed or not is at first unintuitive, but it becomes immediately clear with an example.
You probably think the else block should execute only if the loop never ran once? If you think that, you are wrong. The rule is: execute the else block if the loop completed normally; that is, without a break statement. (Or raised exception.)
See Full Post and Comments
Recent Posts
2025-07-07
2025-03-15
2025-03-03
2025-02-13
2025-01-14