How many lines of C# code does it take to change a light bulb?
-
Q. How many lines of VB code does it take to change a light bulb? A. Zero. The light bulb control is included with VB. Find the ChangeButton property in the visual designer, and set it to the name of a button on your form. That button will now automatically change the light bulb. (After the recent complaining about VB-bashing, I figured I'd say something semi-nice :) )
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels):thumbsup:
-
A thousand, as you need to create the interfaces so the bulb is not tightly coupled to the socket and the socket not knowing what type of bulb will it receive. And the implement them on the concrete classes Bulb and Socket Also, need to place 100 unit tests for both bulb and socket to manage how will they behave in different scenarios (with electric supply, without it, under water, under sand, etc) Finally, set your continuous integration tool so each time you need to change Bulb, it compiles, run tests and code coverage statistics and finally deploys the new bulb to the socket. Briefly, what comes to my mind :laugh:
"Whether you think you can, or you think you can't--either way, you are right." — Henry Ford "When I waste my time, I only use the best, Code Project...don't leave home without it." — Slacker007
Which is why you inherit from a generic light bulb object and leave that whole mess for someone else to figure out. :rolleyes:
-
Q: How many lines of C# code does it take to change a light bulb? A: One. A properly designed light bulb object would inherit a change method from a generic light bulb class, so just call it and your're done.
A, None - thats a hardware problem
Ger
-
Q: How many lines of C# code does it take to change a light bulb? A: One. A properly designed light bulb object would inherit a change method from a generic light bulb class, so just call it and your're done.
These days, does the 'change' behaviour not have to be injected from somewhere else?
Pete
-
These days, does the 'change' behaviour not have to be injected from somewhere else?
Pete
I would say that you would probebly have to create a robot to do the job. Write the software for the robot. You'll have to keep a check on the stock levels though. You can also design another robot to create the actual light bulb if you'd like. You'd have to keep a check on the stock level of that as well though. So you'll have a production line in the form of: 1) Get resources for bulbs. 2) Transport to robot1 3) Insert material into robot1 4) Manufacture glass with robot1 5) Transport to robot2 6) Insert bulbs into robot2 Software should be written for robot1 and robot2 More C than C#... C# maybe just for the gui for configuering robot externally depending how involved you want it to be.
"Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>
-
Q: How many lines of C# code does it take to change a light bulb? A: One. A properly designed light bulb object would inherit a change method from a generic light bulb class, so just call it and your're done.
Being an end user and this feature was not requested in the original scope of the project I was asked to submit a Change Request Form. I was advised that the change will be reviewed by a committee and they would get back to with an estimate on cost and time to implement. In the meantime I sit in the dark hoping for the new feature to be implemented.
-
A thousand, as you need to create the interfaces so the bulb is not tightly coupled to the socket and the socket not knowing what type of bulb will it receive. And the implement them on the concrete classes Bulb and Socket Also, need to place 100 unit tests for both bulb and socket to manage how will they behave in different scenarios (with electric supply, without it, under water, under sand, etc) Finally, set your continuous integration tool so each time you need to change Bulb, it compiles, run tests and code coverage statistics and finally deploys the new bulb to the socket. Briefly, what comes to my mind :laugh:
"Whether you think you can, or you think you can't--either way, you are right." — Henry Ford "When I waste my time, I only use the best, Code Project...don't leave home without it." — Slacker007
-
Being an end user and this feature was not requested in the original scope of the project I was asked to submit a Change Request Form. I was advised that the change will be reviewed by a committee and they would get back to with an estimate on cost and time to implement. In the meantime I sit in the dark hoping for the new feature to be implemented.
:laugh: Sounds like we work at the same place!
-
A thousand, as you need to create the interfaces so the bulb is not tightly coupled to the socket and the socket not knowing what type of bulb will it receive. And the implement them on the concrete classes Bulb and Socket Also, need to place 100 unit tests for both bulb and socket to manage how will they behave in different scenarios (with electric supply, without it, under water, under sand, etc) Finally, set your continuous integration tool so each time you need to change Bulb, it compiles, run tests and code coverage statistics and finally deploys the new bulb to the socket. Briefly, what comes to my mind :laugh:
"Whether you think you can, or you think you can't--either way, you are right." — Henry Ford "When I waste my time, I only use the best, Code Project...don't leave home without it." — Slacker007
-
Q: How many lines of C# code does it take to change a light bulb? A: One. A properly designed light bulb object would inherit a change method from a generic light bulb class, so just call it and your're done.
-
Q: How many lines of C# code does it take to change a light bulb? A: One. A properly designed light bulb object would inherit a change method from a generic light bulb class, so just call it and your're done.
try a reboot. like everyone else