Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
tef
May 30, 2004

-> some l-system crap ->

Sartak posted:

It's prolog. :banjo:

:v::hf::smith:

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->
http://alain.colmerauer.free.fr/ArchivesPublications/HistoireProlog/19november92.pdf

it turns out you don't need to re-implement natural numbers or lists, or a stack machine to write hello world in prolog.

hint: hello world in prolog is actually :- writef("%w",["Hello, world!"]). or something.

tef
May 30, 2004

-> some l-system crap ->

Sartak posted:

It's prolog. :banjo:

This would explain the response I got to this childish job advert.

I wrote them an email berating them for using popular languages like erlang and haskell and so sent them a prolog response to elicit the following reply:

quote:

FAIL: We were trying to figure out why this is a fail.
But the fact is simply that we just hate you.

tef
May 30, 2004

-> some l-system crap ->
you have to measure to find the slowdowns before removing them.

the one possible exception is where you write a purposefully and knowingly use piece of slow code, or use a slow library in place of a faster one for ease of development.

but even so, it's too easy to be mistaken about possible improvements, and sometimes for a supposedly better algorithm a big-o notation hides really big constant values, or piss poor cache behaviour.

tef
May 30, 2004

-> some l-system crap ->

dancavallaro posted:

Ummmmm duh didn't you know that a famous computer scientist said gotos are bad? So obviously we should never use them. And also Knuth said we should never do optimizations because they're evil.

http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf

tef
May 30, 2004

-> some l-system crap ->
Badly remembered kernighan quote:

I have found the amount of local variables, and not the function length, to be a good indicator of if a function should be split up.

tef
May 30, 2004

-> some l-system crap ->

Jethro posted:

not the "critique my dba by looking at 10 lines of application code" thread.

that was written by the lead architect*.

many of his contributions have been posted before:

code:
namespace Core.Framework.DataType.BooleanUtils
{
	public static class BooleanFormatter
	{
		/// <summary>
		/// returns string representation of boolean value based on passed definitions of <value>true</value> and <value>false</value>
		/// </summary>
		/// <param name="value"></param>
		/// <param name="trueValue"></param>
		/// <param name="falseValue"></param>
		/// <returns></returns>
		public static string Format(bool value, string trueValue, string falseValue)
		{
			return value ? trueValue : falseValue;
		}
	}
}
* although successive re-orgs may have changed his job title beyond recognition, he is still the primary author of most of the website.


edited to add: :woop: I don't work there :toot:

tef
May 30, 2004

-> some l-system crap ->
It might be some 'fix' for some horrible locking bug :v:

tef
May 30, 2004

-> some l-system crap ->
We already have a php coding horrors thread

tef
May 30, 2004

-> some l-system crap ->
http://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html

hakmen is the real hackers' file.

esr's dictionary is best left to rot somewhere.

tef
May 30, 2004

-> some l-system crap ->

Vexed Morgan posted:

hey, Oderint, dum metuant

I'm not scared of 'bullets slathered in pork fat'.

tef
May 30, 2004

-> some l-system crap ->

pokeyman posted:

I can't figure out a way to make yes take a line feed. Just strips slashes here on OS X.

code:
$ yes '
'

tef
May 30, 2004

-> some l-system crap ->

ton1c posted:

You know it's funny, a good number of people reading this thread and that reddit thread would probably be guilty of a number of things in this thread.

I'm pretty sure some of the posts have been people outing some of the horrible code they've written. It's rather cathartic.

quote:

Programming should be more like music, where you compete against yourself rather than bash those who suck, but then nothing would get done.

Hackers and Composers eh? I'm not sure you can attribute the desire to code to a competitive element alone, nor any progress to such a poor motive.

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

I once wrote one 4 screens wide:

As someone else who was paid to write a series of regular expressions to translate html into well formed xml I would like to say :smithicide:

tef
May 30, 2004

-> some l-system crap ->
For example, Cantor did 9/11

tef
May 30, 2004

-> some l-system crap ->

poopgiggle posted:

No I'm pretty sure that it's because the kind of people who seek out languages like Haskell and Erlang are the kind of people who tend to design their code well in the first place.

correlation is causation. thanks for that insight.

tef
May 30, 2004

-> some l-system crap ->

quote:

If you're offended because you don't know Haskell or something,

I am offended by haskell. Turns out that disliking functional programming is obviously my dirty secret. Maybe I should stick to PHP.

quote:

I should clarify that functional-seeking-programmers are a proper subset of good programmers.

A good programmer seeks functional languages (in that they attempt to understand various methodologies of programming), but seeking functional languages will not make you a good programmer.

I would posit that the reason we don't see as many bad programmers using functional languages is that they aren't as popular.

tef
May 30, 2004

-> some l-system crap ->

poopgiggle posted:

But really I think everyone should get a copy of The Haskell School of Expression and work through the excercises. Learning functional programming methodology is valuable even if you never use Haskell again, and drawing snowflake fractals is more fun than "hay guys check out this two-line lazy Quicksort."

On the other hand if you're looking for a short and useful introduction to the language, I would recommend Programming Haskell.

I found it focused on the concepts of the language rather than trying to get you to draw pictures and sounds.

tef
May 30, 2004

-> some l-system crap ->

poopgiggle posted:

Alright next time I'll write 3 paragraphs that explicitly spell out what I mean so that pedants can't pick my wording apart.

Admittedly, my initial response was rather terse too.

tef
May 30, 2004

-> some l-system crap ->

Dijkstracula posted:

Yes, the pattern matching stuff in Erlang is very cool, but every single other person in this thread saw it with Prolog in their third year of uni, so we don't feel the need to extol the virtues of a programming paradigm that isn't news to us.

And it is a lot more neat in prolog than it is in erlang:


append([],X,X). % appending a list to an empty list is the same list.
append([H|T],L,[H|O]) :- append(T,L,O). % appending a list to a list, is appending the head of a list to the output, where the output is the result of appending the tail of the list to the other list.


Then you can use append to get the last element from a list:

:- append(_,[X],[1,2,3,4]).
X = 4?

tef
May 30, 2004

-> some l-system crap ->

RussianManiac posted:

At least hexadecimal used Java :(

I wonder how you know this :v:

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

Isn't numbering boxes on a flowchart a COBOL thing? Because numbers are much more readable than named functions or some such nonsense.

Those are line numbers

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

13627C?

from the above source:

code:
line_13627:
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 1, 1) = " " Then tt = line_len - 1
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 2, 1) = " " Then tt = line_len - 2
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 3, 1) = " " Then tt = line_len - 3
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 4, 1) = " " Then tt = line_len - 4
line_13627a:
    If tt = 0 Then GoTo line_13628
line_13627b:
    If tt > line_len + over_lap Then GoTo line_13628
line_13627c:
    array_aaa(array_pos) = " " + Left(aaa, tt - 1) + " "
    array_ooo(array_pos) = " " + Left(ooo, tt - 1) + " "
    aaa = Mid(aaa, tt)
    ooo = Mid(ooo, tt)
    xxx = Mid(xxx, tt)  'january 21 2001
    GoTo line_13620

tef
May 30, 2004

-> some l-system crap ->

tripwire posted:

Wow, thats insane! It's almost like having an interactive c REPL console for loving around with. I could see that coming in handy for just testing snippets of code without bothering to build and make a big project.

http://neugierig.org/software/c-repl/


* 20 minutes of haranguing haskell, and I now get this*
code:
$ c-repl 
c-repl: a C read-eval-print loop.
enter '.h' at the prompt for help.
int x error: In file included from /usr/include/stdio.h:906,
                 from <stdin>:1:
/usr/include/bits/stdio2.h: In function 'int sprintf(char*, const char*, ...)':
/usr/include/bits/stdio2.h:35: error: '__builtin_va_arg_pack' was not declared in this scope
....
Also, there is an older version of c-repl using ruby hiding in debian.

tef fucked around with this message at 13:16 on Jan 14, 2010

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

Looks clear enough to me.

:psyboom:

On the plus side, zhentar won't have to take zombywuf seriously any more.

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

Erlang only got SMP support in 2006 (R12B, if memory serves me right). The way it was done was by having a scheduler represented as an OS thread

Aside: couldn't you just run one erlang vm per core before this to get smp like behaviour?

tef
May 30, 2004

-> some l-system crap ->

Bozart posted:

Probably already been seen, but at work I ran into:

true = 1; false = 2;

In visual basic, true = -1 and false = 0 :3:

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:


If you think that's bad I had to work with a guy who would dismiss other peoples problems at face value because of their simplified explanation, only then to whine about his problems in a similar manner.

tef
May 30, 2004

-> some l-system crap ->
Have you seen what happens when they try to program :3:

tef
May 30, 2004

-> some l-system crap ->

Otto Skorzeny posted:

For C or Obj-C, clang. For C++, nothing yet.

clang is worth keeping an eye on for c++ support

tef
May 30, 2004

-> some l-system crap ->

rt4 posted:

I'm probably going to get poo poo on for asking this, but...
:psyduck:
...under what circumstances would anyone want to restart a server during daily operation?

it's easier to crash on an error and restart than recover in some cases.

for example:
http://en.wikipedia.org/wiki/Crash-only_software

tef
May 30, 2004

-> some l-system crap ->

Flobbster posted:

I just wrote the programming equivalent of the "Buffalo buffalo buffalo" sentence:

code:
        Application application = (Application) Application.application();
The cast is necessary because the static method actually returns a reference to Application's base class (WOApplication), not our concrete subclass!

This is wonderful.

tef
May 30, 2004

-> some l-system crap ->

rt4 posted:

Nicer than what? Not trying to be snarky; I just don't get it.

http://en.wikipedia.org/wiki/Stockholm_syndrome

tef
May 30, 2004

-> some l-system crap ->

HFX posted:

This is great until you are working with several companies where you don't have source code to the upper class and you realize you need to override just one behavior. Implicit virtual is also simpler.

If by simpler, you mean 'Easier to write fragile code that breaks', sure.

tef
May 30, 2004

-> some l-system crap ->
The fake one is gpc_magic_quotes

tef
May 30, 2004

-> some l-system crap ->
http://blog.devinterface.com/2010/06/design-patterns-in-ruby-abstract-factory/

tef
May 30, 2004

-> some l-system crap ->
they're called race conditons because they make the code go faster :eng99:

tef
May 30, 2004

-> some l-system crap ->

TRex EaterofCars posted:

We used to have this nonsense along with making sure we named each class with a public static String MODULE.

A good bit of civil disobedience, mixed with claiming control of the SVN repo and strategic layoffs got rid of that horse poo poo real fast.

We used to have to update version numbers in multiple files in every svn commit. It was the source of frequent conflicts.

tef
May 30, 2004

-> some l-system crap ->
svn:keywords revision

http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

Plorkyeran posted:

And you did it more than once before writing a commit hook to do it automatically?

I wasn't 'allowed' to change it for four months or so.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply