3 ms·
that's great! I always wanted something like this for Python the problem is, I rarely feel like I can just use all these cool-syntax libraries for production,
by va1en0k 16y ago
that's great! I always wanted something like this for Python
the problem is, I rarely feel like I can just use all these cool-syntax libraries for production, since they don't add a lot of value. why do I need a whole dependency dependency for something that just make one or two line more readable?
I've written a syntax enhancer for PHP once, but it just added one feature (array dereferencing) for a small but noticeable price of setting up; I never considered it for production usage because there weren't enough features to justify it. (CoffeeScript is an example of justifiable price for huge changes and multiple ideas)
for personal just-for-fun projects (like solving project euler problems) it's an awesome idea, though
- JanezStupar 16y agoWell, the way I see it - these tools open up whole new array of possibilities of writing code in a more intuitive fashion. This may enable a completely different and cleaner architecture or a mess. Probably as always it starts with a mess and results in clean along the way once you resolve all the problems you should know about but didn't. Key point is that this is exactly the way our languages and industry evolves. jQuery also started as someones just-for-fun project and poised risk (and still does) to all the projects that used it. In reality a person needs to go and just use stuff like this, with experience you learn to see if something works or not.
- djacobs 16y agoThe way I code Python, this has a real potential to clean up any codebase I'm working on in a major way. (I've complained several times about the need for intuitive chaining in Python.)
- ohyes 16y agoWhat I would like to see is a way to separate the the syntax of my code from the semantics of my code. Ideally, my code editor should be able to take the same piece of code and display it in a few different styles of syntax. Then I could write my code in whatever syntax I want, and someone else could flip a switch and change it into their preferred style of syntax. I am honestly kind of puzzled as to why the concept of MVC disappears as soon as we start writing coding tools. It seems that for any reasonable syntax that you can write a parser for; it should also be possible to write an emitter from an 'intermediate' syntax tree.
- asharp 16y agoFrom what I remember, the problem isn't producing something that parses (for the emitter), the problem is producing something that could still be considered human readable and/or not horribly ugly.
- wladimir 16y agoI've also thought about this a few times. It's a pity that the SCID (Source Code in Database) paradigm never really caught on. It would make things such as representing the same code with different syntax (depending on user preference) possible. It also makes refactoring/renaming easy as names are only stored in one place, the rest refers to the same 'entity'. And you're right, best practices for data formats are applied everywhere except for code. After all, we're now in 2011 and still using old-fashioned text files.
- gerner 16y agoI've worked lots of smart engineers who use these sort of "just-for-fun" tools, or simple hacks. At the time I often think exactly as you do, "why do I need a whole dependency..." And often I leave feeling the same way. But more than once-as simple as putting null before equalities in conditionals, or as complex as setting up squid to cache just robots.txt for a crawler-I've been surprised and glad that I'm working with that quirky dude who insists on paying a small price for something useful. And I find myself using it again in the future because it actually gave me real value, made me and my team more productive, or happier, and hopefully made our product better.