9 ms·
"First a punch is just a punch, Then a punch is not only a punch, And finally a punch is just a punch" (heard from Bruce Lee) Basically it means that in the be
by elviejo 5y ago
"First a punch is just a punch,
Then a punch is not only a punch,
And finally a punch is just a punch" (heard from Bruce Lee)
Basically it means that in the beginning we punch like we can.. then a martial arts student learns the proper and different ways to punch.. so a punch is no longer just a punch... Is a lot of instructions..
Then to sheer practice and repetition the right way to punch becomes second nature.. so the right way to punch is the only way so it's only a punch again.
So coding it's just ifs and loops... Then is OOP and Functional and Logic... But then once you transcend all those paradigms you understand that is all ifs and loops.
- okareaman 5y agoI started off writing a lot of 68000 machine code. I was always amazed what you could accomplish with a lot of loops and branches. I never lost that sense that at whatever higher level I was at later on, it was all loops and branches.
- DrAwdeOccarim 5y agoReminds me of biological metabolic systems. All loops and branches…
- ellimilial 5y agoWith a lot of fuzziness, some state and temporal stuff.
- DrAwdeOccarim 5y agoYea, the fuzziness comes from protons shuttling about, tunneling around, electrons moving in cycles with phosphates. It's all just vibrating, bumping and bumbling about. I remember how blown my mind was when I first learned that all reactions catalyzed by enzymes would have happened anyway given enough time and the enzymes just tune the systems to work in concert in a time frame conducive to life.
- okareaman 5y agoStephen Wolfram thinks the entire universe is built from simple rules https://en.wikipedia.org/wiki/A_New_Kind_of_Science https://en.wikipedia.org/wiki/A_New_Kind_of_Science
- peterburkimsher 5y agoFor the algorithm to work in many dimensions (XML tags), I feel like it must be a simple algorithm. Rule 110 is known to be Turing-complete. https://en.wikipedia.org/wiki/Rule_110 https://en.wikipedia.org/wiki/Rule_110 I have a feeling that Rule 90 is the most efficient algorithm: the Sierpiński Triangle, self-sacrifice, infinite recursion to a perfect pattern. I'm not mathematically talented enough to prove that though. https://mathworld.wolfram.com/Rule90.html https://mathworld.wolfram.com/Rule90.html Please come to chat about A New Kind of Science on Facebook! A couple of weeks ago I noticed that the page didn't exist, so created it. Hopefully Wolfram doesn't mind. We stand on the shoulders of giants. https://www.facebook.com/A-New-Kind-of-Science-100405265775721 https://www.facebook.com/A-New-Kind-of-Science-1004052657757...
- Eelongate 5y agoI'm no physicist, but doesn't the Standard Model fit on a few pieces of paper? That the universe has rules that are a lot simpler than the behavior that emerges from those rules doesn't seem like novel claim. Wolfram's idea to examine the universe by exploring CA-space is the novel part I think.
- GhettoComputers 5y agoHave you seen this? https://news.ycombinator.com/item?id=25788317 https://news.ycombinator.com/item?id=25788317 Seems like we lose a lot of good technology and progress for random reasons, like the “ram” of society is finite.
- okareaman 5y agoYes, it's a good talk. Think of all the extremely talented internal combustion engine engineers that will be obsolete in 20 - 30 years.
- GhettoComputers 5y agoObsolete or repurposed? People studying physics like string theory may be completely wrong, but their skills can still be useful.
- aj7 5y agoThey’re obsolete now, except on YouTube.
- b112 5y agoICE has thousands of uses, they aren't just for cars. An example? Up above the treeline, there are communities relying on diesel for power. Solar is a no go, with months of darkness. Wind turbines are hard to maintain at -50C, and snow and ice can impede them. Even electric cars can only cover some of car use-cases, both due to range and refuel time issues. Expect ICE in 2050 still. And in most places, electric cars take petrol out of the car, and instead, see things like coal or natural gas burned, to make the electricity to charge them.
- ZeroGravitas 5y ago> And in most places, electric cars take petrol out of the car, and instead, see things like coal or natural gas burned, to make the electricity to charge them. This is true, but also a good thing, while you present it as at best a wash and possibly a negative. Coal powered EVs are better than gasoline ICEs in most situations, and nobody has a 100% coal grid anymore so the benefits are even greater. There's lots of reasons why but the main one, which is relevant to this conversation as well, is the inefficiency of ICE compared with electric motors.
- julian55 5y agoYes, one of my early jobs was writing Z80 code and I have the same sense.
- okareaman 5y agoWhen I eventually learned C it took me awhile to stop optimizing and let the compiler do it
- Aeolun 5y agoUltimately all the interesting stuff happens in loops and branches, the rest is just organization.
- 6510 5y agoThe organization is only needed for the inevitable bloat you add later to justify the rewrite. Its something like the sage uncovers the boiler, points at it and announces: Look! It is a beautiful marvel of technology! Why would you want to cover it up? Look! You might learn something!
- suifbwish 5y agoIt’s not about how many loops you have; it’s about what you put in them and how deep.
- sabellito 5y agoTrying to explain Zen by starting with "basically" is a bit ambitious of your part haha :)
- deleted 5y ago[deleted]
- BobbyJo 5y agoEverything else is only there for the monkeys pressing the keys.
- brianjlogan 5y agoI love this :). How much of mankind is creating things sheerly for their pleasure?
- filoeleven 5y agoAnd the monkeys reading the code to see what it does. I don’t recall who it was exactly but some early computing heavyweight, maybe Von Neumann, thought that any language which requires a compiler was a waste of resources.
- erik_seaberg 5y agoComputers used to be so expensive that it made more sense to hire a “programmer” to convert an “analyst’s” flowchart into machine code using only a keypunch.
- reikonomusha 5y agoCoding is not "ifs and loops, then $foo". That's a false premise. If you want to be fundamentalist about it (which I don't advise), a CPU is just a state machine. assembly instruction + machine state => new machine state Our idea of "jumping around code" and "control flow", as in for loops or if statements, are themselves abstractions of control state (an instruction pointer) and data state (perhaps a CPU register). So coding is really "the execution of a notional interpreter (aka semantics), then $foo." That gets to the absolute bottom of what "code" even is: instructions for an interpreting device (be it physical or mathematical).
- rzzzt 5y agoOh, but CPU instructions can be built up from a series of μops which are then executed out of order or in an overlapping fashion, making both "instruction" and "state" boundaries in your equation more fuzzy than it looks. So at the absolute-absolute bottom of "code", it is instructions for an abstract model of an interpretative device.
- reikonomusha 5y ago(I'm not sure if your "but" is a retort, or an addendum. Assuming retort...) We can consider one more level of implementation machinery, but I fail to understand how uops aren't another form of instruction, and CPU internal gobbledygook like register files, caches, etc. aren't another form of state. It doesn't seem so fuzzy.
- rzzzt 5y agoThe difference is that you don't get to access the uops machine, subsets/sequences of that instruction set are offered as (macro-)instructions instead. Programming happens on the idea of a CPU.
- valenterry 5y ago> Oh, but CPU instructions ... And who says your code runs on a CPU? :^)
- marton78 5y agoBefore enlightenment: chop wood, carry water. After enlightenment: chop wood, carry water.
- goatlover 5y agoOr a set of composable primitives if you’re using an array language. What, you think if and for aren’t abstractions over jump/goto?
- laurent92 5y agoThat’s what disappoints me in modern Java. There is practically no ifs. It makes it inaccessible to beginners on the project, and the streams are about twice as slow… just because devs think they are more clever if they pile 7 “.map()” to transform a list. list.stream().filter(Objects::nonNull).map(User::getUsername).filter(Objects::nonNull).filter(name -> name.contains(searchString)).map(name -> “We have found your user: “ + name).orElse(“We haven’t found”); Basically unreadable. for (User user : list) if (user != null && user.getName() != null && user.getName().contains(searchString)) return “Found it!”; return “Not found”;
- ineedasername 5y agoJava has never really liked to do in 10 characters anything that could be done in 30 characters instead, especially if it obfuscated things a bit more at the same time.
- the_gipsy 5y agoYou forgot to add null-check ifs for `list` and `searchString`. Oh and check-wrap for exceptions too!
- peoplefromibiza 5y agothe two snippets you posted do different things In a list John Jonhatan Joy searching for "Jo" returns all three of them in the first example, it stops when the first has been found in the second. Start including the tedious bits about adding found items to the list and the waste of intermediate variables and your "clear" code is wrapped around a lot of repetitions, that only add noise. It just happens that you are more familiar with the second style, but pipelines are better in many other ways, clarity of intentions being one of them.
- RHSeeger 5y agoThe code he posted isn't actually valid because you can't "orElse" a list. That being said, I would presume it was meant to include a "findFirst". Something like list.stream().filter(Objects::nonNull) .map(User::getUsername).filter(Objects::nonNull) .findFirst(name -> name.contains(searchString)) .map(name -> “We have found your user: “ + name) .orElse(“We haven’t found”);
- williamdclt 5y agoThat's more or less shu-ha-ri https://martinfowler.com/bliki/ShuHaRi.html https://martinfowler.com/bliki/ShuHaRi.html. Very useful concept, I often refer to it: for example to argue why "just be agile" probably won't work when there's juniors or when the team is new-ish. That's skipping to ri, start with shu (scrum or whatever set process).
- ldehaan 5y agoBecome water my friend - don't stick to just one way.
- z2 5y agoBefore one studies Zen, mountains are mountains and waters are waters; after a first glimpse into the truth of Zen, mountains are no longer mountains and waters are no longer waters; after enlightenment, mountains are once again mountains and waters once again waters. Translation from http://www.livinglifefully.com/zensayings2.htm http://www.livinglifefully.com/zensayings2.htm
- btschaegg 5y ago"Before enlightenment: Ifs and loops. After enlightenment: Ifs and loops." :)
- rogerkirkness 5y agoPerceived complexity peaks at intermediate skill. There's a concept in learning theory that perceived complexity is diamond shaped.
- powerset 5y agoI wonder whether you could apply this analogy to physics and science in general. If so it seems like we haven't reached the peak/middle yet.
- throwawayboise 5y agoOne of my quips about programming was "it's all just ones and zeroes"
- justicezyx 5y ago“参禅之初,看山是山,看水是水;禅有悟时,看山不是山,看水不是水;禅中彻悟,看山仍然山,看水仍然是水。” These are all from the Zen philosphy, it says: When getting start with Zen, I see hill as hill, water as water When get experienced with Zen, I see hill as more than hill, water as more than water. When finally got mature with Zen, I once again see hill as hill, and water as water.
- suifbwish 5y agoAs with so many other things, through mastery and practice of the “right ways” you will often discover flaws in them and that is when that which you are practicing begins to become a true art form.
- grouphugs 5y ago[dead]