Better HN
topnewbestaskshowjobs
Log inSign up

devxpy

515 karma · joined Dec 27, 2017 (8y ago) · 421 submissions

https://github.com/devxpy
Submissions

comment 7y ago · link · parent

I could be wrong, but virtualenv, like pip, is not part of the core language. Its developed exclusively by pypa.

https://github.com/pypa/virtualenv

comment 7y ago · link · parent

I actually kinda liked having a virtualenv.

Although the hacks used to make it work, were not nice.

I would have loved to see core python suppport for virtualenv, which could probably avoid these hacks.

comment 7y ago · link · parent

Just so we're on the same page, this is the validation I was referring to -

https://docs.djangoproject.com/en/2.1/topics/checks/

Standardization is always an issue, I guess. Env vars seem to be the norm in the community in my experience, whatever that's worth..

comment 7y ago · link · parent

There is already a mechanism to validate the settings.py file inside django.

The different context stuff can be handled by using env vars, and a nice python wrapper, like python-decouple.

comment 7y ago · link · parent

The problem with code as configuration is that the config file is indeterministic and it takes longer to extract information from the file.

This has long been a problem in the python/pip community, as its basically impossible for the build tools to determine the dependencies of a package without fully downloading and running the setup.py file.

Static config files are static for a reason!

comment 7y ago · link · parent

Why are you ranting on packaging story, when this post is clearly about development workflow?

comment 7y ago · link · parent

> Should we try to build a society that optimizes for per capita happiness

Are you aware of the hedonic treadmill?

> Our modern concept of egalitarianism is mostly a product of religious thinking

You must be kidding. Religions promote the most brutal form of inequality ever. Study up on "dalits" in India.

comment 7y ago · link · parent

The problem is that religions have a reputation of tricking people into believing in stories, with a motive that might or might not be a good one.

Meditation, yoga are examples of the good one's. Sacrificing babies, worshipping cows are the bad one's.

Religions don't provide us with the tools to actually determine whether something is real or just a story.

The scientific method is to my knowledge the only feasible way to figure out the ground truth.

Religions do promote exploration of ideas, but they are mostly a waste of time and energy that might be better spent elsewhere.

comment 7y ago · link · parent

That was a legit question. I'm quite interested in why you find your job not boring/easy compared to when you were younger.

Is it because of the technology you work on, or is it the age factor?

I've not programmed long enough to actually feel this effect.

comment 7y ago · link · parent

What do you do? (asking for research purposes)

comment 7y ago · link · parent

No, i was just presenting a counter argument. I never had to actually implement KMP outside of uni though.

Interviews that require extra knowledge outside of what the job actually asks for are definitely broken.

comment 7y ago · link · parent

Have you ever tried to implement the KMP (https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93P...) pattern matching algorithm yourself?

I tried doing it -- even with the knowledge of how it works, it took me at least a day to get to an acceptable implementation.

comment 7y ago · link · parent

You think every programmer has a CS degree?

comment 7y ago · link · parent

Its a cult, man.

comment 7y ago · link · parent

> Because those are companies dominated by webdevs that can't be bothered to learn anything else.

Tell me about it!

comment 7y ago · link · parent

Nice point about fushsia.

But isn't the point of a truly cross platform framework just that? So what if fuschia has a different native toolkit. Maybe they are trying to launch a platform specific api that's more bare metal.

I mean Isn't the whole point of flutter is that you take the same app and run it anywhere?

comment 7y ago · link · parent

Can you link a specific issue that wasn't immediately a result of a problem with the user code, perhaps too much work on the main thread?

I have found the perf to be just fantastic on android. Especially compared to react native, which is a native offering.

comment 7y ago · link · parent

Yes, you are correct.

I think Flutter means native in the sense that it runs at native speed, perhaps even faster in some carefully selected apps

As for a look and feel thing, Flutter widgets feel alright to me..

comment 7y ago · link · parent

The flutter team has announced that it is now working on desktop and web ports of flutter.

What's interesting is that you can literally run the same app on all platforms, because flutter draws the whole ui in dart code, using the canvas. And well, dart can run basically anywhere now...

comment 7y ago · link · parent

That's very bold, considering the popularity of JavaScript, an esoteric, joke of a language in earlier times (no offence).

Bottom line, Its very safe to say that dart is a much better language than JS.

The language of choice has never ever, really mattered in software history.

And don't forget that the big G is behind this thing, which is well equipped to push it forward without the need of it being as popular as js.

comment 7y ago · link · parent

Speaking of "a viable, efficient, native and cross-platform GUI solution", I have high hopes for flutter.

comment 7y ago · link · parent

In that case, an important question might be, whether we can actually make it 10x faster.

Given a point in the Moore's law curve, can we actually make a single core that's as fast as 10 separate cores? If yes, Will that be more power, space and cost effective?

comment 7y ago · link · parent

Well here’s the thing though, I don’t feel like parallelism is just about speed. I for one like the idea of being able doing 10 things at once, and all tasks running at the same speed. It’s hard to do with current software, yes. But there a lot of room for improvement, no?

comment 7y ago · link · parent

Well maybe not in desktops, but don't you think that mobile devices (even micro controllers, like ESP8266) have a lot to benefit from multi-core, even for just regular apps that have nothing to do with number crunching/gaming etc.?

comment 7y ago · link · parent

Well, You'll be happy to know that a decorator is literally just a function that takes another function as its first argument.

    @app.route(...)
    def login():
        ...


Is literally the same thing as -

    def login():
        ...

    login = app.route(login, ...)

Hopefully that clears up the air a bit?

comment 7y ago · link · parent

Is it just me or does everyone just eventually resorts to "trying everything until it works" with CSS layout?

> Flex seems more flexible to me than CSS Grid.

Any day :)

comment 7y ago · link · parent

>Need to access the request? use `req`

Well, I don't see what's especially difficult about this?

    from flask import request

    @app.route('/login', methods=['GET', 'POST'])
    def login():
        if request.method == 'POST':
            return do_the_login()
        else:
            return show_the_login_form()
I would actually argue that this is better, since I have to type "request" only once.

Although I have to admitt, the middleware thing looks quite composable.

comment 7y ago · link · parent

> innovations like the amazing standard library

Excuse me?

comment 7y ago · link · parent

It might be plausible to consider the extremely large amount of sensory information humans are hooked up with. Computers generally only have very limited amount of sensory information, not to mention the inferiority of electronic sensors compared to the highly sophisticated biological ones.
1
678
15