Go to Post I love how these contests always seem to find their way to go back to Dave Lavery and (pick one) Krispy Kreme/Heidi/Photoshop - DCA Fan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #46   Spotlight this post!  
Unread 10-03-2004, 15:17
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Why I hate c

Plus, if you go into PC programming, there's a lot of C++ around. Plus, lets face it, pretty much only assembler is harder than C/C++.
  #47   Spotlight this post!  
Unread 10-03-2004, 16:00
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
Re: Why I hate c

Quote:
Originally Posted by Joe Johnson
You could code your robot before you actually had a robot in stead of what we have now which is the mechanical system gets done in 5.9 weeks, the wiring gets done in .09 weeks and the programmers have .01 weeks to make it all behave.

There are a lot of things that are unfair about the FIRST competition, but the stress that we tend to put on the coders is among the unfairest burdens we put on people in this FIRST game.
Thanks for the quote Joe, I'm certainly going to send this to Raul
  #48   Spotlight this post!  
Unread 10-03-2004, 16:08
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Why I hate c

Quote:
Originally Posted by Joe Johnson
the mechanical system gets done in 5.9 weeks, the wiring gets done in .09 weeks and the programmers have .01 weeks to make it all behave.

Wow! So it's not just me ... sounds like it would be cool to learn about, but I'm a little weary about letting some computer output a program for me!

Quote:
Beauty is in the eye of the beholder. So, apparently, is ugly.
Program something in Perl, then come back to me about "ugly"! Seriously, if you do it right, C can be pretty elegant ... and thinking like a compiler is a good way to reduce the bugs in your code, anyway (so it's not necessarily a bad thing). Anyway, make a page long perl regexp and *then* start talking about C (you might change your mind )
  #49   Spotlight this post!  
Unread 17-03-2004, 10:43
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Why I hate c

Quote:
Originally Posted by mtrawls
Wow! So it's not just me ... sounds like it would be cool to learn about, but I'm a little weary about letting some computer output a program for me!



Program something in Perl, then come back to me about "ugly"! Seriously, if you do it right, C can be pretty elegant ... and thinking like a compiler is a good way to reduce the bugs in your code, anyway (so it's not necessarily a bad thing). Anyway, make a page long perl regexp and *then* start talking about C (you might change your mind )
Quite simply, if you're going to program a machine, you should be prepared to program for it, not at it. There will always be a tradeoff between ease-of-use and power, and C does a fairly good job of balancing the two.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #50   Spotlight this post!  
Unread 18-03-2004, 16:29
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: Why I hate c

I had to toss this in. It's my favorite bit of obfuscated C -- a program written to be incomprehensible. (I didn't write it -- I don't know who did.) I guess what's "bad" about C is that it lets you write code like this. But this code is masterfully written by someone who knows the language very well -- maybe a little too well.

This will compile and run on a command line, printing a message. It looks scary, but it's harmless. The output will astound you. Here's a hint: Merry Christmas!

/Norm
Code:
#include <stdio.h>
main(t,_,a)
char
*
a;
{
	return!
0<t?
t<3?
main(-79,-13,a+
main(-87,1-_,
main(-86, 0, a+1 )
+a)):
1,
t<_?
main(t+1, _, a )
:3,
main ( -94, -27+t, a )
&&t == 2 ?_
<13 ?
main ( 2, _+1, "%s %d %d\n" )
:9:16:
t<0?
t<-72?
main( _, t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;\
#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;\
q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; \
r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;\
{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:
t<-50?
_==*a ?
putchar(31[a]):
main(-65,_,a+1)
:
main((*a == '/') + t, _, a + 1 )
:
0<t?
main ( 2, 2 , "%s")
:*a=='/'||
main(0,
main(-61,*a, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry")
,a+1);}
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #51   Spotlight this post!  
Unread 18-03-2004, 16:51
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Why I hate c

Cryptic code can be acceptable if:

1. You are the only person who will ever look at the code, and you are used to seeing this kind of cryptic code.
2. You know the people looking at your code (teammates, coworkers, etc) can understand it.
3. You need process and memory-optimized code, because you are working on a system with a relatively slow processor and relatively small memory (The RC, for example).

Remember, though, you should _ALWAYS_ comment your code, especially if it is cryptic. What if your grandmother (who I'm assuming doesn't know C) wanted to read and understand your code?
  #52   Spotlight this post!  
Unread 18-03-2004, 17:00
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Why I hate c

If you really want to see some obfuscated C code, there's actually a contest for it. http://www.ioccc.org/ - The International Obfuscated C Code Contest.

Winning entries can be found at http://www1.us.ioccc.org/years.html

If you want a language that is very easy to program in and makes sense, check out Ruby at http://www.ruby-lang.org
For example, to run a command 3 times in C, you would do this:

for (int i=3; i<=0; i--) {
command();
}

In Ruby, it would look something like this:

3.times { command }

Ruby is also loosely-typed, meaning you don't have to worry about the size of the variable that's holding your data, the interpreter will determine that for you.

Note that you can't use Ruby on the robot, this is just for hobbyist programmers.
  #53   Spotlight this post!  
Unread 18-03-2004, 18:20
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: Why I hate c

Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.

And now I'm reminded of another language, "whitespace,", wherein all code is composed entirely of three characters: space, newline, and tab.

Here's a example bit of code:

Code:
This is a comment. 
   	

   	    		
 
 	
 	   	 	 
	
     	
	    
    	 		
	  	
	  	   	 	

 
 	    		

   	   	 	
 





   		    	 		  	   		  	  
	   
	

   			 			 			  	  		 	  	 			 	   		  	 	
 
 			 
 
	  			 			 			  	  		 	  	 			 	   		  	 	 	 					 		  	 	 		 			  		  	  
	
     	
	   
 
 			 			 			  	  		 	  	 			 	   		  	 	

   			 			 			  	  		 	  	 			 	   		  	 	 	 					 		  	 	 		 			  		  	  
 

 


	

   			  	  		  	 	 		    	 		  	  
 
  
 	
	 			 
    	 	 
	  	
	  			  	  		  	 	 		    	 		  	   	 					 		  	 	 		 			  		  	  
 

   	
	   
 
 			  	  		  	 	 		    	 		  	  

   			  	  		  	 	 		    	 		  	   	 					 		  	 	 		 			  		  	  
 

   	
	       
		 
	

   		 			  		  	 	 			 			 		 		   		 	  	 		 			  		  	 	
   	 	 
   		 	
	
  	
  
	


End of code example.
Maybe next year FIRST will specify whitespace as the language we use.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #54   Spotlight this post!  
Unread 18-03-2004, 19:45
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Why I hate c

Quote:
Originally Posted by gnormhurst
Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.

And now I'm reminded of another language, "whitespace,", wherein all code is composed entirely of three characters: space, newline, and tab.

Here's a example bit of code:

...

Maybe next year FIRST will specify whitespace as the language we use.
**** the guy who makes that decission.

By the way, what does your program do?
  #55   Spotlight this post!  
Unread 18-03-2004, 23:37
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Why I hate c

Quote:
Originally Posted by gnormhurst
Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.
best bit of IOCCC code ever... only runs on certain machines, though:

Code:
short main[] = {
	277, 04735, -4129, 25, 0, 477, 1019, 0xbef, 0, 12800,
	-113, 21119, 0x52d7, -1006, -7151, 0, 0x4bc, 020004,
	14880, 10541, 2056, 04010, 4548, 3044, -6716, 0x9,
	4407, 6, 5568, 1, -30460, 0, 0x9, 5570, 512, -30419,
	0x7e82, 0760, 6, 0, 4, 02400, 15, 0, 4, 1280, 4, 0,
	4, 0, 0, 0, 0x8, 0, 4, 0, ',', 0, 12, 0, 4, 0, '#',
	0, 020, 0, 4, 0, 30, 0, 026, 0, 0x6176, 120, 25712,
	'p', 072163, 'r', 29303, 29801, 'e'
};
see the hint file here
this is from the first IOCCC competition in 1984
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #56   Spotlight this post!  
Unread 19-03-2004, 08:45
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Why I hate c

Quote:
Originally Posted by gnormhurst
I had to toss this in. It's my favorite bit of obfuscated C -- a program written to be incomprehensible. (I didn't write it -- I don't know who did.) I guess what's "bad" about C is that it lets you write code like this. But this code is masterfully written by someone who knows the language very well -- maybe a little too well.

This will compile and run on a command line, printing a message. It looks scary, but it's harmless. The output will astound you. Here's a hint: Merry Christmas!

/Norm
...
There is absolutly no way that should compile. Wow, that's the crazy. And whoever created that Whitespace language has too much spare time.
__________________

  #57   Spotlight this post!  
Unread 19-03-2004, 18:41
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Why I hate c

Ditto on both of those and Deltacoder's
  #58   Spotlight this post!  
Unread 20-03-2004, 01:43
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Why I hate c

If you really want to see a pointless language, check out Befunge(http://kotisivu.mtv3.fi/quux/befunge.html); they call it a '2 dimensional, lower than assembly' language. Scary thought. Here's a bit of code:

Code:
>1+>:~::"0"-:v>$:v>>21p    :0#v_1-::::6g:" "-!88+*+v
p  +v_:#`0 #<_|_ " |-+77:+1g12_!v!-"!":+0-"0"+gg12\<
6v 3>#$"9"-:v#<|_/ >$11g3+:6g4v->88+*+:"9"`:"0"+85*v
\| p#_!:`"#0_ ^"|" vp3p04+1:g0<^+2g11p+1g12\-*+55p1<
^< ^6+1p11:\_!-6#<^>1+:6g:84*#^-#4 _$$40g:"+"\:"|"v
                         v59:+1p3+1\g6p12:<1:p2p3\<
                         >*\2p:21g1+:11g-#^_$$31p70p11gv
2x                  v06:g22p124 p42 -\p22+1:g04p00::-3-<
3x                  >p80p >22g::3g:" "-!88#v+#*<
4x                  v g42_^#!:-1p22+1pg12\+<>+90p650p11v
5x                  >:23p 3g60g:1+60p21ggv  ^77p08p06:<g
6x                  ^+1g32_v#!:- _v#-" ":<vg12\+*+88!<-2
7x                       # >0`!#v_22g:1+22p  :3g:" "-^++ >v
8x                       !   >$$>#_       >    22g00g1^: 0g
9x                        v_v#`0_v#:-gg12g06 gg05 :    < 51
 vp*469"$"`-1g13:$_v#! -* 48 :g <_v>60g1+60p1+:70g-   #^_^+
v_>$>:#,_@>       #\    $^$ >50g1   +50p50g90g-1-  !#v_^  5
">v>50p:!#^_50g:vv6 8-6g05<       #                  < !p0<
0:2^+1\-1\p1\"0"<>* +22g1-1p!#v_ :50g1-g>   80g:1+80p21g1+pv
"+1^g22:: <  v_ #` #g13g2$#2!#<^   #    ^_v#-" ":g-1g05: +1<
\1g >64*-#^_$| >$   60g21g2+p           v >$$80p22g>1-::60p:21v
 p2 ^p12:+2g12p 08p06:\-<v06gg09 :<$#   >#    #<   ^vg+1g12\gg<
 +>+g"0"-!#v_:22g\- 00g\^>g21gg-:!#^_0`90g\-90p^    >:" "-!#v_v
 ^2g12\" ":<$!_^#!-+88-gg12-1g06 :+"0"<   p080_v#<`0+1:-g08-  <
>:#-1g #2\  #<     >1-:31g-"."\#|_\:< ^++55p081< ^10     :$$<JJ
... Yep, that's code. I swear. Don't ask me how it works, I'm as clueless as you are. Apparently that divides two numbers.

Also, Assembly is by far not the lowest language. Many programmers (decades ago) have programmed by punching holes in punch cards, using direct binary values, and even wiring vaccuum tubes together to perform a specific task.
  #59   Spotlight this post!  
Unread 20-03-2004, 10:02
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Why I hate c

Quote:
Originally Posted by meatmanek
...
Also, Assembly is by far not the lowest language. Many programmers (decades ago) have programmed by punching holes in punch cards, using direct binary values, and even wiring vaccuum tubes together to perform a specific task.
The latter isn't programming. In order to program, it has to be programmable.
  #60   Spotlight this post!  
Unread 20-03-2004, 12:37
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Why I hate c

Quote:
Originally Posted by Astronouth7303
The latter isn't programming. In order to program, it has to be programmable.
I agree to some extent. That really isn't programming any more than revising an electrial circuit is. When you see someone substitute one circuit board for another, you don't think, "Wow, that's great programming."
__________________

Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I Hate It When... sanddrag Chit-Chat 77 25-12-2003 10:57
I hate the BCS and i really ha te KANSAS ST. Jon Reese Chit-Chat 10 11-12-2003 12:09
GRRr.... I hate webpages... XRaVeNX Chit-Chat 4 15-03-2002 12:28
Why I hate Logic EnderofDragon Chit-Chat 2 19-02-2002 21:02


All times are GMT -5. The time now is 11:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi