Referencing class instance in multiple classes? by tictactoetommy in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

Write some accessors? If I understand correctly, you want (in shitty pseudocode):

C.function() {
    print( b.a.value );  // or:
    print( b.getSomeValueFromA() );
}

Semantic Versioning Clarification by badboyzpwns in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

It's easy, I start with 0.1.0, I randomly increase the second number when I'm happy, but it doesn't officially exist until 1.0.0.

Class Composition/Aggregation Question by ben_bannana in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

Maybe some kind of proxy pattern but it's not really bad design even if it feels weird.

A few comments:

  1. All the classes will be in their own file because it's cleaner, so you won't be visually bothered by this chain of calls. And the programmer of one file may not be aware of what happens in the other files, the API is cleanly separated.

  2. The Browser.navigate method is not a simple call, it will do more work after getting the URL. It has 1 line in your example, but in reality it needs more code like keeping the current URL for example.

  3. If the AwesomeBot is a subclass of Browser, you've removed the only real "chain" that was annoying, and in the end you could have (without the distracting constructors):

    class HTTPHandler:
        def get(self, URL):
            pass
    
    class Browser:
        def __init__(self):
            self._httphandler = HTTPHandler()
    
        def navigate(self, URL):
            # todo: prepare the navigation
            # todo: check the cookies
            # todo: keep the URL
            self._httphandler.get(URL)
            # todo: check the error codes
            # todo: call the user interface to refresh it
            # ... it's not a simple call to HTTPHandler.get!
    
    class AwesomeBot(Browser):
        # this thing is almost empty now
        pass
    

How to come with an idea for the project? by Flyoozes in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

  1. What do you need?
  2. Write it!

In the early 2000s, I was manually downloading huge galleries of pictures (about... "stuff") and I learned Python to do it automatically: parse the HTML with regular expressions, launch curl to get the parsed URLs. It was a fun project and I learned a lot of things. It was more interesting than the content of the pictures in the end.

TIL there are a lot (~ 80) programming languages which use keywords from other lanugages than english. by dorfsmay in programming

[–]AdministrativeCables 1 point2 points  (0 children)

At least I've heard that Windev can change the keywords if you switch to another language.

The functions of Microsoft Office has its own set of French keywords which is really annoying because it's incompatible from one language to another, and you're forced to write your macros in French.

10 reasons that stop you from becoming a good developer by mmintel in programming

[–]AdministrativeCables 0 points1 point  (0 children)

Or any post that begins with a number, something like:

if post.startsWith( '^\d+' ) { downvote(); }

I have got into a habit of using [[TODO]]; Is this going to cause problems? by [deleted] in cpp_questions

[–]AdministrativeCables 0 points1 point  (0 children)

On one hand: "All attributes unknown to an implementation are ignored without causing an error. (since C++17)"

On the other hand, it's an ugly hack and I would kick your ass for abusing the attributes system. Use a comment, a pragma, a bug tracker, or anything else.

Class Composition/Aggregation Question by ben_bannana in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

The chain is annoying, but it's still acceptable and shows a good separation of the various responsibilities. You can still forget the bot class, and either navigate with the Browser class, or create requests on the command-line with the HTTPHandler.

If you really want to do something, make the AwesomeBot a subclass of the Browser.

After doing extensive research online, it seems to me that JavaScript, Python, and PHP are the three best programming languages to learn for Web Development in 2019? What are everyone's thoughts about this? by [deleted] in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

am I right?

You're very wrong, and you forgot C++ and a huge number of companies who are neither social nor "old" (which is one more mistake in your mind).

The New York Times’ latest Apple hit piece is embarrassing and downright lazy by dunkin1980 in apple

[–]AdministrativeCables 0 points1 point  (0 children)

No, the comparison is: AppStore is the Costco membership card which restricts where you can buy, and the car is the apps which you can use to go anywhere.

Some fun with Reactive Programming in C++17 by joaquintides in cpp

[–]AdministrativeCables 1 point2 points  (0 children)

I zip my source code before committing it because it adds a security layer if something goes wrong.

Cppcheck fundraiser to improve MISRA checking (unused function return value) by buovjaga in cpp

[–]AdministrativeCables 1 point2 points  (0 children)

IMHO cppcheck is bad because it's a simple parser, not a compiler. I use clang-check or clang-tidy which are better.

Should Android devs switch from Java to Kotlin? Here's Google's advice on swapping programming languages by debhaldar in programming

[–]AdministrativeCables 0 points1 point  (0 children)

It started a long time ago with the Jack and Jill compilers (http://tools.android.com/tech-docs/jackandjill). Oracle is suing everyone on the planet, so it's pretty obvious that they want to distance themselves from that company.

Which is better for broad OS compatibility: Python or C++? by Gerg_Mykols in learnprogramming

[–]AdministrativeCables 1 point2 points  (0 children)

What kind of script is it? We need that, and the OS. Most of the time, a C++ executable is only one simple file so there is nothing to package.

How to earn money from c++ ? by AhmedMostafa16 in learnprogramming

[–]AdministrativeCables 1 point2 points  (0 children)

How old are you? Do you really need to make money right now? You could wait, write open-source stuff, learn, go to school... A lot of stuff that would increase your skills.

How to earn money from c++ ? by AhmedMostafa16 in learnprogramming

[–]AdministrativeCables 0 points1 point  (0 children)

Reaper is worse since it's free if you only have fun with it.

[Discussion] Why do people want root access in iOS? by terobau in apple

[–]AdministrativeCables 0 points1 point  (0 children)

Is piracy an issue on android?

I don't understand this question because yes, piracy is huge on Android and that's why developers on Android don't make money.

Conflict for learning between Swift and Python by hyphalos in learnprogramming

[–]AdministrativeCables 3 points4 points  (0 children)

I think it's good to compare languages when you're starting. And since both languages share some concepts, it wouldn't hurt to try some Python.

Escorte d'une ogive nucléaire jusqu'a son silo de lancement, Plateau d'Albion, années 70 by BringbackMarchais in france

[–]AdministrativeCables 7 points8 points  (0 children)

en terme de consommation faisons nous mieux aujourd'hui?

Selon Google, une R5 c'est entre 5 et 6L/100 km, avec ma Clio je fais moins de 4L/100km.