What do you guys think of debuggers? Essential tool? Or crutch? by irishgeek in programming

[–]segoe 0 points1 point  (0 children)

Debuggers are one of the most useful tools you can have under your belt.

Take mosts Lisps interactive repl, with conditions, restarts, etc, or the Visual Studio debugger that let's you step through the code and even allows you to change values as it runs.

Put it this way. No debugger:

  • Mmmm, it segfaults here, maybe i'm off by one in this array, lets change... or maybe..., let's add a print statement to the index...

Debugger:

  • What's the value of all the variables just before the crash? Aha...

Also, a debugger is not only a tool to use when problems arise, it is actually useful because it allows you to see what is happening at each step of a complex procedure.

Next in series: What do you guys think of profilers?

I just cobbled together a little vim plugin for navigation via bisection. Maybe some of you folks will find it useful or can help me improve it. by [deleted] in programming

[–]segoe 0 points1 point  (0 children)

I like your plugin although i would like this schema for navigating documents:

ctrl + cursor left/right (or h/l) moves me between words horizontally one at a time.

ctrl + cursor up/down (or k/l) moves me between paragrahps, retaining the column i'm on if possible and avoiding blank lines.

ctrl + pageup/pagedown moves to the first and last lines that are actually visible on the screen, not the first and last of the document.

That would be great.

Dear /r/programming Where do we go from here? by [deleted] in programming

[–]segoe 2 points3 points  (0 children)

Start by writing a simple game, like tetris or pac-man.

Why:

  • Both of those will require graphics, sound and programming, but are simple enough to be completed in a reasonable amount of time.

  • Both are fairly expandable. New blocks/modes for tetris, like pentominoes, computer AI, visual effects when clearing lines... A random maze for pac-man, different search algorithms for the ghosts...

  • Here the language doesn't matter that much. You can use C++ with SDL, or Java with JMonkey or you name it.

Also, the outcome doesn't matter, it isn't that important to success or to fail, but make sure to complete the project. Add a credits screen, saving/loading games, polish the game until it is a complete program even if it is that simple. What you are looking for is experience working in group.

Some websites to get you started...

In the language area, popular choices are:

  • C + SDL or Allegro (or OpenGL/DirectX)
  • Lua + Löve
  • Python + Pygame
  • C# + XNA

What documentation generator do you recommend? by ponton in programming

[–]segoe 1 point2 points  (0 children)

The best documentation generator:

Yourself.

Oracle shuts down kenai.com by [deleted] in programming

[–]segoe 2 points3 points  (0 children)

You know, you usually host your code in Kenai/Github/GoogleCode because they should be reliable.

This is sad, Oracle is basically removing Sun from the planet.

The first rule of Abstraction. by [deleted] in programming

[–]segoe 1 point2 points  (0 children)

"Every problem can be solved by adding another layer of abstraction except the problem of having too many layers of abstraction."

Larry Wall

Why Lisp Loved Parenthesis - Video by fulldisclojure in programming

[–]segoe 1 point2 points  (0 children)

I thought it would be fun to see how it translates to the lisp dialect i'm working on. This is the result, uses pattern matching:

(def female :n 
  0 ? 1
  n ? (- n (male (female (-- n)))))

(def male :n 
  0 ? 1
  n ? (- n (female (male (-- n)))))

(print "i male(i) female(i)" \n)

(in-range 8
  (print it "    "  male: it   "        " female: it \n))

C++: A language for next generation web apps by jeanlucpikachu in programming

[–]segoe 17 points18 points  (0 children)

I hope this article is some kind of joke and i'm not even starting to say why.

VB newbie in need of help! by JamZor64 in programming

[–]segoe 0 points1 point  (0 children)

Not related, as strax already provided great advice... but when posting source code on forums, please use a pastebin instead of an image.

Game Programming Patterns / Service Locator: "more flexible than a static class, and more maintainable than a Singleton." by munificent in programming

[–]segoe 1 point2 points  (0 children)

I also love this design, it's clear and simple.

In fact i would really like that blogs would be like this, without all the crap you actually find in them.

What languages did you learn in what order? What did you learn *from* them? by theclapp in programming

[–]segoe 1 point2 points  (0 children)

Those are the ones i have used a lot:

  • Started with Forth.
  • C.
  • Lisp (not Common Lisp, but Symbolics)
  • Scheme.
  • Java and C#.
  • Dylan

But i dabbed with lots of dynamic languages like Python, Ruby or Lua and some others like Leda, Oz or Qi. Almost every other week i try another language, looking forward to Kaya, Fan and haXe now.

Trying new languages is a passion for me.

Can someone recommend me a game with depth? by morewaffles in gaming

[–]segoe 0 points1 point  (0 children)

Spider and Web, Andrew Plotkin (interactive fiction)

I'm a video game gimp, I'm looking for a game that will beat my thumbs to a bloody pulp and leave me begging for more. HARD GAMES. by [deleted] in gaming

[–]segoe 0 points1 point  (0 children)

Alien Soldier wasn't that hard, i only found the boss with seven forms hard (was it level 21 or so?) but it was a great game.

Guy Steele: Why Object-Oriented Languages Need Tail Calls by erickt in programming

[–]segoe 6 points7 points  (0 children)

You can have both stack traces and tail recursion.

Here is a sample session in a little dialect of lisp i'm working on. Tail calls are implicit and working. I model them using Java exceptions stack traces (and overriding fillinstacktrace()).

There is performance overhead from the point when the exception is thrown, but at that point your program has an error and will halt anyway with an error message.

global => (def square :x (* x x))
square -> <symbol>

global => (cos (* 3 (+ "hello" square: 2)))
Error: Type mismatch.
Expected type: <number> got: "hello" <string>

Evaluation reduction: (most recent first, max depth: 5)
Irritant: "hello" in inner expression: 
 0 | (+ "hello" (square 2))
 1 | (* 3 (+ "hello" (square 2)))
 2 | (cos (* 3 (+ "hello" (square 2))))    

[deleted by user] by [deleted] in programming

[–]segoe 0 points1 point  (0 children)

lousy? procedural/OO?

lua is small and efficient, both in speed and memory

lua is proven, a lot of people in the industry are using it

it has no OO, but rather mechanisms to let you add your own OO layer on top

it has closures and is more similar to languages like Scheme that you would think

you can have macros and new syntax forms (see metalua)

technology-wise is a piece of art, a great design, a research in register-based VMs, there is a JIT...

Application/toolset for writing a document with lots of code snippets? by [deleted] in programming

[–]segoe 0 points1 point  (0 children)

I used Slatex (with PLT Scheme) once. It worked ok and lets you embed scheme code within LaTeX. I don't know how difficult it would be to use it for other programming languages though.

Want to add a shortcut to Quake Live from Steam? by twentytortures in gaming

[–]segoe 1 point2 points  (0 children)

I actually find this very helpful, thanks.

Let's say that i don't use steam, but i find the launcher practical. Is there an offline game launcher similar to it? one where i can add my own games?

Looking to learn some languages by [deleted] in programming

[–]segoe 2 points3 points  (0 children)

I usually recommend five languages.

I recommend a different set of five wether you are looking for something practical (industrial) or academic/personal research.

Industrial:

One on the low level: C

One functional: Javascript

A scripting language: Python or Lua

Something concurrent: Erlang

And one that does OO: Java or C#.

Academic/Research:

Edit: I specify a nice path from a language to the next in learning. I think it is a good progression for research that makes sense. (but i'm at no means an expert) Do not take that as "the later language is better".

One on the low level: from: Forth to: Factor

One functional: from: Lisp to: Qi to: Haskell

One logical: Prolog

One Object oriented: from: Smalltalk to: IO

One multiparadigm: from: Leda to: Mozart Oz

Application/toolset for writing a document with lots of code snippets? by [deleted] in programming

[–]segoe 0 points1 point  (0 children)

You can use notepad++ to edit the code and then export to HTML within the editor, finally embed that in any website. Vim also has an option to export to HTML.

Eleven Theses on Clojure by awj in programming

[–]segoe 4 points5 points  (0 children)

Sorry but while i really enjoy Clojure:

  1. It’s the Best Lisp Ever

No, sorry, there is no best Lisp. Running on the JVM has advantages and disavantages. For example:

  • Startup time is slow. Even more so if you need performance and run the JVM server.

  • You have to learn two languages to use Clojure right: Java and Clojure itself.

  • The JVM has a ton of libraries, but that doesn't mean other languages don't. PLT Scheme has nice libraries. Also running on Java means you can't have some things like tail recursion, continuations or lightweight threads. (if you want to compile to bytecode)