Pages: [1] 2 3 ... 5   Go Down
Author Topic: Every so often I am stunned by a post.  (Read 4328 times)
0 Members and 1 Guest are viewing this topic.
Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sometimes, it's brilliant like Morris Dovey's unsigned division routine.

But more often it's something that should should earn automatic, possibly life-time Tea Party membership and I can't think of anything like an appropriate, helpful, reply. I could say more but just thinking about it... no, uh-uh, it's just too much and not in a good way at all.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5597
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sometimes, it's brilliant like Morris Dovey's unsigned division routine.

How about a link to this...?

But more often it's something that should should earn automatic, possibly life-time Tea Party membership and I can't think of anything like an appropriate, helpful, reply. I could say more but just thinking about it... no, uh-uh, it's just too much and not in a good way at all.

...and one here, too - we could all use a good laugh (or cry), I suppose...? smiley-grin
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dunno where Morris' thread is now and I don't want to put names on the others. How many people do you see who can send and receive C string arrays who can't figure out WTH a char array actually is?  Of course that's the time they get taught to use C++ String objects by educated folk and once again I am even more amazed.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1617
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I hope my Posts aren't making you swing  smiley-mr-green
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

field road, jupiter creek
Offline Offline
Sr. Member
****
Karma: 6
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hate to break it to you man, but...

It's the effing syntax!

Arduino is my first "C" like language, I normally use assembler, Forth, Python, Pascal or Pascal like languages.

You know, languages that are readable!

I run Debian, not Ubuntu, since Woody or Potato, can't remember which came first, I was amazed at how many languages came with the 3 and then the 7 CD install.
Stuff I had only read about, like Chill, Ada, Oberon, Modula.

How many of my posts here have started with,
"Can I do this in Arduino or do I have to go to assembler"?

One of the problems is the basic information is pretty damn basic.
Since I bought "Programming Interactivity", "Making Things Talk", "Building Wireless Sensor Networks" things have gotten a bit less confusing.

So go on, be smug, but it just makes you look like an ass.

 smiley-cool
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like the recent "minecraft server on an arduino" question. Seems like an awesome challenge! smiley
Logged


Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26509
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It's the effing syntax!
C is a block-structured imperative language - after Pascal, what's so hard to learn?
They are both, after all, descendents of Algol (now there I had syntax problems!)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1926
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You know, languages that are readable!
It is not because you can write unreadable code in C(++) you should.
I know C has advertised itself as  "very short and powerful" (expressed by only using 1 letter to define the language) I consider that as one of the few mistakes W. Kernighan and Dennis M. Ritchie made . Not because they went to far but followers would write code like the one below and think it is great.
Code:
while( *outstr++ = *instr++);

Basically there is no reason to ever write unreadable code. It is generally accepted now that code is read multiple times more than it is written (some say 10 times; some say far more).
Therefore my advice is to do an effort in selecting good names and structuring the code. Consider your code as a book that others can read. Don't think you will remember your intentions 2 moths from now. Take away 2 years from now.

On the original topic
The posts that stunned me most are the ones where I think "Have you looked, I just read 5 posts about this?" or "You don't want to share your problem but you want us to fix it?"
But isn't that part of the fun in life? smiley-cool

best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

CO, USA
Offline Offline
God Member
*****
Karma: 5
Posts: 711
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But more often it's something that should should earn automatic, possibly life-time Tea Party membership

Of course, there's also the part about insulting people by using their political affiliation as a deprecating term.

Code:
while( *outstr++ = *instr++);

Perfectly understandable to someone who's written assembly language. Looks just like
Code:
mov (R3)+ (R4)+
bne LABEL
Well, that's if I remember Macro-11 much. Sure, it's debatable when code becomes too obfuscated, but using pointers to copy a z-byte string is pretty tame.

Sometimes, it's brilliant like Morris Dovey's unsigned division routine.

How about a link to this...?

This http://arduino.cc/forum/index.php/topic,92738.0.html ?
Logged

... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

IRL
Offline Offline
Full Member
***
Karma: 0
Posts: 146
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It's the effing syntax!
C is a block-structured imperative language - after Pascal, what's so hard to learn?
They are both, after all, descendents of Algol (now there I had syntax problems!)

The original creators of C spent about ten years, hampered by small memories and slow CPUs.
In order to compile they had to shuffle a number of tapes!

Must have been a lot of effort.

Assembly is good in some matter it does not put restriction on the programmers creativity, and it does not impose structure where not much creativity exists originally.

Interestingly, using assembler myself for some years, I more and more tended to use techniques also found in C programs/executeable files (for instance I like relocation tables a lot).

So why emulate a compiler manually?

You can really use C similar to assembler but it's different, compared to learn programming by means of C language. It is clearly better in terms of maintainability and readability, some larger assembler sources that I wrote myself are a nightmare to me now after a number of years.

One professional programmer in a course session talked about introduction of IPV6, and he said the reason to introduce the extra address space mainly would be for the reason that it could become wasted  smiley-sweat

It is true having an operating system based on assembler it would be so much faster and efficient but than there is a wrong bit, wrong place, and the screen goes blank. And also compiled code is less a target for hacking because there is so much overhead.

It is even possible to code assembler on Windows, I tried a little, but then again looked my code, and disposed it off quietly. The disassembly even has become removed from Visual Studio, it was highly useful for me when I learned C++ but that's that, the IDE/debugger also has improved a lot.

There are some older assembler sources around on the net including the Busicom one (Intel 4004), you could take a look at it, and think for yourself what you have and what it is.

One still older source I saw is in a manual for a storage drum, some 16K words capacity, from the 1960s, I calculated it is 52 years old now.

Looking at this source, I am also stunned about computer languages evolution.
« Last Edit: March 12, 2012, 09:30:00 pm by takao21106 » Logged

I also have PIC related web domain.

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 74
Posts: 2224
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
while( *outstr++ = *instr++);

This only requires knowledge of operator precedence, quite simple.

Code:
i+++j;

Try this one.

These boards are the place for silly mistakes and learning, and its a lot easier to post a stupid question here and have it answered quickly than spend hours scouring for a dead end, that being said, it also sucks having to explain that the IDE uses C++ once a day or more.
« Last Edit: March 12, 2012, 09:01:20 pm by pYro_65 » Logged


IRL
Offline Offline
Full Member
***
Karma: 0
Posts: 146
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
babble is a translator from a pseudo-assembly language into a
      subset of C suitable for execution on Charles Babbage's
      Analytical Engine.  Or rather, the #defines in babble are that
      translator.  The rest of babble is a babble program.

http://www.cise.ufl.edu/~manuel/obfuscate/babble.hint
Logged

I also have PIC related web domain.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
while( *outstr++ = *instr++);

I'm sorry but if this is an example of hard to read let alone unreadable then you've got a lot of learning to go yet.
Of course if you have the library included then memset() might look easier to read but not actually be better.

You don't have to be fantastic at C to code in C but when you come to an expression that confuses you, treat is as an opportunity to learn. Worst case, it's buggy in fewer lines than usual.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
while( *outstr++ = *instr++);

I'm sorry but if this is an example of hard to read let alone unreadable then you've got a lot of learning to go yet.
Of course if you have the library included then memset() might look easier to read but not actually be better.

You don't have to be fantastic at C to code in C but when you come to an expression that confuses you, treat is as an opportunity to learn. Worst case, it's buggy in fewer lines than usual.

I can sure relate to that. I have several time become very stuck trying to make a series of statement do what I want and not be able to tell why it's not working the way I expect. At those time I sometime just backup and rewrite it in lots of very primitive C statements, trying to emulate how I think it should work. That usually sets me straight to whether I just don't understand the more complex statements or the flaw is in my thinking on how the problem needs to be solved. That probably doesn't make a lot of sense, but I've found it useful none the less.  smiley-wink

With C it seems I can move upward towards more complexity or move downward to more primitive methods, whatever seems to suit the problem and state of mind of this poor programmer. Of course my favorite programming language is solder.

Lefty
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But more often it's something that should should earn automatic, possibly life-time Tea Party membership

Of course, there's also the part about insulting people by using their political affiliation as a deprecating term.

You're not born with a political affiliation. It's your choice.

I've seen the Tea Party leaders speak including interviews and read what they have said. Only idiots would take any of that pack seriously. The same idiots who take opinion over science as a matter of common sense.

If they weren't idiots then there would be different candidates and the GOP wouldn't be so worried.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Pages: [1] 2 3 ... 5   Go Up
Jump to: