My silliest extention made yet 2008...

M

Michael Starberg

Readable is a relative thing, Jon. I'm not exactly a newbie at this.With
20+
years of experience in the programming world,

Well Matt, you are a c-coder. Readability is not even concept in the
c-world.

It is not relative, it is non-existant. Have you noticed how c-coders frowns
upon wowels?

int cnt = GetCount();
string cstmr = GetCustomer();


i is index, if not used to do pass a 2d-matrix, then i and j and why not k
can be used. or x and y. It seems like c-coders make a thing of being terse.
job-security above all! =)

C is a write-only language. Whenever you have to maintain old c-code, you
just scrap the file the and just re-type the darn thing. Only machosists
read c-code just to punish themselves.

Hehe. I just remember a great quote. - Pearl is a language that looks the
same, before and after encryption.
Hey, I did say it was a rant.

As for your 20+ experience, I promise to read all your rants, as you seem
like a smart and nice dude.

And this is a rant-thread. I get to say so as I started it. Please
continue....

May Your Kung-Fu Be Strong And Dandy
- Michael Starberg
 
J

Jon Skeet [C# MVP]

Michael Starberg said:
Why write one? You just forgot two methods:
foo.Where().OrderBy().Select().ToList().ForEach()

No, I definitely didn't forget. By writing your own one, you can cope
with millions and millions of elements, still streaming. ToList will
buffer the entire sequence into memory.

This I just don't understand. What are you saying?

Consider two alternatives. One uses snippets to generate verbose code
with few keystrokes. The second requires less code in the first place,
but still more keystrokes.

I would generally favour the second - because code spends longer being
maintained than initially typed. I type quickly, and typing isn't the
bottleneck in coding for me. However, being able to very quickly read
code (which includes having a fair amount of behaviour on the screen at
a time, still with reasonable whitespace) is a real benefit.

Ah, I had almost forgot about that library. Glad to see it is not under GPL.
However the licence is rather strict. If I include one of your classes in
commercial code, would adding a comment // 'Written by Jon Skeet' be
sufficient?

Yup, that's absolutely fine.
Why not just license it as public domain?

I can't remember all the details, but by putting a very few
restrictions on the code, it will ensure a greater degree of freedom -
no-one can take the same code and copyright it as their own, etc.
Your MiscUtil would be much cooler if the licence.txt just contained one
silverbullet;

1. These files was written by Jon Skeet and are copylefted as public domain.
Use as see fit!

Then just add a comment-header in all files sporting the above licence. I
think people would be proud to carry/using your code, who would remove the
comment?

On the other hand, even if I did use your code in anyway I see fit, you are
not the kinda guy that would sue. WWJD?

Yeah, I'm not exactly litigious ;)
Only if you give me a free of use licence. The company I work for takes
pride in not making an about page about ourselves and how cool we are. And
we will never advert third-party component developers.

So I ask again, would adding the comment 'Written by Jon Skeet' in the
.cs-file suffice?
Absolutely.


I showed a basic iterator to a java-dev. Two days later he asked our BIG -
Boss In General, if she could be assigned to a C# project when her work was
done in the current project. Last week I showed her anonymous types and some
linq on that.

As usual, I like when I type the var keyword they *sigh* and think I showe
them a OleVariant. Then I get to see the jaw drop when I do
Console.WriteLine(x.GetType().Name). My standard example contains no
qualified reference types at all. All variables are done using the var
keyword. With Visual Studio's excellent intellisence they really get it. And
wants it...

.. but then she had to go back to eclipse and do Java. Poor girl. My bad. I
should not have teased her like that. =)

Java is certainly a way behind in language support. Still, Eclipse's
editor rocks :)
But I guess some angel is watching over her, as one dude allocated for the
feb->nov job must do other things, and I get to pick the replacement. While
she is not a skilled see-sharper, I picked her, as the genuine interest is
much more of value than experience. And what experience? C#3 is new to all
of us. Also, the transition from java to see-sharp is often smooth.

Absolutely. Especially with the right book ;)
 
M

Matt

Well Matt, you are a c-coder. Readability is not even concept in the
c-world.

ROFL. Yeah, ok. I take it you never wrote in 'C'.
It is not relative, it is non-existant. Have you noticed how c-coders frowns
upon wowels?

Um, no, I hadn't noticed that.
int cnt = GetCount();
string cstmr = GetCustomer();

i is index, if not used to do pass a 2d-matrix, then i and j and why not k
can be used. or x and y. It seems like c-coders make a thing of being terse.
job-security above all! =)

The sad thing is, you are right on this one. It was supposed to be
funny and it
isn't. However, when the new C+-= comes out, it will fix everything!
C is a write-only language. Whenever you have to maintain old c-code, you
just scrap the file the and just re-type the darn thing. Only machosists
read c-code just to punish themselves.

Hehe. I just remember a great quote. - Pearl is a language that looks the
same, before and after encryption.

I think you mean Perl, but I tend to agree. PHP and such are just as
bad.
As for your 20+ experience, I promise to read all your rants, as you seem
like a smart and nice dude.

And this is a rant-thread. I get to say so as I started it. Please
continue....

Hm. What to rant about? Companies that don't communicate? Requirements
that start with "It would be nice if...", people that think code is a
good form of documentation? Hmmmm.

Matt
 
M

Matt

None of that says anything about the experience of the people whose
code you're maintaining. And to be honest, without wishing to actually
suggest your own code is poor, it doesn't really say a lot about the
standard of your own code. I gave up on the assumption that years of
experience correlate to cleanliness of code quite a while ago.

While I agree that years of experience have NOTHING to do with quality
of
code (one year done twenty times does not twenty years of experience
make),
I think you missed the overall point. I've maintained code from
"experts", from
"newbies", from "journeymen" and from people that thought that unit
tests were
all that was necessary to explain their code.
Well, that's what documentation is for I guess. Clearly you can't tell
the computer itself what you want to do in a better way than you can
tell it what to actually do, otherwise we'd use that syntax etc to tell
it what to do in the first place.

That's a separate rant, and comes under the "one off" problem. We are
one
level removed in writing documentation, and probably two levels
removed in
writing requirements. The real issue isn't the code, necessarily, it
is the complete
lack of supporting artifacts that are kept up to date. Note the second
part of that
statement, because that's a real problem. I might write the world's
greatest
documentation for my code, explaining exactly what I meant to do, what
algorithms
I used/stole, and how they all worked. However, time crunches being
what they
are, the next guy to come along might modify that code significantly,
without ever
changing the docs.
However, documentation and unit tests which prove what our code
actually does and simultaneously indicate some aspect of what it's
meant to do combine to give a pretty strong sense of the desired
effect, IME.

Unit tests do prove that the code does what you think it does. It does
not, however, show what the code was meant to do. If I assume that 1 +
1 = 3 and my code proves it, the unit test will pass. That doesn't
mean the code is right...

Matt
 
M

Michael Starberg

While I agree that years of experience have NOTHING to do with quality
of
code

20 years of usenet experience would tell you not to use enter when typing.
=)
But I agree on what you say, even if it was hard to read.
That's a separate rant, and comes under the "one off" problem.

I am still with you.
Agree 100%.

Hehe, I remember when I described the fence-problem to my mom. She is not
very bright, but has love and care as a special attribute. But brains, nope.
She had a hard time understanding that you need 11 poles to build a 10 meter
fence, with one pole at each meter.

Teaching my mom to code, would be a nightmare. I think I stopped trying when
I was 13 years old =)

We talked about this this christmas, when she got golden, that is celebrated
her 60 year birthday; that she did liked having a smart son, but did not
like to be outsmarted by an 11-year boy. - If I was not against childabuse,
I could have smacked you right in the face!

mommo is p0wned! =)

Unit tests do prove that the code does what you think it does. It does
not, however, show what the code was meant to do. If I assume that 1 +
1 = 3 and my code proves it, the unit test will pass. That doesn't
mean the code is right...

Hehe. What people found out when doing test driven application development,
is that the tests are 3 times larger than the actual code being tested, and
that the bugs (thereby) are often in the tests.

My test-driven application method is simply called eye-balling-n'-mouthing.
Take a good coder and friend, have a sitdown and read the code out loud and
debate if the code is dandy. Works every time. No bugs at all in 2007. We
shall se if I go clean in 2008.

- Micke
 
M

Michael Starberg

ROFL. Yeah, ok. I take it you never wrote in 'C'.

I went from Commodore-64 'assembler' to C.
Still got the white bible. Hehe. When I was 17 years old, I was thinking on
coding a compiler in C. But I soon realized how much work that implied and
how dumb I am.

There is no way that I would be capable of coding a compiler. This is not me
being humble. It is pure fact. And I can live with that. =)


Um, no, I hadn't noticed that.

Then you must be one of the few c-coders I like =)


The sad thing is, you are right on this one. It was supposed to be
funny and it
isn't. However, when the new C+-= comes out, it will fix everything!

LOL! The subject oriented language.
Me and friends have made some off-topic expansions to that language.
You can see that C+- even supports linq.

http://ynhub.org/forum/showthread.php?t=1791

I think you mean Perl, but I tend to agree. PHP and such are just as bad.

I did. and agreed.

Hm. What to rant about? Companies that don't communicate? Requirements
that start with "It would be nice if...", people that think code is a
good form of documentation? Hmmmm.

Matt

Do rant about anything above. But don't force it out.
Again, I really like your posts...

- Michael Starberg
 
M

Michael Starberg

Michael Starberg said:
news:eabc413e-a4ea-4bf4-822b-9389dcafd97b@m34g2000hsf.googlegroups.com...

C+- 2.0 in action.

// Licence: This source is Copylefted, Also known as Public Domain in the
good old days.
// You may use the below source in any way possible; without no freakin'
GPL.
// Nev


subject a; //a declared
strong subject b = 5; //b declared and probably won't contain any near value
of 5.
weak subject c = 6 orelse; // c declared and probably will contain the value
of 6.

//we start slow. let's compare b and c.
if (b >> c)
{
//b is much better than c.

//let's do some more assignments
Boolean d = new Boolean(whatif(b == a)); //who knows?

//and some error handling
please
{
//let's check and change the state of d.
if (d == DUBIOUS)
{
d = TRUE; //will most likely to yield an runtime error as the orelse
keyword is missing.
}
}
whythehellnot
{
//runtime error caught here, must check VB-lameness
Dim v As Variant
Set v = oldmama(d)
If Not ( Not (((v = Nothing) Or (v = Null) Or (v = Empty) Or (v =
Error))) Then
Else
d = True;
Else If
}
}
else
{
//b had no chance.
return orelse; // the orelse directive on return is not mandatory, but you
never know!
}

//Anyways we still got to assign a.
a = b + c;

//a should be assigned but is still very volatile. Let's make sure.
Dino dino = new Dino(a);
if (evenifnot(a == b + c))
{
dino.torch();
}

// a is assigned and by dragonfear alone, a probably helped in scaring b and
c also.
// a should contain the value of 11.


There is more to know.

Less realistic languages like Java and C# builds into jar-files or
..dll-assemblies.

C+- does not compile nor link. The C+- runtime have gatherings.

Gatherings are a set of meetings. Each meeting can take place at anytime
while coding. This is why we recommend you to save only when you have clean
code, to avoid weird class-mutations, that subjects would laugh at during a
gathering.

It is in gatherings the power of subject oriented programming comes into
play. During a gathering, each subject will enumerate every other subject,
forget half of them, and discard but a few that they will call friends. The
rest is ignored.

Friends will participate in meetings and will mostly be associated with the
default value of non-humpable, until proven otherwise; which happens way too
often. This will be fixed in the paradise-edition. Some subjects will still
be friends even after a hammering of whynot-, evenifnot- and
foreachtry-attempt.

It is common for subjects to implement the standard interface IAdversary.
Having this feature as an interface is highly valuable, as to ensure that
no-one really knows what the methods .Slap(Subject s) and .Kill(Subject s)
really do.

Also consider LINQ - Linear Intrusive Non Quearable

In c+- you can do this:

var q =
kinda from x in gathering
where x is like nice
ordersomewhatby greatness
poke x
select stuff from x

The result is hidden by subject extentions, also called hardons, but always
implements an IGroup<T> and will contain subjects who likes to be selected
and those lame subjects that respects the authorata of being poked.

Also, the var keyword let's the JITCer invent imaginary subjects. Hence, by
inference, the compiler can tell if a subject is lonely and via projection
create a virtual friend that may be type-safe and may implement IHumpable.
 
B

Bill Woodruff

"Gatherings are a set of meetings. Each meeting can take place at anytime
while coding. This is why we recommend you to save only when you have clean
code, to avoid weird class-mutations, that subjects would laugh at during a
gathering.

It is in gatherings the power of subject oriented programming comes into
play. During a gathering, each subject will enumerate every other subject,
forget half of them, and discard but a few that they will call friends. The
rest is ignored.

Friends will participate in meetings and will mostly be associated with the
default value of non-humpable, until proven otherwise; which happens way too
often. This will be fixed in the paradise-edition. Some subjects will still
be friends even after a hammering of whynot-, evenifnot- and
foreachtry-attempt."

Very interesting poetry !

best, Bill Woodruff
 
M

Matt

C+- 2.0 in action.

If someone invents this language, and it turns out to look like your
code, I shall hunt you down and make you program in FORTH for the rest
of your life.

Matt
 
M

Michael Starberg

If someone invents this language, and it turns out to look like your
code, I shall hunt you down and make you program in FORTH for the rest
of your life.

So even if someone else does the implementation, I get to die in horrible
pain?
(also known as FORTH)

Well, guess that is a fair cup.

But agree that it is funny
- Michael Starberg
 
C

christery

that start with "It would be nice if...", people that think code is a
good form of documentation? Hmmmm.

Matt

If it was hard to write, It should be hard to understand!

//CY
 
C

christery

So even if someone else does the implementation, I get to die in horrible
pain?
(also known as  FORTH)

Well, guess that is a fair cup.

But agree that it is funny
- Michael Starberg

so "2 2 + ." gets 4 as a result? simple and logical...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top