The Sexiest Code You've Seen?

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 2630 Views - Last Post: 02 August 2007 - 08:16 AM

#16 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 64
  • View blog
  • Posts: 3,505
  • Joined: 31-March 03

Re: The Sexiest Code You've Seen?

Posted 18 July 2007 - 09:27 PM

Question.

If the code one writes is sexy, would it be considered similar to masturbation? Or for that matter, prostitution for those of us who write code for gil?
Was This Post Helpful? 0
  • +
  • -

#17 Hoeyhimself  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-July 07

Re: The Sexiest Code You've Seen?

Posted 19 July 2007 - 07:31 PM

If that is the case, all I have to show for is a wetdream after a nightmare.
Was This Post Helpful? 0
  • +
  • -

#18 chris_drappier  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 10-April 07

Re: The Sexiest Code You've Seen?

Posted 20 July 2007 - 02:33 PM

def it
puts 'the lotion in the basket'
end


Was This Post Helpful? 0
  • +
  • -

#19 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2209
  • View blog
  • Posts: 9,183
  • Joined: 18-February 07

Re: The Sexiest Code You've Seen?

Posted 21 July 2007 - 08:33 PM

For me it was mathematica that first blew me away. Nothing really special about the code, but that I had never really understood the power and beauty of functional programming. There was a particular function from number theory that I had written in VB. The function was very long, and fairly complicated. I was on Sloan's when I found a mathematica function to generate the same sequence. It was one elegant line of code like nothing I had ever written in a procedural language.

Then there is always sweetwater LISP
Posted Image
Was This Post Helpful? 0
  • +
  • -

#20 dogboi  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 10-July 07

Re: The Sexiest Code You've Seen?

Posted 21 July 2007 - 09:50 PM

View Postchris_drappier, on 20 Jul, 2007 - 05:33 PM, said:

def it
puts 'the lotion in the basket'
end



| Else_It_Gets_The_Hose_Again();



Was This Post Helpful? 0
  • +
  • -

#21 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Re: The Sexiest Code You've Seen?

Posted 21 July 2007 - 10:03 PM

any code is sexy to me but I really love code with huge bool's
Was This Post Helpful? 0
  • +
  • -

#22 muso  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 51
  • Joined: 06-July 07

Re: The Sexiest Code You've Seen?

Posted 27 July 2007 - 12:57 AM

I can't find the example I'm thinking of, but I love the idea of Quines (http://en.wikipedia.org/wiki/Quine_%28computing%29#History). They are so utterly pointless, yet also the coolest idea in my opinion (what can I say? I love pointless gadgets too ;-).

The example I was thinking of - can't remember which language it was it - created a triangle of code.

I haven't tried writing one yet, but now that I've reminded myself...

As for the sexiest code, we've probably all witnessed it... it's that euphoric feeling you get (often referred to as a "moment of victory"), on your own in a dimly-lit room, usually in the early hours of the morning, when you've just got that routine working perfectly (what? did you think I was going to say anything else!!) and you just sit admiring it for ages... (can't be just me, can it?). The code I've got most satisfaction from is usually from working out some kind of physics simulation or AI routine...

This post has been edited by muso: 27 July 2007 - 01:10 AM

Was This Post Helpful? 0
  • +
  • -

#23 k.sangeeth  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 62
  • Joined: 27-July 07

Re: The Sexiest Code You've Seen?

Posted 01 August 2007 - 03:11 AM

I consider a code to be sexy if it is bug free and has required comments to let others understand the code
Was This Post Helpful? 0
  • +
  • -

#24 no2pencil  Icon User is offline

  • Original Digital Gansta
  • member icon

Reputation: 4464
  • View blog
  • Posts: 24,910
  • Joined: 10-May 07

Re: The Sexiest Code You've Seen?

Posted 01 August 2007 - 06:31 AM

A friend & myself used to write mIRC scripts that would leech fservers. The script would basically crawl the fserver & create a list of every directory & file. Then it would issue get commands, grabbing everything. It would also use a renaming scheme to grab fserv slots for movies, so we would grab someone else's download. We'd come home from work & everything from the night before would be in the download directory, rather than waiting days for the download to even start. I kid you not, mIRC is the only thing that kept me dual booting for the last 2 years of my Windows usage. After I grew out of miRC, I made the switch to Linux as a full time OS.
Was This Post Helpful? 0
  • +
  • -

#25 ajwsurfer  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 373
  • Joined: 24-October 06

Re: The Sexiest Code You've Seen?

Posted 02 August 2007 - 08:16 AM

Here you go:
<!--- 
' Purpose: Side menu for Staff pages
' Variables:
'  MenuChoice - the choice to highlight on the side menu, or 'none' if no side menu at all
'  ProjectID - the Project ID
' --->

<cfparam name="url.pid" default=0>
<cfset menuItem = structNew()> <!--- menu item structure --->

<cfset success = StructInsert(menuItem, "staff",						  
  "<li><a href=""staff.cfm"">Staff</a></li>")>					  <!--- staff page --->
<cfset success = StructInsert(menuItem, "staffSel",						  
  "<li><a class=""selected"" href=""staff.cfm"">Staff</a></li>")>  
  
<cfset success = StructInsert(menuItem, "tables",						  
  "<li><a href=""staff_tables.cfm"">Tables</a></li>")> 
<cfset success = StructInsert(menuItem, "tablesSel",						  
  "<li><a class=""selected"" href=""staff_tables.cfm"">Tables</a></li>")> 
  
<cfset success = StructInsert(menuItem, "phase1Tasks",				
  "<li><a href=""staff_phase1.cfm"">Phase 1 Tasks</a></li>")>   
<cfset success = StructInsert(menuItem, "phase1TasksSel",					  
  "<li><a class=""selected"" href=""staff_phase1.cfm"">Phase 1 Tasks</a></li>")>   
  
<cfset success = StructInsert(menuItem, "phase2Tasks",						  
  "<li><a href=""staff_phase2.cfm"">Phase 2 Tasks</a></li>")>   
<cfset success = StructInsert(menuItem, "phase2TasksSel",						  
  "<li><a class=""selected"" href=""staff_phase2.cfm"">Phase 2 Tasks</a></li>")>   
  
<cfset success = StructInsert(menuItem, "bugReports",						  
  "<li><a href=""staff_ticket.cfm"">Bug Reports</a></li>")>   
<cfset success = StructInsert(menuItem, "bugReportsSel",						  
  "<li><a class=""selected"" href=""staff_ticket.cfm"">Bug Reports</a></li>")>	 

  <!--- second level items  - phase 1 --->
<cfset success = StructInsert(menuItem, "qaChecks",						  
  "<li><a href=""staff_p1checks.cfm?pid=#url.pid#"">QA Checks</a></li>")>	 
<cfset success = StructInsert(menuItem, "qaChecksSel",						  
  "<li><a class=""selected"" href=""staff_p1checks.cfm?pid=#url.pid#"">QA Checks</a></li>")>   
  
<cfset success = StructInsert(menuItem, "getThemes",						  
  "<li><a href=""staff_p1themes.cfm?pid=#url.pid#"">Get Themes</a></li>")>	   
<cfset success = StructInsert(menuItem, "getThemesSel",						  
  "<li><a class=""selected"" href=""staff_p1themes.cfm?pid=#url.pid#"">Get Themes</a></li>")>   

<cfset success = StructInsert(menuItem, "uploadFinal",						  
  "<li><a href=""staff_p1final.cfm?pid=#url.pid#"">Upload Final</a></li>")> 
<cfset success = StructInsert(menuItem, "uploadFinalSel",						  
  "<li><a class=""selected"" href=""staff_p1final.cfm?pid=#url.pid#"">Upload Final</a></li>")> 
  <!--- second level items  - phase 2 --->  
<cfset success = StructInsert(menuItem, "qaChecks2",						  
  "<li><a href=""staff_p2checks.cfm?pid=#url.pid#"">QA Checks</a></li>")>   
<cfset success = StructInsert(menuItem, "qaChecks2Sel",						  
  "<li><a class=""selected"" href=""staff_p2checks.cfm?pid=#url.pid#"">QA Checks</a></li>")> 
  
<cfset success = StructInsert(menuItem, "uploadBreaks2",						  
  "<li><a href=""staff_p2breaks.cfm?pid=#url.pid#"">Upload Breaks</a></li>")>   
<cfset success = StructInsert(menuItem, "uploadBreaks2Sel",						  
  "<li><a class=""selected"" href=""staff_p2breaks.cfm?pid=#url.pid#"">Upload Breaks</a></li>")>   
  
<cfoutput>
<ul>
<cfswitch expression="#attributes.MenuChoice#">
	<!--- default case --->
	<cfdefaultcase>
		#menuItem.staffSel#			  <!--- selected --->
		#menuItem.tables#	
		#menuItem.phase1Tasks#
		#menuItem.phase2Tasks#
		#menuItem.bugReports#
	</cfdefaultcase>
	<!--- tables --->
	<cfcase value="1-0">
		#menuItem.staff#
		#menuItem.tablesSel#		  <!--- selected --->		 
		#menuItem.phase1Tasks#
		#menuItem.phase2Tasks#
		#menuItem.bugReports#
	</cfcase>
	<!--- phase 1 --->
	<cfcase value="2-0">		
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1TasksSel#  <!--- selected --->
		#menuItem.phase2Tasks#
		#menuItem.bugReports# 
	</cfcase>
	<cfcase value="2-1">	
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks#
		<ul id="level2">
			#menuItem.qaChecksSel#		 <!--- selected --->
			#menuItem.getThemes#		
			#menuItem.uploadFinal#		
		</ul>		
		#menuItem.phase2Tasks#
		#menuItem.bugReports#	
	</cfcase>
	<cfcase value="2-2">
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks#
		<ul id="level2">
			#menuItem.qaChecks#		
			#menuItem.getThemesSel#		 <!--- selected --->
			#menuItem.uploadFinal#		
		</ul>		
		#menuItem.phase2Tasks#
		#menuItem.bugReports#	
	</cfcase>
	<cfcase value="2-3">
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks#
		<ul id="level2">
			#menuItem.qaChecks#		
			#menuItem.getThemes#		
			#menuItem.uploadFinalSel#		 <!--- selected --->
		</ul>		
		#menuItem.phase2Tasks#
		#menuItem.bugReports#	
	</cfcase>
	<!--- phase 2 --->
	<cfcase value="3-0">	
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks# 
		#menuItem.phase2TasksSel#  <!--- selected --->
		#menuItem.bugReports# 
	</cfcase>
	<cfcase value="3-1">	
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks# 
		#menuItem.phase2Tasks#  
		<ul id="level2">
			#menuItem.qaChecks2Sel#		 <!--- selected --->
		  #menuItem.uploadBreaks2#		
	 </ul>		
		#menuItem.bugReports# 
	</cfcase>
	<cfcase value="3-2">
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks# 
		#menuItem.phase2Tasks#  
		<ul id="level2">
			#menuItem.qaChecks2#
		  #menuItem.uploadBreaks2Sel#	 <!--- selected --->	 
	 </ul>		
		#menuItem.bugReports# 
	</cfcase>
	<cfcase value="4-0">
		#menuItem.staff#
		#menuItem.tables#	
		#menuItem.phase1Tasks# 
		#menuItem.phase2Tasks# 
		#menuItem.bugReportsSel#	<!--- selected ---> 
	</cfcase>
</cfswitch>
</ul>
</cfoutput>	


Its in ColdFusion and now it is publicly available.
Some of the staff are quite sexy also.

:)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2