Is it ok to have no resistor connected to capacitor charging?

So, I have a circuit set up like the one in the attached image, and my goal here is to have an LED that instantly lights up when a connection (the pushbutton in the diagram for example) is made, and slowly fades off as the capacitor discharges when the connection is broken.

Now, normally a small amount of resistance to the capacitor wouldn't be a problem, but the connection sensor I'm using will be one of those springs wrapped around a rod to sense a certain amount of motion (not sure what they're called) and these only provide connection for maybe a couple milliseconds, which won't be enough time to charge the capacitor.

I've noticed that as I increase the resistance on the 100 ohm resistor in the diagram, the capacitor takes longer to charge up and vise versa, which makes sense, so I figured no resistance would charge it nearly instantaneously. However, I didn't want to try this before checking if it's ok first because... y'know... no resistance on something that normally has resistance can end badly...

Those motion switches cannot carry much current. If you try to charge a large capacitor through it, you may destroy the switch. Check the data sheet for the switch for the limitations.

The switch should be used to trigger a logic circuit that can charge the capacitor.

If you have "no" resistance in line with a capacitor when you charge it then the current drawn from the source is infinite.

This is not possible because something else limits the current, in the case of that physical layout diagram ( it is not a schematic, a schematic is so much easier to read ) the internal resistance of the battery is going to limit the current.

The point about of electronic design is that you should be in control of every aspect of the circuit. Without a resistor you are not in control of this. A value of 100R is quite high, you could reduce this to 10R or even lower, then you ( or your design ) is in control of what happens.

Thanks; how this sound: what if I attach the motion sensor to a transistor and then decrease the resistance on the capacitor to ~10 ohms?

You say you're using it with one of those cheap spring motion switches?

I'd just try it without the resistor and see how the point of contact looks after some testing - those switches can't be very expensive... Worst case, you trash a switch and do it differently, and best case, you have a simpler, cheaper design.

ok; I'll try that. The smaller the circuit can be, the better, anyway.

I doubt a 9V battery can trash any switch!

I would connect the LED differently.

+batt to one side of the switch.
Other side of the switch to the 330ohm resistor > LED > negative batt.
Other side of the switch also to the 10ohm resistor > cap > negative batt.

This lights up the LED fully, without delay, when contact is made.
Then the LED empties the cap through 330+10 = 340ohm
Leo..

just do what wawa said

he knows hardware and these people are quite rare nowadays